code: def test_config_union_valid(self):
      unions = [
          [PrefixTuningConfig(), ParBnConfig()],
          [PrefixTuningConfig(), SeqBnConfig()],
          [
              DoubleSeqBnConfig(mh_adapter=False),
              DoubleSeqBnConfig(
                  output_adapter=False, reduction_factor=2
              ),
          ],
          [
              SeqBnConfig(leave_out=[9, 10, 11], reduction_factor=2),
              SeqBnConfig(leave_out=list(range(9))),
          ],
      ]
      for union in unions:
          with self.subTest(union=union):
              config = ConfigUnion(*union)
              self.assertEqual(config.architecture, "union")
  
              # make sure serialization/ deserialization works
              config_dict = config.to_dict()
              config_dict = json.loads(json.dumps(config_dict))
              config_new = ConfigUnion.from_dict(config_dict)
              self.assertEqual(config, config_new)
  
              self.assertIsInstance(config_new[0], AdapterConfig)
              self.assertIsInstance(config_new[1], AdapterConfig)
  
file_path: adapters/tests/test_adapter_config.py
imports: import json
  import unittest
  from dataclasses import FrozenInstanceError, dataclass
  from adapters import ADAPTER_CONFIG_MAP, AdapterConfig, ConfigUnion, DoubleSeqBnConfig, LoRAConfig, MAMConfig, ParBnConfig, PrefixTuningConfig, SeqBnConfig
  from transformers.testing_utils import require_torch
label_desc: Use image node_id 5 for calling the AdapterConfigTest obj's underlying member method code with example usage: obj.test_config_union_valid() without return types