code: def test_product():
      affine1 = AffineTransform.from_params("i", "x", np.diag([2, 1]))
      affine2 = AffineTransform.from_params("j", "y", np.diag([3, 1]))
      affine = product(affine1, affine2)
      cm1 = CoordinateMap(
          CoordinateSystem("i"), CoordinateSystem("x"), np.log
      )
      cm2 = CoordinateMap(
          CoordinateSystem("j"), CoordinateSystem("y"), np.log
      )
      cm = product(cm1, cm2)
      assert affine.function_domain.coord_names == ("i", "j")
      assert affine.function_range.coord_names == ("x", "y")
      assert_almost_equal(cm([3, 4]), np.log([3, 4]))
      assert_almost_equal(
          cm.function([[3, 4], [5, 6]]), np.log([[3, 4], [5, 6]])
      )
      assert affine.function_domain.coord_names == ("i", "j")
      assert affine.function_range.coord_names == ("x", "y")
      assert_array_equal(affine.affine, np.diag([2, 3, 1]))
      # Test name argument
      for m1, m2 in ((affine1, affine2), (cm1, cm2), (affine1, cm2)):
          cm = product(m1, m2)
          assert cm.function_domain.name == "product"
          assert cm.function_range.name == "product"
          cm = product(m1, m2, input_name="name0")
          assert cm.function_domain.name == "name0"
          assert cm.function_range.name == "product"
          cm = product(m1, m2, output_name="name1")
          assert cm.function_domain.name == "product"
          assert cm.function_range.name == "name1"
          pytest.raises(TypeError, product, m1, m2, whatgains="name0")
  
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 28 for calling a global function with example usage: test_product() without return types