code: def _test_apply_metatensor_impl(
      self,
      tensor,
      pending_transforms,
      expected_shape,
      pending_as_parameter,
  ):
      tensor_ = convert_to_tensor(tensor, track_meta=True)
      if pending_as_parameter:
          result, transforms = apply_pending(
              tensor_, pending_transforms
          )
      else:
          for p in pending_transforms:
              tensor_.push_pending_operation(p)
              if not isinstance(p, dict):
                  return
          result, transforms = apply_pending(tensor_)
      self.assertEqual(result.shape, expected_shape)
  
file_path: MONAI/tests/test_apply.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from monai.transforms.lazy.functional import apply_pending
  from monai.transforms.utils import create_rotate
  from monai.utils import LazyAttr, convert_to_tensor
  from tests.utils import get_arange_img
label_desc: Use image node_id 2 for calling the TestApply obj's underlying member method code with example usage: obj._test_apply_metatensor_impl(tensor, pending_transforms, expected_shape, pending_as_parameter) without return types