


'''simple docstring'''

from __future__ import annotations






def __UpperCamelCase   (			__lowerCamelCase		: str      ,  __lowerCamelCase		: str      ,  __lowerCamelCase		: List[Any]      ,  )      ->     int:







     '''simple docstring'''






     if (electron_conc, hole_conc, intrinsic_conc).count(0				) != 1:
          raise ValueError("You cannot supply more or less than 2 values"				)
     elif electron_conc < 0:
          raise ValueError("Electron concentration cannot be negative in a semiconductor"				)
     elif hole_conc < 0:
          raise ValueError("Hole concentration cannot be negative in a semiconductor"				)
     elif intrinsic_conc < 0:
          raise ValueError(
              "Intrinsic concentration cannot be negative in a semiconductor"				)
     elif electron_conc == 0:
          return (
              "electron_conc",
              intrinsic_conc**2 / hole_conc,
          )
     elif hole_conc == 0:
          return (
              "hole_conc",
              intrinsic_conc**2 / electron_conc,
          )
     elif intrinsic_conc == 0:
          return (
              "intrinsic_conc",
              (electron_conc * hole_conc) ** 0.5,
          )
     else:
          return (-1, -1)


if __name__ == "__main__":
   import doctest

   doctest.testmod()





'''simple docstring'''

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__				     =		logging.get_logger(__name__)





class 						__SCREAMING_SNAKE_CASE					(      lowerCamelCase__ ):
     UpperCAmelCase 					=				'''encoder-decoder'''
     UpperCAmelCase 					=				True






     def __init__(			self     ,							**__UpperCamelCase		)       ->    List[Any]:
          super().__init__(**__UpperCamelCase		)
          assert (
              "encoder" in kwargs and "decoder" in kwargs
          ), "Config has to be initialized with encoder and decoder config"
          _a						=		kwargs.pop("encoder"		)
          _a						=		encoder_config.pop("model_type"		)
          _a						=		kwargs.pop("decoder"		)
          _a						=		decoder_config.pop("model_type"		)

          from ..auto.configuration_auto import AutoConfig

          _a						=		AutoConfig.for_model(__UpperCamelCase     ,							**__UpperCamelCase		)
          _a						=		AutoConfig.for_model(__UpperCamelCase     ,							**__UpperCamelCase		)
          _a						=		True






     @classmethod
     def  a_					(			cls     ,							__UpperCamelCase     ,							__UpperCamelCase     ,							**__UpperCamelCase		)       ->    PretrainedConfig:
          logger.info("Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"		)
          _a						=		True
          _a						=		True

          return cls(encoder=encoder_config.to_dict()     ,							decoder=decoder_config.to_dict()     ,							**__UpperCamelCase		)






     def  a_					(			self		)       ->    Any:
          _a						=		copy.deepcopy(self.__dict__		)
          _a						=		self.encoder.to_dict()
          _a						=		self.decoder.to_dict()
          _a						=		self.__class__.model_type
          return output

