code: def make_models(
      M: int = 64,
      D: int = input_dim,
      L: int = 3,
      q_diag: bool = False,
      whiten: bool = True,
      mo: Optional[Tuple[str, str]] = None,
  ) -> Tuple[SVGP_deprecated, SVGP_with_posterior]:
      if mo is None:
          k = gpflow.kernels.Matern52()
          Z = np.random.randn(M, D)
      else:
          kernel_type, iv_type = mo
  
          k_list = [gpflow.kernels.Matern52() for _ in range(L)]
          output_dim = 5
          w = tf.Variable(
              initial_value=np.random.rand(output_dim, L),
              dtype=tf.float64,
              name="w",
          )
          if kernel_type == "LinearCoregionalization":
              k = gpflow.kernels.LinearCoregionalization(k_list, W=w)
          elif kernel_type == "SeparateIndependent":
              k = gpflow.kernels.SeparateIndependent(k_list)
          elif kernel_type == "SharedIndependent":
              k = gpflow.kernels.SharedIndependent(
                  k_list[0], output_dim=L
              )
          else:
              raise NotImplementedError
  
          iv_list = [
              gpflow.inducing_variables.InducingPoints(
                  np.random.randn(M, D)
              )
              for _ in range(L)
          ]
          if iv_type == "SeparateIndependent":
              Z = gpflow.inducing_variables.SeparateIndependentInducingVariables(
                  iv_list
              )
          elif iv_type == "SharedIndependent":
              Z = gpflow.inducing_variables.SharedIndependentInducingVariables(
                  iv_list[0]
              )
          else:
              raise NotImplementedError
  
      lik = gpflow.likelihoods.Gaussian(0.1)
      q_mu = np.random.randn(M, L)
      if q_diag:
          q_sqrt: AnyNDArray = np.random.randn(M, L) ** 2
      else:
          q_sqrt = np.tril(np.random.randn(L, M, M))
      mold = SVGP_deprecated(
          k,
          lik,
          Z,
          q_diag=q_diag,
          q_mu=q_mu,
          q_sqrt=q_sqrt,
          whiten=whiten,
      )
      mnew = SVGP_with_posterior(
          k,
          lik,
          Z,
          q_diag=q_diag,
          q_mu=q_mu,
          q_sqrt=q_sqrt,
          whiten=whiten,
      )
      return mold, mnew
  
file_path: GPflow/tests/gpflow/models/test_svgp_posterior.py
imports: from itertools import product
  from typing import Optional, Tuple
  import numpy
  import pytest
  import tensorflow
  import gpflow
  from gpflow.base import AnyNDArray
  from gpflow.models.svgp import SVGP_deprecated, SVGP_with_posterior
label_desc: Use image node_id 1 for calling a global function with example usage: make_models(M, D, L, q_diag, whiten, mo) and returns: mold,  mnew