code: def _testUnaryOp(self, math_fun, np_fun, name, weak_result):
      def run_test(a):
          for fn in self.array_transforms:
              arg1 = fn(a)
              if weak_result and flexible_dtypes.result_type(arg1)[1]:
                  self.assertIsInstance(
                      math_fun(arg1), weak_tensor.WeakTensor
                  )
              else:
                  self.assertIsInstance(
                      math_fun(arg1), np_arrays.ndarray
                  )
              self.match(
                  math_fun(arg1),
                  np_fun(arg1),
                  msg="{}({})".format(name, arg1),
              )
  
      run_test(5)
      run_test([2, 3])
      run_test([[2, -3], [-6, 7]])
  
imports: import itertools
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import flexible_dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework import weak_tensor
  from tensorflow.python.ops import weak_tensor_ops
  from tensorflow.python.ops import weak_tensor_test_util
  from tensorflow.python.ops.numpy_ops import np_array_ops
  from tensorflow.python.ops.numpy_ops import np_arrays
  from tensorflow.python.ops.numpy_ops import np_math_ops
  from tensorflow.python.ops.numpy_ops import np_random
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the MathTest obj's underlying member method code with example usage: obj._testUnaryOp(math_fun, np_fun, name, weak_result) without return types