code: def event_shape_tensor(kernel, index_points):
      """Get shape of number of index poins."""
      # The examples index is one position to the left of the feature dims.
      example_shape = tf.nest.map_structure(
          lambda t, nd: ps.shape(t)[
              ps.rank(t) - (nd + 1) : ps.rank(t) - nd
          ],
          index_points,
          kernel.feature_ndims,
      )
      return functools.reduce(
          ps.broadcast_shape, tf.nest.flatten(example_shape), []
      )
  
file_path: probability/tensorflow_probability/python/distributions/internal/stochastic_process_util.py
imports: import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.psd_kernels.internal import util
  from tensorflow.python.util import nest
label_desc: Use image node_id 5 for calling a global function with example usage: event_shape_tensor(kernel, index_points) and returns: functools