code: def test_convert_ragged_indices(self):
      exception_cls = tf.errors.InvalidArgumentError
      error_string = "Condition x == y did not hold element-wise:"
      ragged = tf.RaggedTensor.from_row_splits(
          values=tf.RaggedTensor.from_row_splits(
              values=np.array([1.2, 1.0, 1.2, 1.0]),
              row_splits=np.array([0, 2, 4]),
          ),
          row_splits=np.array([0, 1, 2]),
      )
      dense = tf.constant(["a", "b"])
      dense_result = tf.constant(["a", "a", "b", "b"])
      x, key = tf_utils._validate_and_get_dense_value_key_inputs(
          ragged, ragged
      )
      self.assertAllEqual(self.evaluate(x), ragged.flat_values)
      self.assertAllEqual(self.evaluate(key), ragged.flat_values)
  
      x, key = tf_utils._validate_and_get_dense_value_key_inputs(
          ragged, dense
      )
      self.assertAllEqual(self.evaluate(x), ragged.flat_values)
      self.assertAllEqual(self.evaluate(key), dense_result)
  
      with tf.compat.v1.Graph().as_default():
          ragged1 = tf.compat.v1.ragged.placeholder(tf.float32, 2)
          ragged2 = tf.compat.v1.ragged.placeholder(tf.float32, 2)
          ragged_value1 = tf.compat.v1.ragged.RaggedTensorValue(
              values=tf.compat.v1.ragged.RaggedTensorValue(
                  values=np.array([1.2, 1.0, 1.2, 1.0]),
                  row_splits=np.array([0, 2, 4]),
              ),
              row_splits=np.array([0, 2]),
          )
          ragged_value2 = tf.compat.v1.ragged.RaggedTensorValue(
              values=tf.compat.v1.ragged.RaggedTensorValue(
                  values=np.array([1.2, 1.0, 1.2, 1.0]),
                  row_splits=np.array([0, 3, 4]),
              ),
              row_splits=np.array([0, 2]),
          )
  
          with tf.compat.v1.Session() as sess:
              with self.assertRaisesRegex(exception_cls, error_string):
                  sess.run(
                      tf_utils._validate_and_get_dense_value_key_inputs(
                          ragged1, ragged2
                      ),
                      feed_dict={
                          ragged1: ragged_value1,
                          ragged2: ragged_value2,
                      },
                  )
  
imports: import os
  import numpy
  from packaging import version
  import tensorflow
  from tensorflow_transform import analyzers
  from tensorflow_transform import annotators
  from tensorflow_transform import tf_utils
  from tensorflow_transform import test_case
  from tensorflow.python.framework import composite_tensor
label_desc: Use image node_id 27 for calling the TFUtilsTest obj's underlying member method code with example usage: obj.test_convert_ragged_indices() without return types