code: def _AddTest(test_class, op_name, testcase_name, fn):
      test_name = "_".join(["test", op_name, testcase_name])
      if hasattr(test_class, test_name):
          raise RuntimeError(
              "Test %s defined more than once" % test_name
          )
      setattr(test_class, test_name, fn)
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import linalg_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: _AddTest(test_class, op_name, testcase_name, fn) without return types