code: def test_compute_work_stats(self):
      self.reset_work_pieces()
      self.work_pieces.work["w11"] = {
          "submission_id": "s1",
          "output_adversarial_batch_id": "o1",
          "claimed_worker_id": "worker1",
          "claimed_worker_start_time": -1,
          "is_completed": True,
          "elapsed_time": 1,
      }
      self.work_pieces.work["w12"] = {
          "submission_id": "s1",
          "output_adversarial_batch_id": "o2",
          "claimed_worker_id": "worker2",
          "claimed_worker_start_time": -1,
          "is_completed": False,
      }
      self.work_pieces.work["w21"] = {
          "submission_id": "s2",
          "output_adversarial_batch_id": "o1",
          "claimed_worker_id": "worker1",
          "claimed_worker_start_time": -1,
          "is_completed": True,
          "elapsed_time": 5,
      }
      self.work_pieces.work["w22"] = {
          "submission_id": "s2",
          "output_adversarial_batch_id": "o2",
          "claimed_worker_id": "worker2",
          "claimed_worker_start_time": -1,
          "is_completed": True,
          "elapsed_time": 10,
          "error": "err",
      }
      self.work_pieces.work["w23"] = {
          "submission_id": "s2",
          "output_adversarial_batch_id": "o1",
          "claimed_worker_id": "worker1",
          "claimed_worker_start_time": -1,
          "is_completed": True,
          "elapsed_time": 7,
      }
      stats = self.work_pieces.compute_work_statistics()
      for v in itervalues(stats):
          v["eval_times"] = sorted(v["eval_times"])
      self.assertDictEqual(
          {
              "s1": {
                  "completed": 1,
                  "num_errors": 0,
                  "error_messages": set(),
                  "eval_times": [1.0],
                  "min_eval_time": 1.0,
                  "max_eval_time": 1.0,
                  "mean_eval_time": 1.0,
                  "median_eval_time": 1.0,
              },
              "s2": {
                  "completed": 3,
                  "num_errors": 1,
                  "error_messages": set(["err"]),
                  "eval_times": [5.0, 7.0],
                  "min_eval_time": 5.0,
                  "max_eval_time": 7.0,
                  "mean_eval_time": 6.0,
                  "median_eval_time": 6.0,
              },
          },
          stats,
      )
  
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 20 for calling the WorkPiecesBaseTest obj's underlying member method code with example usage: obj.test_compute_work_stats() without return types