code: def test_resampler_lazy(
      resampler,
      expected_output,
      init_param=None,
      call_param=None,
      output_key=None,
      output_idx=None,
      rtol=1e-5,
      atol=1e-7,
      skip_shape_check=False,
      seed=None,
  ):
      """
      This test function is used to test the consistency between non-lazy and lazy transforms.
      Args:
          resampler: instance of a resampling transform.
          expected_output: output of non-lazy transform.
          init_param: parameters that are used to initialize the transform.
          call_param: parameters that are used when calling the transform.
          output_key: key to get the output of the transform. This argument is used for dictionary based transforms.
          output_idx: index to get the expected output from multiple outputs of the transform.
          rtol: relative tolerance. This argument is only used to compare the output.
          atol: absolute tolerance. This argument is only used to compare the output.
          skip_shape_check: skip the check of shapes.
          seed: set the random state with an integer seed. This argument is used for randomizable transforms.
  
      """
      if isinstance(resampler, Randomizable):
          resampler.set_random_state(seed=seed)
      set_track_meta(True)
      resampler.lazy = True
      pending_output = resampler(**deepcopy(call_param))
      if output_idx is not None:
          expected_output, pending_output = (
              expected_output[output_idx],
              pending_output[output_idx],
          )
      if output_key is not None:
          non_lazy_out, lazy_out = (
              expected_output[output_key],
              pending_output[output_key],
          )
      else:
          non_lazy_out, lazy_out = expected_output, pending_output
      assert_allclose(
          lazy_out.peek_pending_affine(), non_lazy_out.affine
      )
      if not skip_shape_check:
          assert_allclose(
              lazy_out.peek_pending_shape(), non_lazy_out.shape[1:4]
          )
      apply_param = get_apply_param(init_param, call_param)
      lazy_out = apply_pending(lazy_out, overrides=apply_param)[0]
      assert_allclose(lazy_out, non_lazy_out, rtol=rtol, atol=atol)
      if (
          isinstance(resampler, InvertibleTransform)
          and (not isinstance(resampler, MapTransform))
          and isinstance(lazy_out, MetaTensor)
          and isinstance(non_lazy_out, MetaTensor)
          and non_lazy_out.applied_operations
      ):
          resampler.lazy = False
          out = resampler.inverse(lazy_out.clone())
          ref = resampler.inverse(non_lazy_out.clone())
          assert_allclose(out.applied_operations, [])
          assert_allclose(out.pending_operations, [])
          assert_allclose(
              ref, out, type_test=False, rtol=1e-3, atol=1e-3
          )
          resampler.lazy = True
  
file_path: MONAI/tests/lazy_transforms_utils.py
imports: from __future__ import annotations
  from copy import deepcopy
  from monai.data import MetaTensor, set_track_meta
  from monai.transforms import InvertibleTransform, MapTransform, Randomizable
  from monai.transforms.lazy.functional import apply_pending
  from tests.utils import assert_allclose
label_desc: Use image node_id 2 for calling a global function with example usage: test_resampler_lazy(resampler, expected_output, init_param, call_param, output_key, output_idx, rtol, atol, skip_shape_check, seed) without return types