code: def testNumSegments(self):
      segment_ids = [0, 0, 0, 2, 2, 3, 4, 4, 4]
      num_segments = 7
      expected = [0, 3, 3, 5, 6, 9, 9, 9]
      splits = segment_id_ops.segment_ids_to_row_splits(
          segment_ids, num_segments
      )
      self.assertAllEqual(splits, expected)
  
file_path: tensorflow-upstream/tensorflow/python/ops/ragged/ragged_segment_ids_to_row_splits_op_test.py
imports: from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops.ragged import segment_id_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 4 for calling the RaggedSplitsToSegmentIdsOpTest obj's underlying member method code with example usage: obj.testNumSegments() without return types