code: def gaussian_update(
      model: GP,
      sample_values: Tensor,
      likelihood: Optional[Likelihood] = DEFAULT,
      **kwargs: Any,
  ) -> GeneralizedLinearPath:
      r"""Computes a Gaussian pathwise update in exact arithmetic:
  
      .. code-block:: text
  
          (f | y)(·) = f(·) + Cov(f(·), y) Cov(y, y)^{-1} (y - f(X) - ε),
                              \_______________________________________/
                                                  V
                                      "Gaussian pathwise update"
  
      where `=` denotes equality in distribution, :math:`f \sim GP(0, k)`,
      :math:`y \sim N(f(X), \Sigma)`, and :math:`\epsilon \sim N(0, \Sigma)`.
      For more information, see [wilson2020sampling]_ and [wilson2021pathwise]_.
  
      Args:
          model: A Gaussian process prior together with a likelihood.
          sample_values: Assumed values for :math:`f(X)`.
          likelihood: An optional likelihood used to help define the desired
              update. Defaults to `model.likelihood` if it exists else None.
      """
      if likelihood is DEFAULT:
          likelihood = getattr(model, "likelihood", None)
  
      return GaussianUpdate(
          model, likelihood, sample_values=sample_values, **kwargs
      )
  
imports: from __future__ import annotations
  from typing import Any, Callable, Optional, Union
  import torch
  from botorch.models.approximate_gp import ApproximateGPyTorchModel
  from botorch.models.transforms.input import InputTransform
  from botorch.sampling.pathwise.features import KernelEvaluationMap
  from botorch.sampling.pathwise.paths import GeneralizedLinearPath, SamplePath
  from botorch.sampling.pathwise.utils import get_input_transform, get_train_inputs, get_train_targets, TInputTransform
  from botorch.utils.dispatcher import Dispatcher
  from botorch.utils.types import DEFAULT, NoneType
  from gpytorch.kernels.kernel import Kernel
  from gpytorch.likelihoods import _GaussianLikelihoodBase, Likelihood
  from gpytorch.models import ApproximateGP, ExactGP, GP
  from gpytorch.variational import VariationalStrategy
  from linear_operator.operators import LinearOperator, SumLinearOperator, ZeroLinearOperator
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: gaussian_update(model, sample_values, likelihood) and returns: GaussianUpdate