code: def test_cut_axes_exception(affine_eye):
      """Tests for exceptions raised by class ``CutAxes``."""
      from nilearn.plotting.displays import CutAxes
  
      axes = CutAxes(None, "foo", 2)
      assert axes.direction == "foo"
      assert axes.coord == 2
      with pytest.raises(
          ValueError, match="Invalid value for direction"
      ):
          axes.transform_to_2d(None, affine_eye)
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from nilearn.datasets import load_mni152_template
  from nilearn.plotting.displays import BaseAxes, LProjector, LRProjector, LYRProjector, LYRZProjector, LZRProjector, LZRYProjector, MosaicSlicer, OrthoProjector, OrthoSlicer, RProjector, TiledSlicer, XProjector, XSlicer, XZProjector, XZSlicer, YProjector, YSlicer, YXProjector, YXSlicer, YZProjector, YZSlicer, ZProjector, ZSlicer
label_desc: Use image node_id 2 for calling a global function with example usage: test_cut_axes_exception(affine_eye) without return types