code: def test_same_result(self, im_shape, im_type, k_intensity):
      im = self.get_data(im_shape, im_type)
      loc = (
          [0, int(im.shape[1] / 2), 0]
          if len(im_shape) == 2
          else [0, int(im.shape[1] / 2), 0, 0]
      )
      t = KSpaceSpikeNoise(loc, k_intensity)
  
      out1 = t(deepcopy(im))
      out2 = t(deepcopy(im))
  
      if isinstance(out1, torch.Tensor):
          out1 = out1.cpu()
          out2 = out2.cpu()
  
      np.testing.assert_allclose(out1, out2)
  
file_path: MONAI/tests/test_k_space_spike_noise.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from numpy.fft import fftn, fftshift
  from parameterized import parameterized
  from monai.data.synthetic import create_test_image_2d, create_test_image_3d
  from monai.transforms import KSpaceSpikeNoise
  from monai.utils.misc import set_determinism
  from tests.utils import TEST_NDARRAYS
label_desc: Use image node_id 4 for calling the TestKSpaceSpikeNoise obj's underlying member method code with example usage: obj.test_same_result(im_shape, im_type, k_intensity) without return types