code: def enable_collective_ops(cluster_resolver):
      context.context().configure_collective_ops(
          collective_leader="/job:worker/replica:0/task:0"
      )
      config_proto = copy.deepcopy(context.context().config)
      server_def = tensorflow_server_pb2.ServerDef(
          cluster=cluster_resolver.cluster_spec().as_cluster_def(),
          default_session_config=config_proto,
          job_name=cluster_resolver.task_type,
          task_index=cluster_resolver.task_id,
          protocol=cluster_resolver.rpc_layer or "grpc",
      )
      context.context().enable_collective_ops(server_def)
  
imports: import copy
  import os
  import threading
  import time
  from absl.testing import parameterized
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python.distribute import cluster_resolver
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import multi_process_runner
  from tensorflow.python.distribute import multi_worker_test_base
  from tensorflow.python.eager import context
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import collective_ops
label_desc: Use image node_id 1 for calling a global function with example usage: enable_collective_ops(cluster_resolver) without return types