class_docstr: Class which encapsulate logit of the worker.
  
  Main entry point of this class is EvaluationWorker.run_work method which
  performs cleanup of temporary directories, then runs
  EvaluationWorker.run_attacks and EvaluationWorker.run_defenses
class_docstr_tok: ["Class","which","encapsulate","logit","of","the","worker",".","Main","entry","point","of","this","class","is","EvaluationWorker.run_work","method","which","performs","cleanup","of","temporary","directories",",","then","runs","EvaluationWorker.run_attacks","and","EvaluationWorker.run_defenses"]
docstr: Initializes EvaluationWorker.
  
  Args:
    worker_id: ID of the worker
    storage_client: instance of eval_lib.CompetitionStorageClient
    datastore_client: instance of eval_lib.CompetitionDatastoreClient
    storage_bucket: name of the Google Cloud Storage bucket where all
      competition data is stored
    round_name: name of the competition round
    dataset_name: name of the dataset to use, typically 'dev' of 'final'
    blacklisted_submissions: optional list of blacklisted submissions which
      are excluded from evaluation
    num_defense_shards: optional number of shards to use for evaluation of
      defenses
docstr_tok: ["Initializes","EvaluationWorker",".","Args",":","worker_id",":","ID","of","the","worker","storage_client",":","instance","of","eval_lib.CompetitionStorageClient","datastore_client",":","instance","of","eval_lib.CompetitionDatastoreClient","storage_bucket",":","name","of","the","Google","Cloud","Storage","bucket","where","all","competition","data","is","stored","round_name",":","name","of","the","competition","round","dataset_name",":","name","of","the","dataset","to","use",",","typically","'dev","'","of","'final'","blacklisted_submissions",":","optional","list","of","blacklisted","submissions","which","are","excluded","from","evaluation","num_defense_shards",":","optional","number","of","shards","to","use","for","evaluation","of","defenses"]
code: def __init__(
      self,
      worker_id,
      storage_client,
      datastore_client,
      storage_bucket,
      round_name,
      dataset_name,
      blacklisted_submissions="",
      num_defense_shards=None,
  ):
      """Initializes EvaluationWorker.
  
      Args:
        worker_id: ID of the worker
        storage_client: instance of eval_lib.CompetitionStorageClient
        datastore_client: instance of eval_lib.CompetitionDatastoreClient
        storage_bucket: name of the Google Cloud Storage bucket where all
          competition data is stored
        round_name: name of the competition round
        dataset_name: name of the dataset to use, typically 'dev' of 'final'
        blacklisted_submissions: optional list of blacklisted submissions which
          are excluded from evaluation
        num_defense_shards: optional number of shards to use for evaluation of
          defenses
      """
      self.worker_id = int(worker_id)
      self.storage_client = storage_client
      self.datastore_client = datastore_client
      self.storage_bucket = storage_bucket
      self.round_name = round_name
      self.dataset_name = dataset_name
      self.blacklisted_submissions = [
          s.strip() for s in blacklisted_submissions.split(",")
      ]
      if num_defense_shards:
          self.num_defense_shards = int(num_defense_shards)
      else:
          self.num_defense_shards = None
      logging.info(
          "Number of defense shards: %s", str(self.num_defense_shards)
      )
      # init client classes
      self.submissions = eval_lib.CompetitionSubmissions(
          datastore_client=self.datastore_client,
          storage_client=self.storage_client,
          round_name=self.round_name,
      )
      self.dataset_batches = eval_lib.DatasetBatches(
          datastore_client=self.datastore_client,
          storage_client=self.storage_client,
          dataset_name=self.dataset_name,
      )
      self.adv_batches = eval_lib.AversarialBatches(
          datastore_client=self.datastore_client
      )
      self.attack_work = eval_lib.AttackWorkPieces(
          datastore_client=self.datastore_client
      )
      self.defense_work = eval_lib.DefenseWorkPieces(
          datastore_client=self.datastore_client
      )
      self.class_batches = eval_lib.ClassificationBatches(
          datastore_client=self.datastore_client,
          storage_client=self.storage_client,
          round_name=self.round_name,
      )
      # whether data was initialized
      self.attacks_data_initialized = False
      self.defenses_data_initialized = False
      # dataset metadata
      self.dataset_meta = None
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from builtins import int
  import argparse
  import json
  import logging
  import os
  import random
  import shutil
  import subprocess
  import time
  import uuid
  from six import iteritems
  import eval_lib
  from cleverhans.utils import shell_call
label_desc: Use image node_id 1 to create a new EvaluationWorker object from inherited base classes: object with example: obj = EvaluationWorker(worker_id, storage_client, datastore_client, storage_bucket, round_name, dataset_name, blacklisted_submissions, num_defense_shards)