code: def test_leading_transpose_fails() -> None:
      """Check that error is thrown if `perm` is not compatible with `a`"""
      dims = [1, 2, 3, 4]
      a = tf.zeros(dims)
  
      with pytest.raises(ValueError):
          leading_transpose(a, [-1, -2])
  
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 2 for calling a global function with example usage: test_leading_transpose_fails() without return types