code: def test_pending_ops(
      self, _, input_param, input_data, expected_shape, expected_centers
  ):
      crop = RandWeightedCropd(**input_param)
      # non-lazy
      crop.set_random_state(10)
      expected = crop(input_data)
      self.assertIsInstance(expected[0]["img"], MetaTensor)
      # lazy
      crop.set_random_state(10)
      crop.lazy = True
      pending_result = crop(input_data)
      for i, _pending_result in enumerate(pending_result):
          self.assertIsInstance(_pending_result["img"], MetaTensor)
          assert_allclose(
              _pending_result["img"].peek_pending_affine(),
              expected[i]["img"].affine,
          )
          assert_allclose(
              _pending_result["img"].peek_pending_shape(),
              expected[i]["img"].shape[1:],
          )
          # only support nearest
          result = apply_pending(
              _pending_result["img"],
              overrides={"mode": "nearest", "align_corners": False},
          )[0]
          # compare
          assert_allclose(result, expected[i]["img"], rtol=1e-5)
  
file_path: MONAI/tests/test_rand_weighted_cropd.py
imports: from __future__ import annotations
  import unittest
  import numpy
  from parameterized import parameterized
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms.croppad.dictionary import RandWeightedCropd
  from monai.transforms.lazy.functional import apply_pending
  from tests.utils import TEST_NDARRAYS_ALL, NumpyImageTestCase2D, NumpyImageTestCase3D, assert_allclose
label_desc: Use image node_id 2 for calling the TestRandWeightedCrop obj's underlying member method code with example usage: obj.test_pending_ops(_, input_param, input_data, expected_shape, expected_centers) without return types