code: def product(*elements):
      """
      Compute the group product of a set of elements
      """
      type_e0 = type(elements[0])
      notsame = [e for e in elements if type(e) != type_e0]
      if notsame:
          raise ValueError(
              "all elements should be members of the same group"
          )
      composed_mapping = compose(*elements)
      matrix = composed_mapping.affine[:-1, :-1]
      return elements[0].__class__(matrix, elements[0].coords)
  
imports: import numpy
  from nipy.core.api import AffineTransform, CoordinateSystem
  from nipy.core.reference.coordinate_map import compose
  from nipy.core.reference.coordinate_map import product
label_desc: Use image node_id 1 for calling a global function with example usage: product() and returns: elements