code: def test_composed_affines():
      aff1 = np.diag([2, 3, 4, 1])
      aff2 = np.eye(4)
      aff2[:3, 3] = (10, 11, 12)
      comped = np.dot(aff2, aff1)
      comped_obj = Affine(comped)
      assert_array_almost_equal(comped_obj.as_affine(), comped)
      aff1_obj = Affine(aff1)
      aff2_obj = Affine(aff2)
      re_comped = aff2_obj.compose(aff1_obj)
      assert_array_almost_equal(re_comped.as_affine(), comped)
      # Crazy, crazy, crazy
      aff1_remixed = aff1_obj.as_affine()
      aff2_remixed = aff2_obj.as_affine()
      comped_remixed = np.dot(aff2_remixed, aff1_remixed)
      assert_array_almost_equal(
          comped_remixed, Affine(comped_remixed).as_affine()
      )
  
file_path: nipy/nipy/algorithms/registration/tests/test_affine.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ....testing import assert_almost_equal
  from ..affine import Affine, Affine2D, Rigid, Rigid2D, Similarity, Similarity2D, rotation_mat2vec, slices2aff, subgrid_affine
label_desc: Use image node_id 4 for calling a global function with example usage: test_composed_affines() without return types