code: def compose(*cmaps):
      """Return the composition of two or more CoordinateMaps.
  
      Parameters
      ----------
      cmaps : sequence of CoordinateMaps
  
      Returns
      -------
      cmap : ``CoordinateMap``
         The resulting CoordinateMap has function_domain ==
         cmaps[-1].function_domain and function_range ==
         cmaps[0].function_range
  
      Examples
      --------
      >>> cmap = AffineTransform.from_params('i', 'x', np.diag([2.,1.]))
      >>> cmapi = cmap.inverse()
      >>> id1 = compose(cmap,cmapi)
      >>> id1.affine
      array([[ 1.,  0.],
             [ 0.,  1.]])
  
      >>> id2 = compose(cmapi,cmap)
      >>> id1.function_domain.coord_names
      ('x',)
      >>> id2.function_domain.coord_names
      ('i',)
      """
      # First check if they're all affine
      allaffine = np.all(
          [isinstance(cmap, AffineTransform) for cmap in cmaps]
      )
      if allaffine:
          return _compose_affines(*cmaps)
      else:
          warnings.warn(
              "composition of non-affine CoordinateMaps is "
              "less robust than the AffineTransform"
          )
          return _compose_cmaps(
              *[_as_coordinate_map(cmap) for cmap in cmaps]
          )
  
imports: import warnings
  import numpy
  import numpy.linalg
  from nibabel import io_orientation
  from nibabel.affines import from_matvec, to_matvec
  from .coordinate_system import CoordinateSystem, is_coordsys, safe_dtype
  from .coordinate_system import product
label_desc: Use image node_id 2 for calling a global function with example usage: compose() and returns: _compose_affines, _compose_cmaps