code: def pad_test_pending_ops(self, input_param, input_shape):
      for mode in TESTS_PENDING_MODE:
          # TODO: One of the dim in the input data contains 1 report error.
          pad_fn = self.Padder(mode=mode[0], **input_param)
          data = self.get_arr(input_shape)
          is_map = isinstance(pad_fn, MapTransform)
          im = MetaTensor(
              data, meta={"a": "b", "affine": np.eye(len(input_shape))}
          )
          input_data = {"img": im} if is_map else im
          # non-lazy
          result_non_lazy = pad_fn(input_data)
          expected = (
              result_non_lazy["img"] if is_map else result_non_lazy
          )
          self.assertIsInstance(expected, MetaTensor)
          # lazy
          pad_fn.lazy = True
          pending_result = pad_fn(input_data)
          pending_result = (
              pending_result["img"] if is_map else pending_result
          )
          self.assertIsInstance(pending_result, MetaTensor)
          assert_allclose(
              pending_result.peek_pending_affine(), expected.affine
          )
          assert_allclose(
              pending_result.peek_pending_shape(), expected.shape[1:]
          )
          # TODO: mode="bilinear" may report error
          overrides = {
              "mode": "nearest",
              "padding_mode": mode[1],
              "align_corners": False,
          }
          result = apply_pending(pending_result, overrides=overrides)[0]
          # lazy in constructor
          pad_fn_lazy = self.Padder(
              mode=mode[0], lazy=True, **input_param
          )
          self.assertTrue(pad_fn_lazy.lazy)
          # compare
          assert_allclose(result, expected, rtol=1e-5)
          if isinstance(result, MetaTensor) and not isinstance(
              pad_fn, MapTransform
          ):
              pad_fn.lazy = False
              inverted = pad_fn.inverse(result)
              self.assertTrue(
                  (not inverted.pending_operations)
                  and (not inverted.applied_operations)
              )
              self.assertEqual(inverted.shape, im.shape)
  
file_path: MONAI/tests/padders.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import Compose
  from monai.transforms.lazy.functional import apply_pending
  from monai.transforms.transform import MapTransform
  from monai.utils.enums import NumpyPadMode, PytorchPadMode
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose
label_desc: Use image node_id 4 for calling the PadTest obj's underlying member method code with example usage: obj.pad_test_pending_ops(input_param, input_shape) without return types