code: def make_cholesky_factored_marginal_fn(cholesky_fn):
      """Construct a `marginal_fn` for use with `tfd.StudentTProcess`.
  
      The returned function computes the Cholesky factorization of the input
      covariance plus a diagonal jitter, and uses that for the `scale` of a
      `tfd.MultivariateStudentTLinearOperator`.
  
      Args:
        cholesky_fn: Callable which takes a single (batch) matrix argument and
          returns a Cholesky-like lower triangular factor.
  
      Returns:
        marginal_fn: A Python function that takes a location, covariance matrix,
          optional `validate_args`, `allow_nan_stats` and `name` arguments, and
          returns a `tfd.MultivariateStudentTLinearOperator`.
      """
  
      def marginal_fn(
          df,
          loc,
          covariance,
          validate_args=False,
          allow_nan_stats=False,
          name="marginal_distribution",
      ):
          squared_scale = ((df - 2.0) / df)[
              ..., tf.newaxis, tf.newaxis
          ] * covariance
          scale = tf.linalg.LinearOperatorLowerTriangular(
              cholesky_fn(squared_scale),
              is_non_singular=True,
              name="StudentTProcessScaleLinearOperator",
          )
          return (
              multivariate_student_t.MultivariateStudentTLinearOperator(
                  df=df,
                  loc=loc,
                  scale=scale,
                  validate_args=validate_args,
                  allow_nan_stats=allow_nan_stats,
                  name=name,
              )
          )
  
      return marginal_fn
  
imports: import functools
  import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  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 multivariate_student_t
  from tensorflow_probability.python.distributions.internal import stochastic_process_util
  from tensorflow_probability.python.internal import assert_util
  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.math import linalg
  from tensorflow_probability.python.math import special
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling a global function with example usage: make_cholesky_factored_marginal_fn(cholesky_fn) and returns: marginal_fn, multivariate_student_t