code: def testRaggedBatchGatherUnknownRankError(self):
      if context.executing_eagerly():
          return
      params = [["a", "b"], ["c", "d"]]
      indices = array_ops.placeholder(dtypes.int32, shape=None)
      ragged_indices = ragged_tensor.RaggedTensor.from_row_splits(
          indices, [0, 2, 4]
      )
  
      with self.assertRaisesRegex(
          ValueError,
          r"batch_dims=-1 may only be negative "
          r"if rank\(indices\) is statically known.",
      ):
          ragged_batch_gather_ops.batch_gather(params, indices)
  
      with self.assertRaisesRegex(
          ValueError,
          r"batch_dims=-1 may only be negative "
          r"if rank\(indices\) is statically known.",
      ):
          ragged_batch_gather_ops.batch_gather(params, ragged_indices)
  
imports: 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.ragged import ragged_batch_gather_ops
  from tensorflow.python.ops.ragged import ragged_batch_gather_with_default_op
  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 6 for calling the RaggedBatchGatherOpTest obj's underlying member method code with example usage: obj.testRaggedBatchGatherUnknownRankError() without return types