code: def coordination_leader(cluster_spec):
      """Return the task name of the coordination service leader.
  
      Args:
        cluster_spec: a dict, `ClusterDef` or `ClusterSpec` object sxpecifying the
          cluster configurations.
  
      Returns:
        a string indicating the task name of the coordination service leader.
      """
      cluster_spec = normalize_cluster_spec(cluster_spec)
  
      # No need to set coordination service leader for local.
      if not cluster_spec.as_dict():
          return ""
  
      # Use PS 0 if parameter servers are in the cluster
      if "ps" in cluster_spec.jobs:
          return "/job:ps/replica:0/task:0"
  
      # Use chief if chief is in the cluster.
      if "chief" in cluster_spec.jobs:
          return "/job:chief/replica:0/task:0"
  
      # Use worker 0 if no chief job.
      assert "worker" in cluster_spec.jobs
      return "/job:worker/replica:0/task:0"
  
file_path: tensorflow-upstream/tensorflow/python/distribute/multi_worker_util.py
imports: from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.python.distribute import distribute_coordinator_context
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 6 for calling a global function with example usage: coordination_leader(cluster_spec) and returns: str, str, str, str