code: def test_config_string_valid(self):
      to_test = [
          ("double_seq_bn", DoubleSeqBnConfig()),
          (
              "seq_bn[reduction_factor=2, leave_out=[11]]",
              SeqBnConfig(reduction_factor=2, leave_out=[11]),
          ),
          (
              "par_bn[reduction_factor={'0': 8, '1': 8, 'default': 16}]",
              ParBnConfig(
                  reduction_factor={"0": 8, "1": 8, "default": 16}
              ),
          ),
          (
              "prefix_tuning[prefix_length=30, flat=True]",
              PrefixTuningConfig(prefix_length=30, flat=True),
          ),
          ("lora[r=200,alpha=8]", LoRAConfig(r=200, alpha=8)),
          (
              "prefix_tuning|par_bn",
              ConfigUnion(PrefixTuningConfig(), ParBnConfig()),
          ),
          (
              "lora[attn_matrices=['k', 'v']]",
              LoRAConfig(attn_matrices=["k", "v"]),
          ),
          (
              "lora[use_gating=True]|prefix_tuning[use_gating=True]|seq_bn[use_gating=True]",
              ConfigUnion(
                  LoRAConfig(use_gating=True),
                  PrefixTuningConfig(use_gating=True),
                  SeqBnConfig(use_gating=True),
              ),
          ),
      ]
      for config_str, config in to_test:
          with self.subTest(config_str=config_str):
              config_new = AdapterConfig.load(config_str)
              self.assertEqual(config, config_new)
  
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 7 for calling the AdapterConfigTest obj's underlying member method code with example usage: obj.test_config_string_valid() without return types