code: def test_calling_shapes():
      cs2d = CS("ij")
      cs1d = CS("i")
      cm2d = CoordinateMap(cs2d, cs2d, lambda x: x + 1)
      cm1d2d = CoordinateMap(
          cs1d, cs2d, lambda x: np.concatenate((x, x), axis=-1)
      )
      at2d = AffineTransform(
          cs2d, cs2d, np.array([[1, 0, 1], [0, 1, 1], [0, 0, 1]])
      )
      at1d2d = AffineTransform(
          cs1d, cs2d, np.array([[1, 0], [0, 1], [0, 1]])
      )
      # test coordinate maps and affine transforms
      for xfm2d, xfm1d2d in ((cm2d, cm1d2d), (at2d, at1d2d)):
          arr = np.array([0, 1])
          assert_array_equal(xfm2d(arr), [1, 2])
          # test lists work too
          res = xfm2d([0, 1])
          assert_array_equal(res, [1, 2])
          # and return arrays (by checking shape attribute)
          assert res.shape == (2,)
          # maintaining input shape
          arr_long = arr[None, None, :]
          assert_array_equal(xfm2d(arr_long), arr_long + 1)
          # wrong shape array raises error
          pytest.raises(CoordinateSystemError, xfm2d, np.zeros((3,)))
          pytest.raises(CoordinateSystemError, xfm2d, np.zeros((3, 3)))
          # 1d to 2d
          arr = np.array(1)
          assert_array_equal(xfm1d2d(arr), [1, 1])
          arr_long = arr[None, None, None]
          assert_array_equal(xfm1d2d(arr_long), np.ones((1, 1, 2)))
          # wrong shape array raises error.  Note 1d input requires size 1
          # as final axis
          pytest.raises(CoordinateSystemError, xfm1d2d, np.zeros((3,)))
          pytest.raises(
              CoordinateSystemError, xfm1d2d, np.zeros((3, 2))
          )
  
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 4 for calling a global function with example usage: test_calling_shapes() without return types