class_docstr: Tests reading from local workers if `target_workers` is `local`.
class_docstr_tok: ["Tests","reading","from","local","workers","if","`","target_workers","`","is","`","local","`","."]
code: def testAnonymousJobWithDifferentTargetWorkers(self):
      num_local_workers, num_remote_workers = (3, 3)
      cluster = multi_process_cluster.MultiProcessCluster(
          num_local_workers, num_remote_workers
      )
      num_elements = 10
      ds = dataset_ops.Dataset.range(num_elements)
      datasets = {
          target_workers: self.make_distributed_dataset(
              ds, cluster, target_workers=target_workers
          )
          for target_workers in ["AUTO", "ANY", "LOCAL"]
      }
  
      num_workers = num_local_workers + num_remote_workers
      self.assertDatasetProduces(
          datasets["AUTO"],
          num_workers * list(range(num_elements)),
          assert_items_equal=True,
      )
      self.assertDatasetProduces(
          datasets["ANY"],
          num_workers * list(range(num_elements)),
          assert_items_equal=True,
      )
      self.assertDatasetProduces(
          datasets["LOCAL"],
          num_local_workers * list(range(num_elements)),
          assert_items_equal=True,
      )
  
imports: import multiprocessing
  from absl.testing import parameterized
  from tensorflow.python.data.experimental.kernel_tests.service import multi_process_cluster
  from tensorflow.python.data.experimental.kernel_tests.service import test_base
  from tensorflow.python.data.experimental.ops import data_service_ops
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
label_desc: Use image node_id 12 for calling the LocalWorkersTest obj's underlying member method code with example usage: obj.testAnonymousJobWithDifferentTargetWorkers() without return types