code: def test_synchronized_order():
      data = np.random.standard_normal((3, 4, 7, 5))
      im = Image(
          data,
          AffineTransform.from_params(
              "ijkl", "xyzt", np.diag([1, 2, 3, 4, 1])
          ),
      )
      im_scrambled = im.reordered_axes("iljk").reordered_reference(
          "xtyz"
      )
      im_unscrambled = image.synchronized_order(im_scrambled, im)
      assert im_unscrambled.coordmap == im.coordmap
      assert_almost_equal(im_unscrambled.get_fdata(), im.get_fdata())
      assert im_unscrambled == im
      assert im_unscrambled == im
      assert im_unscrambled == im
      # the images don't have to be the same shape
      data2 = np.random.standard_normal((3, 11, 9, 4))
      im2 = Image(
          data2,
          AffineTransform.from_params(
              "ijkl", "xyzt", np.diag([1, 2, 3, 4, 1])
          ),
      )
      im_scrambled2 = im2.reordered_axes("iljk").reordered_reference(
          "xtyz"
      )
      im_unscrambled2 = image.synchronized_order(im_scrambled2, im)
      assert im_unscrambled2.coordmap == im.coordmap
      # or the same coordmap
      data3 = np.random.standard_normal((3, 11, 9, 4))
      im3 = Image(
          data3,
          AffineTransform.from_params(
              "ijkl", "xyzt", np.diag([1, 9, 3, -2, 1])
          ),
      )
      im_scrambled3 = im3.reordered_axes("iljk").reordered_reference(
          "xtyz"
      )
      im_unscrambled3 = image.synchronized_order(im_scrambled3, im)
      assert im_unscrambled3.axes == im.axes
      assert im_unscrambled3.reference == im.reference
  
imports: import warnings
  from itertools import chain
  import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from ...api import data_generator, parcels, write_data
  from ...reference.coordinate_map import AffineTransform, AxisError
  from ...reference.coordinate_system import CoordinateSystem
  from ..None import image
  from ..image import Image, is_image, iter_axis, rollimg
label_desc: Use image node_id 18 for calling a global function with example usage: test_synchronized_order() without return types