code: def _flattened_conditional_mean_fn_helper(
      x,
      kernel,
      observations,
      observation_index_points,
      observations_is_missing,
      observation_scale,
      mean_fn,
      solve_on_observations=None,
  ):
      """Flattened Conditional mean helper."""
      observations = tf.convert_to_tensor(observations)
      if observation_index_points is not None:
          observation_index_points = nest_util.convert_to_nested_tensor(
              observation_index_points,
              dtype=kernel.dtype,
              allow_packing=True,
          )
  
      k_x_obs_linop = kernel.matrix_over_all_tasks(
          x, observation_index_points
      )
      if solve_on_observations is None:
          vec_diff = _vec(
              observations - mean_fn(observation_index_points)
          )
  
      if observations_is_missing is not None:
          k_x_obs_linop = tf.linalg.LinearOperatorFullMatrix(
              tf.where(
                  _vec(observations_is_missing)[..., tf.newaxis, :],
                  tf.zeros([], dtype=k_x_obs_linop.dtype),
                  k_x_obs_linop.to_dense(),
              )
          )
          if solve_on_observations is None:
              vec_diff = tf.where(
                  _vec(observations_is_missing),
                  tf.zeros([], dtype=vec_diff.dtype),
                  vec_diff,
              )
      if solve_on_observations is None:
          solve_on_observations = observation_scale.solvevec(
              observation_scale.solvevec(vec_diff), adjoint=True
          )
  
      flattened_mean = k_x_obs_linop.matvec(solve_on_observations)
      return _vec(
          mean_fn(x) + _unvec(flattened_mean, [-1, kernel.num_tasks])
      )
  
imports: import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import cholesky_util
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import mvn_linear_operator
  from tensorflow_probability.python.distributions.internal import stochastic_process_util
  from tensorflow_probability.python.experimental.distributions import multitask_gaussian_process
  from tensorflow_probability.python.experimental.linalg import linear_operator_unitary
  from tensorflow_probability.python.experimental.psd_kernels import multitask_kernel
  from tensorflow_probability.python.internal import batch_shape_lib
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.psd_kernels.internal import util
label_desc: Use image node_id 4 for calling a global function with example usage: _flattened_conditional_mean_fn_helper(x, kernel, observations, observation_index_points, observations_is_missing, observation_scale, mean_fn, solve_on_observations) and returns: _vec