code: def reset_eager(fn):
      def wrapper(*args, **kwargs):
          try:
              return fn(*args, **kwargs)
          finally:
              # Reset the context.
              context._reset_jit_compiler_flags()
              context._reset_context()
              ops.enable_eager_execution_internal()
              assert context._context is not None
  
      return wrapper
  
file_path: tensorflow-upstream/tensorflow/python/framework/config_vgpu_test.py
imports: from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: reset_eager(fn) and returns: wrapper, fn