code: def test_switched_likelihood_variational_expectations(
      X_list: Sequence[TensorType],
      Y_list: Sequence[TensorType],
      F_list: Sequence[TensorType],
      Fvar_list: Sequence[TensorType],
      Y_label: Sequence[TensorType],
  ) -> None:
      Y_perm = list(range(3 + 4 + 5))
      np.random.shuffle(Y_perm)
      # shuffle the original data
      X_sw = np.concatenate(X_list)[Y_perm, :]
      Y_sw = np.hstack(
          [np.concatenate(Y_list), np.concatenate(Y_label)]
      )[Y_perm, :3]
      F_sw = np.concatenate(F_list)[Y_perm, :]
      Fvar_sw = np.concatenate(Fvar_list)[Y_perm, :]
  
      likelihoods = [Gaussian()] * 3
      for lik in likelihoods:
          lik.variance = Parameter(
              np.exp(np.random.randn()), dtype=np.float32
          )
      switched_likelihood = SwitchedLikelihood(likelihoods)
  
      switched_results = switched_likelihood.variational_expectations(
          X_sw, F_sw, Fvar_sw, Y_sw
      )
      results = [
          lik.variational_expectations(x, f, fvar, y)
          for lik, x, y, f, fvar in zip(
              likelihoods, X_list, Y_list, F_list, Fvar_list
          )
      ]
      assert_allclose(switched_results, np.concatenate(results)[Y_perm])
  
file_path: GPflow/tests/gpflow/likelihoods/test_switched_likelihood.py
imports: from typing import Sequence
  import numpy
  import pytest
  import tensorflow
  from numpy.testing import assert_allclose
  import gpflow
  from gpflow.base import AnyNDArray, Parameter, TensorType
  from gpflow.inducing_variables import InducingPoints
  from gpflow.likelihoods import Gaussian, StudentT, SwitchedLikelihood
label_desc: Use image node_id 3 for calling a global function with example usage: test_switched_likelihood_variational_expectations(X_list, Y_list, F_list, Fvar_list, Y_label) without return types