code: def _add_test(
      test, op_name, testcase_name, fn
  ):  # pylint: disable=redefined-outer-name
      if fn is None:
          return
      test_name = "_".join(["test", op_name, testcase_name])
      if hasattr(test, test_name):
          raise RuntimeError(
              "Test %s defined more than once" % test_name
          )
      setattr(test, test_name, fn)
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_sparse_mat_mul_grad_test.py
imports: import itertools
  import numpy
  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 gradient_checker
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_grad
  from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 2 for calling a global function with example usage: _add_test(test, op_name, testcase_name, fn) without return types