code: def check(
      self, tr: RandLambda, img, img_orig_type, out, expected=None
  ):
      # input shouldn't change
      self.assertIsInstance(img, img_orig_type)
      if isinstance(img, MetaTensor):
          self.assertEqual(len(img.applied_operations), 0)
      # output data matches expected
      assert_allclose(expected, out, type_test=False)
      # output type is MetaTensor with 1 appended operation
      self.assertIsInstance(out, MetaTensor)
      self.assertEqual(len(out.applied_operations), 1)
  
      # inverse
      inv = tr.inverse(out)
      # after inverse, input image remains unchanged
      self.assertIsInstance(img, img_orig_type)
      if isinstance(img, MetaTensor):
          self.assertEqual(len(img.applied_operations), 0)
      # after inverse, output is MetaTensor with 0 applied operations
      self.assertIsInstance(inv, MetaTensor)
      self.assertEqual(len(inv.applied_operations), 0)
  
file_path: MONAI/tests/test_rand_lambda.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  from parameterized import parameterized
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms.transform import Randomizable
  from monai.transforms.utility.array import RandLambda
  from tests.utils import TEST_NDARRAYS, assert_allclose
label_desc: Use image node_id 1 for calling the TestRandLambda obj's underlying member method code with example usage: obj.check(tr, img, img_orig_type, out, expected) without return types