code: def test_keep_size(self):
      for p in TEST_NDARRAYS_ALL:
          im = p(self.imt[0])
          random_zoom = RandZoom(
              prob=1.0, min_zoom=0.6, max_zoom=0.7, keep_size=True
          )
          random_zoom.set_random_state(12)
          zoomed = random_zoom(im)
          test_local_inversion(random_zoom, zoomed, im)
          self.assertTrue(
              np.array_equal(zoomed.shape, self.imt.shape[1:])
          )
          zoomed = random_zoom(im)
          self.assertTrue(
              np.array_equal(zoomed.shape, self.imt.shape[1:])
          )
          zoomed = random_zoom(im)
          self.assertTrue(
              np.array_equal(zoomed.shape, self.imt.shape[1:])
          )
          random_zoom.prob = 0.0
          self.assertEqual(random_zoom(im).dtype, torch.float32)
  
file_path: MONAI/tests/test_rand_zoom.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from scipy.ndimage import zoom
  from monai.config import USE_COMPILED
  from monai.transforms import RandZoom
  from monai.utils import InterpolateMode
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_NDARRAYS_ALL, NumpyImageTestCase2D, assert_allclose, test_local_inversion
label_desc: Use image node_id 2 for calling the TestRandZoom obj's underlying member method code with example usage: obj.test_keep_size() without return types