



"""simple docstring"""






import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


lowerCAmelCase__        =				logging.get_logger(__name__)






class        __snake_case       (	_lowercase):
  snake_case__				:   Union[str, Any]  			=						"upernet"




  def __init__( self     :						Dict						,					__lowerCAmelCase     :						Union[str, Any]=None						,					__lowerCAmelCase     :						Union[str, Any]=5_1_2						,					__lowerCAmelCase     :						Any=0.02						,					__lowerCAmelCase     :						List[Any]=[1, 2, 3, 6]						,					__lowerCAmelCase     :						Any=True						,					__lowerCAmelCase     :						str=0.4						,					__lowerCAmelCase     :						Union[str, Any]=3_8_4						,					__lowerCAmelCase     :						Optional[int]=2_5_6						,					__lowerCAmelCase     :						Optional[int]=1						,					__lowerCAmelCase     :						Optional[Any]=False						,					__lowerCAmelCase     :						Optional[Any]=2_5_5						,					**__lowerCAmelCase     :						List[str]						,					):






         """simple docstring"""






         super().__init__(**__lowerCAmelCase		)

         if backbone_config is None:
                logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''		)
                _lowerCamelCase						:				Union[str, Any]    			= CONFIG_MAPPING['''resnet'''](out_features=['''stage1''', '''stage2''', '''stage3''', '''stage4''']		)
         elif isinstance(__lowerCAmelCase						,					__lowerCAmelCase		):
                _lowerCamelCase						:				Any    			= backbone_config.get('''model_type'''		)
                _lowerCamelCase						:				Optional[Any]    			= CONFIG_MAPPING[backbone_model_type]
                _lowerCamelCase						:				int    			= config_class.from_dict(__lowerCAmelCase		)

         _lowerCamelCase						:				List[Any]    			= backbone_config
         _lowerCamelCase						:				Tuple    			= hidden_size
         _lowerCamelCase						:				Any    			= initializer_range
         _lowerCamelCase						:				Optional[Any]    			= pool_scales
         _lowerCamelCase						:				List[Any]    			= use_auxiliary_head
         _lowerCamelCase						:				Dict    			= auxiliary_loss_weight
         _lowerCamelCase						:				str    			= auxiliary_in_channels
         _lowerCamelCase						:				Optional[int]    			= auxiliary_channels
         _lowerCamelCase						:				Optional[int]    			= auxiliary_num_convs
         _lowerCamelCase						:				str    			= auxiliary_concat_input
         _lowerCamelCase						:				Dict    			= loss_ignore_index




  def 						SCREAMING_SNAKE_CASE				( self     :						List[Any]		):






         """simple docstring"""






         _lowerCamelCase						:				Tuple    			= copy.deepcopy(self.__dict__		)
         _lowerCamelCase						:				Union[str, Any]    			= self.backbone_config.to_dict()
         _lowerCamelCase						:				List[Any]    			= self.__class__.model_type
         return output










from math import log

from scipy.constants import Boltzmann, physical_constants

a		:       Any			     = 300  # TEMPERATURE (unit = K)






def 				lowerCamelCase__      (    __lowerCamelCase			:     float  ,		__lowerCamelCase			:     float  ,		__lowerCamelCase			:     float  ,		):

  if donor_conc <= 0:
    raise ValueError("""Donor concentration should be positive"""		)
  elif acceptor_conc <= 0:
    raise ValueError("""Acceptor concentration should be positive"""		)
  elif intrinsic_conc <= 0:
    raise ValueError("""Intrinsic concentration should be positive"""		)
  elif donor_conc <= intrinsic_conc:
    raise ValueError(
        """Donor concentration should be greater than intrinsic concentration"""		)
  elif acceptor_conc <= intrinsic_conc:
    raise ValueError(
        """Acceptor concentration should be greater than intrinsic concentration"""		)
  else:
    return (
        Boltzmann
        * T
        * log((donor_conc * acceptor_conc) / intrinsic_conc**2		)
        / physical_constants["electron volt"][0]
    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()


