code: def testErrors(
      self,
      indices,
      depth,
      on_value=None,
      off_value=None,
      axis=None,
      dtype=None,
      exception=ValueError,
      message=None,
      ragged_rank=None,
  ):
      ragged_indices = ragged_factory_ops.constant(
          indices, ragged_rank=ragged_rank
      )
      with self.assertRaisesRegex(exception, message):
          array_ops.one_hot(
              ragged_indices,
              depth,
              on_value=on_value,
              off_value=off_value,
              axis=axis,
              dtype=dtype,
          )
  
file_path: tensorflow/tensorflow/python/ops/ragged/ragged_one_hot_op_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.ragged import ragged_array_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the RaggedOneHotTest obj's underlying member method code with example usage: obj.testErrors(indices, depth, on_value, off_value, axis, dtype, exception, message, ragged_rank) without return types