code: def multitask_event_shape_tensor(kernel, index_points):
      example_shape = tf.nest.map_structure(
          lambda t, nd: ps.shape(t)[-(nd + 1) : -nd],
          index_points,
          kernel.feature_ndims,
      )
      shape = functools.reduce(
          ps.broadcast_shape, tf.nest.flatten(example_shape), []
      )
      return ps.concat([shape, [kernel.num_tasks]], axis=0)
  
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 7 for calling a global function with example usage: multitask_event_shape_tensor(kernel, index_points) and returns: ps