code: def test_type_shape(self, input_param, input_data, expected_shape):
      results = []
      for p in TEST_NDARRAYS_ALL:
          input_param_mod = self.convert_data_type(p, input_param)
          input_data_mod = self.convert_data_type(p, input_data)
          cropper = RandCropByPosNegLabel(**input_param_mod)
          cropper.set_random_state(0)
          result = cropper(**input_data_mod)
          self.assertListEqual(
              cropper.spatial_size, input_param["spatial_size"]
          )
  
          self.assertIsInstance(result, list)
          self.assertTupleEqual(result[0].shape, expected_shape)
  
          # check for same results across numpy, torch.Tensor and torch.cuda.Tensor
          result = np.asarray(
              [
                  i if isinstance(i, np.ndarray) else i.cpu().numpy()
                  for i in result
              ]
          )
          results.append(np.asarray(result))
          if len(results) > 1:
              np.testing.assert_allclose(results[0], results[-1])
  
file_path: MONAI/tests/test_rand_crop_by_pos_neg_label.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  from parameterized import parameterized
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import RandCropByPosNegLabel
  from monai.transforms.lazy.functional import apply_pending
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose
label_desc: Use image node_id 2 for calling the TestRandCropByPosNegLabel obj's underlying member method code with example usage: obj.test_type_shape(input_param, input_data, expected_shape) without return types