code: def test_sample_mvn_shapes(
      leading_dims: Tuple[int, ...],
      n: int,
      d: int,
      num_samples: Optional[int],
      full_cov: bool,
  ) -> None:
      mean_shape = leading_dims + (n, d)
      means = tf.zeros(mean_shape, dtype=default_float())
  
      if full_cov:
          covariance_shape = leading_dims + (n, d, d)
          sqrt_cov = tf.random.normal(
              covariance_shape, dtype=default_float()
          )
          covariances = tf.matmul(sqrt_cov, sqrt_cov, transpose_b=True)
      else:
          covariance_shape = leading_dims + (n, d)
          covariances = tf.random.normal(
              covariance_shape, dtype=default_float()
          )
  
      samples = sample_mvn(means, covariances, full_cov, num_samples)
  
      if num_samples:
          expected_shape = leading_dims + (num_samples, n, d)
      else:
          expected_shape = leading_dims + (n, d)
  
      assert_equal(samples.shape, expected_shape)
  
file_path: GPflow/tests/gpflow/conditionals/test_util.py
imports: from typing import Optional, Tuple
  import numpy
  import pytest
  import tensorflow
  from _pytest.logging import LogCaptureFixture
  from numpy.testing import assert_allclose, assert_equal
  from gpflow import default_float
  from gpflow.conditionals.util import rollaxis_left, rollaxis_right, sample_mvn
  from gpflow.utilities.ops import leading_transpose
label_desc: Use image node_id 6 for calling a global function with example usage: test_sample_mvn_shapes(leading_dims, n, d, num_samples, full_cov) without return types