code: def test_pending_ops(
      self, input_param, input_data, _expected_shape, _expected_last
  ):
      xform = RandSpatialCropSamplesd(**input_param)
      # non-lazy
      xform.set_random_state(1234)
      expected = xform(input_data)
      self.assertIsInstance(expected[0]["img"], MetaTensor)
  
      # lazy
      xform.set_random_state(1234)
      xform.lazy = True
      pending_result = xform(input_data)
      for i, _pending_result in enumerate(pending_result):
          self.assertIsInstance(_pending_result["img"], MetaTensor)
          assert_allclose(
              _pending_result["img"].peek_pending_affine(),
              expected[i]["img"].affine,
          )
          assert_allclose(
              _pending_result["img"].peek_pending_shape(),
              expected[i]["img"].shape[1:],
          )
          # only support nearest
          overrides = {"mode": "nearest", "align_corners": False}
          result_img = apply_pending(
              _pending_result["img"], overrides=overrides
          )[0]
          result_seg = apply_pending(
              _pending_result["seg"], overrides=overrides
          )[0]
          # compare
          assert_allclose(result_img, expected[i]["img"], rtol=1e-5)
          assert_allclose(result_seg, expected[i]["seg"], rtol=1e-5)
  
file_path: MONAI/tests/test_rand_spatial_crop_samplesd.py
imports: from __future__ import annotations
  import unittest
  import numpy
  from parameterized import parameterized
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import Compose, DivisiblePadd, RandSpatialCropSamplesd
  from monai.transforms.lazy.functional import apply_pending
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose
label_desc: Use image node_id 3 for calling the TestRandSpatialCropSamplesd obj's underlying member method code with example usage: obj.test_pending_ops(input_param, input_data, _expected_shape, _expected_last) without return types