code: def is_empty_observation_data(
      feature_ndims, observation_index_points, observations
  ):
      """Returns `True` if given observation data is empty.
  
      "Empty" means either
        1. Both `observation_index_points` and `observations` are `None`, or
        2. the "number of observations" shape is 0. The shape of
        `observation_index_points` (or each of its components, if nested) is
        `[..., N, f1, ..., fF]`, where `N` is the number of observations and the
        `f`s are feature dims. Thus, we look at the shape element just to the
        left of the leftmost feature dim. If that shape is zero, we consider the
        data empty.
  
      We don't check the shape of observations; validations are checked elsewhere in
      the calling code, to ensure these shapes are consistent.
  
      Args:
        feature_ndims: the number of feature dims, as reported by the GP kernel.
        observation_index_points: the observation data locations in the index set.
        observations: the observation data.
  
      Returns:
        is_empty: True if the data were deemed to be empty.
      """
      # If both input locations and observations are `None`, we consider this
      # "empty" observation data.
      if observation_index_points is None and observations is None:
          return True
      num_obs = tf.nest.map_structure(
          lambda t, nd: tf.compat.dimension_value(t.shape[-(nd + 1)]),
          observation_index_points,
          feature_ndims,
      )
      if all(
          n is not None and n == 0 for n in tf.nest.flatten(num_obs)
      ):
          return True
      return False
  
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 1 for calling a global function with example usage: is_empty_observation_data(feature_ndims, observation_index_points, observations) and returns: False, True, True