docstr: Helper function for testing RaggedTensor.__getitem__ exceptions.
docstr_tok: ["Helper","function","for","testing","RaggedTensor.__getitem__","exceptions","."]
code: def _TestGetItemException(self, rt, slice_spec, expected, message):
      """Helper function for testing RaggedTensor.__getitem__ exceptions."""
      tensor_slice_spec = _make_tensor_slice_spec(slice_spec, True)
      with self.assertRaisesRegex(expected, message):
          self.evaluate(rt.__getitem__(slice_spec))
      with self.assertRaisesRegex(expected, message):
          self.evaluate(rt.__getitem__(tensor_slice_spec))
  
imports: import re
  from absl.testing import parameterized
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import tensor_getitem_override
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the RaggedGetItemTest obj's underlying member method code with example usage: obj._TestGetItemException(rt, slice_spec, expected, message) without return types