code: def test_ornt_transform():
      assert_array_equal(
          ornt_transform(
              [[0, 1], [1, 1], [2, -1]],
              [[1, 1], [0, 1], [2, 1]],
          ),
          [[1, 1], [0, 1], [2, -1]],
      )
      assert_array_equal(
          ornt_transform(
              [[0, 1], [1, 1], [2, 1]],
              [[2, 1], [0, -1], [1, 1]],
          ),
          [[1, -1], [2, 1], [0, 1]],
      )
      # Must have same shape
      with pytest.raises(ValueError):
          ornt_transform([[0, 1], [1, 1]], [[0, 1], [1, 1], [2, 1]])
  
      # Must be (N,2) in shape
      with pytest.raises(ValueError):
          ornt_transform(
              [[0, 1, 1], [1, 1, 1]],
              [[0, 1, 1], [1, 1, 1]],
          )
  
      # Target axes must exist in source
      with pytest.raises(ValueError):
          ornt_transform(
              [[0, 1], [1, 1], [1, 1]],
              [[0, 1], [1, 1], [2, 1]],
          )
  
file_path: nibabel/nibabel/tests/test_orientations.py
imports: import warnings
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ..affines import from_matvec, to_matvec
  from ..orientations import OrientationError, aff2axcodes, apply_orientation, axcodes2ornt, flip_axis, inv_ornt_aff, io_orientation, ornt2axcodes, ornt_transform
  from ..testing import expires
label_desc: Use image node_id 4 for calling a global function with example usage: test_ornt_transform() without return types