code: def test_cmap_coord_types():
      # Check that we can use full range of coordinate system types.  The inverse
      # of an AffineTransform should generate coordinates in the input coordinate
      # system dtype
      arr_p1 = np.eye(4)
      arr_p1[:3, 3] = 1
      for dt in _SYMPY_SAFE_DTYPES:
          in_cs = CoordinateSystem("ijk", coord_dtype=dt)
          out_cs = CoordinateSystem("xyz", coord_dtype=dt)
          # CoordinateMap
          cmap = CoordinateMap(in_cs, out_cs, lambda x: x + 1)
          assert cmap == copy(cmap)
          res = cmap(np.array([0, 1, 2], dtype=dt))
          assert_array_equal(res, [1, 2, 3])
          assert res.dtype == in_cs.coord_dtype
          # Check reordering works
          rcmap = cmap.reordered_domain("ikj").reordered_range("yxz")
          res = rcmap(np.array([0, 1, 2], dtype=dt))
          assert_array_equal(res, [3, 1, 2])
          assert res.dtype == in_cs.coord_dtype
          # AffineTransform
          cmap = AffineTransform(in_cs, out_cs, arr_p1.astype(dt))
          res = cmap(np.array([0, 1, 2], dtype=dt))
          assert_array_equal(res, [1, 2, 3])
          assert res.dtype == in_cs.coord_dtype
          assert cmap == copy(cmap)
          # Check reordering works
          rcmap = cmap.reordered_domain("ikj").reordered_range("yxz")
          res = rcmap(np.array([0, 1, 2], dtype=dt))
          assert_array_equal(res, [3, 1, 2])
          assert res.dtype == in_cs.coord_dtype
  
imports: from copy import copy
  from types import SimpleNamespace
  import numpy
  from ..coordinate_map import AffineTransform, AxisError, CoordinateMap, CoordMapMaker, CoordMapMakerError, _as_coordinate_map, _fix0, append_io_dim, axmap, compose, drop_io_dim, equivalent, input_axis_index, io_axis_indices, orth_axes, product, shifted_domain_origin, shifted_range_origin
  from ..coordinate_system import CoordinateSystem, CoordinateSystemError, CoordSysMaker
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_equal
label_desc: Use image node_id 42 for calling a global function with example usage: test_cmap_coord_types() without return types