code: def test_shape(
      self, input_param, input_data, expected_shape, expected_last
  ):
      xform = RandSpatialCropSamplesd(**input_param)
      xform.set_random_state(1234)
      result = xform(input_data)
      _len = len(tuple(input_data.keys()))
      self.assertTupleEqual(
          tuple(result[0].keys())[:_len], tuple(input_data.keys())
      )
      for item, expected in zip(result, expected_shape):
          self.assertTupleEqual(item["img"].shape, expected)
          self.assertTupleEqual(item["seg"].shape, expected)
      for i, item in enumerate(result):
          self.assertEqual(item["img"].meta["patch_index"], i)
          self.assertEqual(item["seg"].meta["patch_index"], i)
      assert_allclose(
          item["img"], expected_last["img"], type_test=False
      )
      assert_allclose(
          item["seg"], expected_last["seg"], type_test=False
      )
  
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 1 for calling the TestRandSpatialCropSamplesd obj's underlying member method code with example usage: obj.test_shape(input_param, input_data, expected_shape, expected_last) without return types