code: def event_shape(kernel, index_points):
      """Get shape of number of index poins."""
      check_nested_index_points(kernel, index_points)
      # The examples index is one position to the left of the feature dims.
      example_shape = tf.nest.map_structure(
          lambda t, nd: tf.TensorShape(t.shape[-(nd + 1)]),
          index_points,
          kernel.feature_ndims,
      )
      flat_shapes = nest.flatten_up_to(
          kernel.feature_ndims, example_shape
      )
  
      if None in [tensorshape_util.rank(s) for s in flat_shapes]:
          return tf.TensorShape([None])
      return functools.reduce(
          tf.broadcast_static_shape, flat_shapes, tf.TensorShape([])
      )
  
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 6 for calling a global function with example usage: event_shape(kernel, index_points) and returns: functools, tf