code: def testError(
      self,
      descr,
      mode,
      data,
      repeats,
      axis,
      exception=ValueError,
      error=None,
  ):
      # Make sure that this is also an error case for numpy.
      with self.assertRaises(exception):
          np.repeat(data, repeats, axis)
  
      if mode == "constant":
          data = constant_op.constant(data)
          repeats = constant_op.constant(repeats)
      elif mode == "dynamic":
          data = constant_op.constant(data)
          repeats = constant_op.constant(repeats)
          data = array_ops.placeholder_with_default(data, data.shape)
          repeats = array_ops.placeholder_with_default(
              repeats, repeats.shape
          )
      elif mode == "unknown_shape":
          data = array_ops.placeholder_with_default(data, None)
          repeats = array_ops.placeholder_with_default(repeats, None)
  
      with self.assertRaisesRegex(exception, error):
          ragged_util.repeat(data, repeats, axis)
  
file_path: tensorflow-upstream/tensorflow/python/ops/ragged/ragged_util_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework.errors import InvalidArgumentError
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.ragged import ragged_util
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 3 for calling the RaggedUtilTest obj's underlying member method code with example usage: obj.testError(descr, mode, data, repeats, axis, exception, error) without return types