code: def test_comap_cosys():
      # Check we can pass in coordinate names instead of coordinate systems
      d_sys = CoordinateSystem("ijk")
      r_sys = CoordinateSystem("xyz")
      fn = lambda x: x + 1
      cm = CoordinateMap(d_sys, r_sys, fn)
      assert CoordinateMap("ijk", "xyz", fn) == cm
      assert CoordinateMap(d_sys, "xyz", fn) == cm
      assert CoordinateMap("ijk", r_sys, fn) == cm
      aff = np.diag([2, 3, 4, 1])
      cm = AffineTransform(d_sys, r_sys, aff)
      assert AffineTransform("ijk", "xyz", aff) == cm
      assert AffineTransform(d_sys, "xyz", aff) == cm
      assert AffineTransform("ijk", r_sys, aff) == cm
  
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 15 for calling a global function with example usage: test_comap_cosys() without return types