class_docstr: The worker context class.
  
  This context object provides configuration information for each task. One
  context manager with a worker context object will be created per
  invocation to the `worker_fn` where `get_current_worker_context` can be called
  to access the worker context object.
docstr: Return the master target for a task.
docstr_tok: ["Return","the","master","target","for","a","task","."]
code: def _get_master_target(self):
      """Return the master target for a task."""
      # If cluster_spec is None or empty, we use local master.
      if (
          not self._cluster_spec
          or self._task_type == _TaskType.EVALUATOR
      ):
          return ""
  
      # If task_type is None, then it is in-graph replicated training. In this
      # case we use the chief or first worker's master target.
      if not self._task_type:
          if _TaskType.CHIEF in self._cluster_spec.jobs:
              task_type = _TaskType.CHIEF
              task_id = 0
          else:
              assert _TaskType.WORKER in self._cluster_spec.jobs
              task_type = _TaskType.WORKER
              task_id = 0
      else:
          task_type = self._task_type
          task_id = self._task_id
  
      prefix = ""
      if self._rpc_layer:
          prefix = self._rpc_layer + "://"
      return (
          prefix + self._cluster_spec.job_tasks(task_type)[task_id or 0]
      )
  
imports: import copy
  import json
  import os
  import threading
  import time
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.distribute import distribute_coordinator_context
  from tensorflow.python.distribute import multi_worker_util
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import coordinator
  from tensorflow.python.training import monitored_session
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 5 for calling the _WorkerContext obj's underlying member method code with example usage: obj._get_master_target() and returns: unknown, str