class_docstr: Class which stores batches of adversarial images generated by attacks.
class_docstr_tok: ["Class","which","stores","batches","of","adversarial","images","generated","by","attacks","."]
docstr: Init list of adversarial batches from dataset batches and submissions.
  
  Args:
    dataset_batches: instances of DatasetBatches
    attack_submission_ids: iterable with IDs of all (targeted and nontargeted)
      attack submissions, could be obtains as
      CompetitionSubmissions.get_all_attack_ids()
docstr_tok: ["Init","list","of","adversarial","batches","from","dataset","batches","and","submissions",".","Args",":","dataset_batches",":","instances","of","DatasetBatches","attack_submission_ids",":","iterable","with","IDs","of","all","(","targeted","and","nontargeted",")","attack","submissions",",","could","be","obtains","as","CompetitionSubmissions.get_all_attack_ids","(",")"]
code: def init_from_dataset_and_submissions_write_to_datastore(
      self, dataset_batches, attack_submission_ids
  ):
      """Init list of adversarial batches from dataset batches and submissions.
  
      Args:
        dataset_batches: instances of DatasetBatches
        attack_submission_ids: iterable with IDs of all (targeted and nontargeted)
          attack submissions, could be obtains as
          CompetitionSubmissions.get_all_attack_ids()
      """
      batches_x_attacks = itertools.product(
          dataset_batches.data.keys(), attack_submission_ids
      )
      for idx, (dataset_batch_id, attack_id) in enumerate(
          batches_x_attacks
      ):
          adv_batch_id = ADVERSARIAL_BATCH_ID_PATTERN.format(idx)
          self.add_batch(
              adv_batch_id,
              {
                  "dataset_batch_id": dataset_batch_id,
                  "submission_id": attack_id,
              },
          )
      self.write_to_datastore()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  from io import BytesIO
  from io import StringIO
  import itertools
  import logging
  import os
  import zipfile
  from six import iteritems
  from six import iterkeys
  from six import itervalues
label_desc: Use image node_id 2 for calling the AversarialBatches obj's underlying member method code with example usage: obj.init_from_dataset_and_submissions_write_to_datastore(dataset_batches, attack_submission_ids) without return types