code: def test_factor(self):
      key = "img"
      stats = IntensityStatsd(keys=key, ops="max", key_prefix="orig")
      shifter = RandShiftIntensityd(
          keys=[key], offsets=1.0, factor_key=["orig_max"], prob=1.0
      )
      data = {key: self.imt, PostFix.meta(key): {"affine": None}}
      shifter.set_random_state(seed=0)
      result = shifter(stats(data))
      np.random.seed(0)
      # simulate the randomize() of transform
      np.random.random()
      expected = self.imt + np.random.uniform(
          low=-1.0, high=1.0
      ) * np.nanmax(self.imt)
      np.testing.assert_allclose(result[key], expected)
  
file_path: MONAI/tests/test_rand_shift_intensityd.py
imports: from __future__ import annotations
  import unittest
  import numpy
  from monai.transforms import IntensityStatsd, RandShiftIntensityd
  from monai.utils.enums import PostFix
  from tests.utils import TEST_NDARRAYS, NumpyImageTestCase2D, assert_allclose
label_desc: Use image node_id 2 for calling the TestRandShiftIntensityd obj's underlying member method code with example usage: obj.test_factor() without return types