code: def test_shape(
      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)
          xform.set_random_state(1234)
          result = xform(p(input_data))
  
          np.testing.assert_equal(
              len(result), input_param["num_samples"]
          )
          for i, (item, expected) in enumerate(
              zip(result, expected_shape)
          ):
              self.assertTupleEqual(item.shape, expected)
              self.assertEqual(item.meta["patch_index"], i)
          assert_allclose(
              result[-1], expected_last_item, type_test="tensor"
          )
  
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 1 for calling the TestRandSpatialCropSamples obj's underlying member method code with example usage: obj.test_shape(input_param, input_shape, expected_shape, expected_last_item) without return types