code: def _segmented_range(limits):
      """Equivalent to `tf.ragged.range(limits).flat_values`.
  
      Ragged Tensors are are not supported by numpy.
  
      Args:
        limits: Integer `Tensor` of sizes of each range.
  
      Returns:
        segments: 1D `Tensor` of segment ranges.
      """
      # To cope with [0]-shaped limits, which disagrees with the sensibilities of
      # tf.repeat, we left-pad, then slice the output.
      limits = tf.pad(limits, [[1, 0]], constant_values=0)
      return tf.range(tf.reduce_sum(limits)) - tf.repeat(
          tf.concat([[0], tf.cumsum(limits[:-1])], axis=0), limits
      )
  
imports: import sys
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import special
label_desc: Use image node_id 4 for calling a global function with example usage: _segmented_range(limits) and returns: unknown