code: def test_get_index_from_direction_exception():
      """Tests that a ValueError is raised when an invalid direction
      is given to function ``_get_index_from_direction``.
      """
      from nilearn.plotting.displays._axes import (
          _get_index_from_direction,
      )
  
      with pytest.raises(
          ValueError, match="foo is not a valid direction."
      ):
          _get_index_from_direction("foo")
  
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 4 for calling a global function with example usage: test_get_index_from_direction_exception() without return types