code: def test_is_xyz_affable(vars):
      # Whether there exists an xyz affine for this coordmap
      affine = np.diag([2, 4, 5, 6, 1])
      cmap = AffineTransform(vars["d_cs_r4"], vars["r_cs_r4"], affine)
      assert is_xyz_affable(cmap)
      assert not is_xyz_affable(cmap.reordered_range([3, 0, 1, 2]))
      assert not is_xyz_affable(cmap.reordered_domain([3, 0, 1, 2]))
      # Can pass in own validator
      my_valtor = {"blind": "x", "leading": "y", "ditch": "z"}
      r_cs = CS(("blind", "leading", "ditch"), "fall")
      affine = from_matvec(np.arange(9).reshape((3, 3)), [11, 12, 13])
      cmap = AffineTransform(vars["d_cs_r3"], r_cs, affine)
      # No xyz affine if we don't use our custom dictionary
      assert not is_xyz_affable(cmap)
      # Is if we do
      assert is_xyz_affable(cmap, my_valtor)
  
file_path: nipy/nipy/core/reference/tests/test_spaces.py
imports: import numpy
  import pytest
  from nibabel.affines import from_matvec
  from numpy.testing import assert_array_equal
  from ...image.image import Image
  from ..coordinate_map import AffineTransform, CoordinateMap
  from ..coordinate_system import CoordinateSystem
  from ..coordinate_system import CoordSysMakerError
  from ..spaces import AffineError, AxesError, SpaceError, SpaceTypeError, XYZSpace, get_world_cs, is_xyz_affable, is_xyz_space, known_space, known_spaces, mni_csm, mni_space, vox2aligned, vox2mni, vox2scanner, vox2talairach, vox2unknown, xyz_affine, xyz_order
label_desc: Use image node_id 10 for calling a global function with example usage: test_is_xyz_affable(vars) without return types