class_docstr: Subclass which represents work pieces for adversarial attacks.
docstr: Initializes work pieces from adversarial batches.
  
  Args:
    adv_batches: dict with adversarial batches,
      could be obtained as AversarialBatches.data
code: def init_from_adversarial_batches(self, adv_batches):
      """Initializes work pieces from adversarial batches.
  
      Args:
        adv_batches: dict with adversarial batches,
          could be obtained as AversarialBatches.data
      """
      for idx, (adv_batch_id, adv_batch_val) in enumerate(
          iteritems(adv_batches)
      ):
          work_id = ATTACK_WORK_ID_PATTERN.format(idx)
          self.work[work_id] = {
              "claimed_worker_id": None,
              "claimed_worker_start_time": None,
              "is_completed": False,
              "error": None,
              "elapsed_time": None,
              "submission_id": adv_batch_val["submission_id"],
              "shard_id": None,
              "output_adversarial_batch_id": adv_batch_id,
          }
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from builtins import int
  from io import StringIO
  import pickle
  import random
  import time
  import numpy
  from six import iteritems
  from six import itervalues
  from six import text_type
label_desc: Use image node_id 2 for calling the AttackWorkPieces obj's underlying member method code with example usage: obj.init_from_adversarial_batches(adv_batches) without return types