class_docstr: Composes multiple adaptation method configurations into one. This class can be used to define complex adaptation
  method setups.
class_docstr_tok: ["Composes","multiple","adaptation","method","configurations","into","one",".","This","class","can","be","used","to","define","complex","adaptation","method","setups","."]
docstr: Performs simple validations of a list of configurations to check whether they can be combined to a common
  setup.
  
  Args:
      configs (List[AdapterConfig]): list of configs to check.
  
  Raises:
      TypeError: One of the configurations has a wrong type. ValueError: At least two given configurations
      conflict.
code: def validate(configs):
      """
      Performs simple validations of a list of configurations to check whether they can be combined to a common
      setup.
  
      Args:
          configs (List[AdapterConfig]): list of configs to check.
  
      Raises:
          TypeError: One of the configurations has a wrong type. ValueError: At least two given configurations
          conflict.
      """
      # perform single config checks
      for config in configs:
          if not isinstance(config, AdapterConfig):
              raise TypeError(
                  f"{config} is not an instance of AdapterConfig"
              )
          elif isinstance(config, ConfigUnion):
              raise TypeError(
                  f"{config} of type {type(config)} is not supported in a config union."
              )
      # perform pairwise check
      for c_a, c_b in [
          (c_a, c_b)
          for i, c_a in enumerate(configs)
          for j, c_b in enumerate(configs)
          if i > j
      ]:
          if c_a.architecture != c_b.architecture:
              continue
          # if at least one config specifies a leave_out, we cannot make a final decision at this point
          elif c_a.get("leave_out", []) or c_b.get("leave_out", []):
              continue
          elif (
              c_a.architecture is None
              or c_a.architecture == "bottleneck"
          ):
              is_valid = (
                  c_a.mh_adapter != c_b.mh_adapter
                  and c_a.output_adapter != c_b.output_adapter
              )
              if not is_valid:
                  raise ValueError(
                      f"{c_a} and {c_b} cannot be combined."
                  )
              else:
                  continue
          # at this point, we know that the architectures are the same
          raise ValueError(
              f"{c_a} and {c_b} have the same adapter architecture and cannot be combined."
          )
  
imports: import logging
  from collections.abc import Mapping
  from dataclasses import FrozenInstanceError, asdict, dataclass, field, replace
  from typing import List, Optional, Union
  from ..utils import resolve_adapter_config
label_desc: Use image node_id 2 for calling the ConfigUnion obj's underlying member method code with example usage: obj.validate(configs) without return types