code: def with_dispatch_context(worker_obj):
      previous_context = getattr(_dispatch_context, "current", None)
      _dispatch_context.current = DispatchContext(worker_obj)
      yield
      _dispatch_context.current = previous_context
  
file_path: tensorflow-upstream/tensorflow/python/distribute/coordinator/coordinator_context.py
imports: import contextlib
  import threading
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.distribute.coordinator import remote_value
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.util import compat
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 2 for calling a global function with example usage: with_dispatch_context(worker_obj) without return types