code: def test_init_from_classification_batches(self):
      class_batches = {
          "CBATCH000000": {"submission_id": "s1"},
          "CBATCH000001": {"submission_id": "s2"},
          "CBATCH000002": {"submission_id": "s3"},
      }
      expected_values = [
          {
              "claimed_worker_id": None,
              "claimed_worker_start_time": None,
              "is_completed": False,
              "error": None,
              "elapsed_time": None,
              "submission_id": "s1",
              "shard_id": None,
              "output_classification_batch_id": "CBATCH000000",
          },
          {
              "claimed_worker_id": None,
              "claimed_worker_start_time": None,
              "is_completed": False,
              "error": None,
              "elapsed_time": None,
              "submission_id": "s2",
              "shard_id": None,
              "output_classification_batch_id": "CBATCH000001",
          },
          {
              "claimed_worker_id": None,
              "claimed_worker_start_time": None,
              "is_completed": False,
              "error": None,
              "elapsed_time": None,
              "submission_id": "s3",
              "shard_id": None,
              "output_classification_batch_id": "CBATCH000002",
          },
      ]
      defense_work = work_data.DefenseWorkPieces(self.datastore_client)
      defense_work.init_from_class_batches(class_batches)
      assertCountEqual(
          self, expected_values, defense_work.work.values()
      )
      defense_work.write_all_to_datastore()
      defense_work = work_data.DefenseWorkPieces(self.datastore_client)
      defense_work.read_all_from_datastore()
      assertCountEqual(
          self, expected_values, defense_work.work.values()
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import unittest
  from six import assertCountEqual
  from six import itervalues
  from eval_lib import work_data
  from eval_lib.tests import fake_cloud_client
label_desc: Use image node_id 2 for calling the DefenseWorkPiecesTest obj's underlying member method code with example usage: obj.test_init_from_classification_batches() without return types