code: def get_loc_and_kernel_matrix(
      kernel,
      index_points,
      observation_noise_variance,
      mean_fn,
      is_missing=None,
      mask_loc=True,
  ):
      """Compute location and kernel matrix from inputs, possibly masking them."""
      if is_missing is not None:
          # Mask the index_points to avoid NaN gradients. NOTE: We are assuming the
          # 0. vector is a valid sample. TODO(b/276969724): Mask out missing index
          # points to something in the support of the kernel.
          pad_shapes = lambda nd: psd_kernels_util.pad_shape_with_ones(  # pylint:disable=g-long-lambda
              is_missing, nd, start=-1
          )
          mask_is_missing = tf.nest.map_structure(
              pad_shapes, kernel.feature_ndims
          )
  
          mask = lambda m, x: tf.where(
              m, dtype_util.as_numpy_dtype(x.dtype)(0), x
          )
          index_points = tf.nest.map_structure(
              mask, mask_is_missing, index_points
          )
  
      kernel_matrix = compute_kernel_matrix(
          kernel, index_points, observation_noise_variance
      )
  
      loc = mean_fn(index_points)
      if is_missing is not None:
          if mask_loc:
              loc = tf.where(is_missing, 0.0, loc)
          kernel_matrix = psd_kernels_util.mask_matrix(
              kernel_matrix, is_missing
          )
      return loc, kernel_matrix
  
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 11 for calling a global function with example usage: get_loc_and_kernel_matrix(kernel, index_points, observation_noise_variance, mean_fn, is_missing, mask_loc) and returns: loc,  kernel_matrix