




from math import log

from scipy.constants import Boltzmann, physical_constants

UpperCamelCase__					    =    300  # TEMPERATURE (unit = K)







def 			_a   (		SCREAMING_SNAKE_CASE_							:       float   ,   SCREAMING_SNAKE_CASE_							:       float   ,   SCREAMING_SNAKE_CASE_							:       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()










import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel
class     a__					(      snake_case__   ):
						_a							:					Optional[Any]      =					"""M-CLIP"""






						def __init__(     self	,    _A=1_0_2_4	,    _A=7_6_8	,    **_A    ):




											"""simple docstring"""



											__lowerCAmelCase            = transformerDimSize
											__lowerCAmelCase            = imageDimSize
											super().__init__(**_A    )






class     a__					(      snake_case__   ):
						_a							:					Tuple      =					MCLIPConfig






						def __init__(     self	,    _A	,    *_A	,    **_A    ):




											"""simple docstring"""



											super().__init__(_A	,    *_A	,    **_A    )
											__lowerCAmelCase            = XLMRobertaModel(_A    )
											__lowerCAmelCase            = torch.nn.Linear(
											    in_features=config.transformerDimensions	,    out_features=config.numDims    )






						def        __SCREAMING_SNAKE_CASE(     self	,    _A	,    _A    ):




											"""simple docstring"""



											__lowerCAmelCase            = self.transformer(input_ids=_A	,    attention_mask=_A    )[0]
											__lowerCAmelCase            = (embs * attention_mask.unsqueeze(2    )).sum(dim=1    ) / attention_mask.sum(dim=1    )[:, None]
											return self.LinearTransformation(_A    ), embs




