code: def test_orntd(
      self,
      init_param,
      img: torch.Tensor,
      affine: torch.Tensor | None,
      expected_shape,
      expected_code,
      device,
  ):
      ornt = Orientationd(**init_param)
      if affine is not None:
          img = MetaTensor(img, affine=affine)
      img = img.to(device)
      call_param = {"data": {k: img.clone() for k in ornt.keys}}
      res = ornt(**call_param)  # type: ignore[arg-type]
      for k in ornt.keys:
          if img.ndim in (3, 4):
              test_resampler_lazy(
                  ornt, res, init_param, call_param, output_key=k
              )
          _im = res[k]
          self.assertIsInstance(_im, MetaTensor)
          np.testing.assert_allclose(_im.shape, expected_shape)
          code = nib.aff2axcodes(_im.affine.cpu(), ornt.ornt_transform.labels)  # type: ignore
          self.assertEqual("".join(code), expected_code)
  
file_path: MONAI/tests/test_orientationd.py
imports: from __future__ import annotations
  import unittest
  import nibabel
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data.meta_obj import set_track_meta
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import Orientationd
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_DEVICES
label_desc: Use image node_id 1 for calling the TestOrientationdCase obj's underlying member method code with example usage: obj.test_orntd(init_param, img, affine, expected_shape, expected_code, device) without return types