code: def test_pending_ops(
      self, input_param, input_shape, _expected_data, align_corners
  ):
      for p in TEST_NDARRAYS_ALL:
          # grid sample only support constant value to be zero
          if (
              "constant_values" in input_param
              and input_param["constant_values"] != 0
          ):
              continue
          padcropper = ResizeWithPadOrCrop(**input_param)
          image = p(np.zeros(input_shape))
          # non-lazy
          expected = padcropper(image)
          self.assertIsInstance(expected, MetaTensor)
          # lazy
          padcropper.lazy = True
          pending_result = padcropper(image)
          self.assertIsInstance(pending_result, MetaTensor)
          assert_allclose(
              pending_result.peek_pending_affine(), expected.affine
          )
          assert_allclose(
              pending_result.peek_pending_shape(), expected.shape[1:]
          )
          # only support nearest
          overrides = {
              "mode": "nearest",
              "padding_mode": TESTS_PENDING_MODE[input_param["mode"]],
              "align_corners": align_corners,
          }
          result = apply_pending(pending_result, overrides=overrides)[0]
          # compare
          assert_allclose(result, expected, rtol=1e-5)
          inverted = padcropper.inverse(result)
          self.assertEqual(inverted.shape, image.shape)
  
file_path: MONAI/tests/test_resize_with_pad_or_crop.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import ResizeWithPadOrCrop
  from monai.transforms.lazy.functional import apply_pending
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose, pytorch_after
label_desc: Use image node_id 2 for calling the TestResizeWithPadOrCrop obj's underlying member method code with example usage: obj.test_pending_ops(input_param, input_shape, _expected_data, align_corners) without return types