code: def test_compose_flatten_does_not_affect_random_order(self):
      p = Compose(
          [A(), B(), RandomOrder([C(), Inv(KEYS), Compose([X(), Y()])])]
      )
      f = p.flatten()
  
      # in this case the flattened transform should be the same.
      def _match(a, b):
          self.assertEqual(type(a), type(b))
          for a_, b_ in zip(a.transforms, b.transforms):
              self.assertEqual(type(a_), type(b_))
              if isinstance(a_, (Compose, RandomOrder)):
                  _match(a_, b_)
  
      _match(p, f)
  
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 RandomOrder
  from monai.transforms.compose import Compose
  from monai.utils import set_determinism
  from monai.utils.enums import TraceKeys
  from tests.test_one_of import A, B, C, Inv, NonInv, X, Y
label_desc: Use image node_id 2 for calling the TestRandomOrder obj's underlying member method code with example usage: obj.test_compose_flatten_does_not_affect_random_order() without return types