code: def normalize_cluster_spec(cluster_spec):
      """Makes `cluster_spec` into a `ClusterSpec` object.
  
      Args:
        cluster_spec: a dict, ClusterDef or ClusterSpec object specifying the
          cluster configurations.
  
      Returns:
        a `ClusterSpec` object.
  
      Raises:
        ValueError: if `cluster_spec` is not a dict or a `ClusterSpec` or a
          `ClusterDef`.
      """
      if isinstance(cluster_spec, (dict, cluster_pb2.ClusterDef)):
          return server_lib.ClusterSpec(cluster_spec)
      elif not isinstance(cluster_spec, server_lib.ClusterSpec):
          raise ValueError(
              "`cluster_spec' should be dict or a `tf.train.ClusterSpec` or a "
              "`tf.train.ClusterDef` object"
          )
      return cluster_spec
  
file_path: tensorflow/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 1 for calling a global function with example usage: normalize_cluster_spec(cluster_spec) and returns: cluster_spec, server_lib