code: def test_pending_ops(
      self,
      input_param,
      input_shape,
      _expected_shape,
      _expected_last_item,
  ):
      input_data = np.arange(192).reshape(*input_shape)
  
      for p in TEST_NDARRAYS_ALL:
          xform = RandSpatialCropSamples(**input_param)
          image = p(input_data)
          # non-lazy
          xform.set_random_state(1234)
          expected = xform(image)
          self.assertIsInstance(expected[0], MetaTensor)
          # lazy
          xform.set_random_state(1234)
          xform.lazy = True
          pending_result = xform(image)
          for i, _pending_result in enumerate(pending_result):
              self.assertIsInstance(_pending_result, MetaTensor)
              assert_allclose(
                  _pending_result.peek_pending_affine(),
                  expected[i].affine,
              )
              assert_allclose(
                  _pending_result.peek_pending_shape(),
                  expected[i].shape[1:],
              )
              # only support nearest
              result = apply_pending(
                  _pending_result,
                  overrides={"mode": "nearest", "align_corners": False},
              )[0]
              # compare
              assert_allclose(result, expected[i], rtol=1e-5)
  
file_path: MONAI/tests/test_rand_spatial_crop_samples.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 RandSpatialCropSamples
  from monai.transforms.lazy.functional import apply_pending
  from tests.croppers import CropTest
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose
label_desc: Use image node_id 2 for calling the TestRandSpatialCropSamples obj's underlying member method code with example usage: obj.test_pending_ops(input_param, input_shape, _expected_shape, _expected_last_item) without return types