code: def test_inverse(self, transform, invertible, use_metatensor):
      data = {
          k: (i + 1) * 10.0
          if not use_metatensor
          else MetaTensor((i + 1) * 10.0)
          for i, k in enumerate(KEYS)
      }
      fwd_data1 = transform(data)
      # test call twice won't affect inverse
      fwd_data2 = transform(data)
  
      if invertible:
          for k in KEYS:
              t = (
                  fwd_data1[TraceableTransform.trace_key(k)][-1]
                  if not use_metatensor
                  else fwd_data1[k].applied_operations[-1]
              )
              # make sure the SomeOf applied_order was stored
              self.assertEqual(t[TraceKeys.CLASS_NAME], SomeOf.__name__)
  
      # call the inverse
      fwd_inv_data1 = transform.inverse(fwd_data1)
      fwd_inv_data2 = transform.inverse(fwd_data2)
  
      fwd_data = [fwd_data1, fwd_data2]
      fwd_inv_data = [fwd_inv_data1, fwd_inv_data2]
      for i, _fwd_inv_data in enumerate(fwd_inv_data):
          if invertible:
              for k in KEYS:
                  # check transform was removed
                  if not use_metatensor:
                      self.assertTrue(
                          len(
                              _fwd_inv_data[
                                  TraceableTransform.trace_key(k)
                              ]
                          )
                          < len(
                              fwd_data[i][
                                  TraceableTransform.trace_key(k)
                              ]
                          )
                      )
                  # check data is same as original (and different from forward)
                  self.assertEqual(_fwd_inv_data[k], data[k])
                  self.assertNotEqual(_fwd_inv_data[k], fwd_data[i][k])
          else:
              # if not invertible, should not change the data
              self.assertDictEqual(fwd_data[i], _fwd_inv_data)
  
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from parameterized import parameterized
  import monai.transforms.intensity.array
  import monai.transforms.spatial.array
  import monai.transforms.spatial.dictionary
  from monai.data import MetaTensor
  from monai.transforms import TraceableTransform, Transform
  from monai.transforms.compose import Compose, SomeOf
  from monai.utils import set_determinism
  from monai.utils.enums import TraceKeys
  from tests.test_one_of import NonInv
  from tests.test_random_order import InvC, InvD
label_desc: Use image node_id 8 for calling the TestSomeOf obj's underlying member method code with example usage: obj.test_inverse(transform, invertible, use_metatensor) without return types