





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_electra import ElectraTokenizer


lowerCAmelCase__     						=			{'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

lowerCAmelCase__     						=			{
    'vocab_file': {
        'google/electra-small-generator': (
            'https://huggingface.co/google/electra-small-generator/resolve/main/vocab.txt'
        ),
        'google/electra-base-generator': 'https://huggingface.co/google/electra-base-generator/resolve/main/vocab.txt',
        'google/electra-large-generator': (
            'https://huggingface.co/google/electra-large-generator/resolve/main/vocab.txt'
        ),
        'google/electra-small-discriminator': (
            'https://huggingface.co/google/electra-small-discriminator/resolve/main/vocab.txt'
        ),
        'google/electra-base-discriminator': (
            'https://huggingface.co/google/electra-base-discriminator/resolve/main/vocab.txt'
        ),
        'google/electra-large-discriminator': (
            'https://huggingface.co/google/electra-large-discriminator/resolve/main/vocab.txt'
        ),
    },
    'tokenizer_file': {
        'google/electra-small-generator': (
            'https://huggingface.co/google/electra-small-generator/resolve/main/tokenizer.json'
        ),
        'google/electra-base-generator': (
            'https://huggingface.co/google/electra-base-generator/resolve/main/tokenizer.json'
        ),
        'google/electra-large-generator': (
            'https://huggingface.co/google/electra-large-generator/resolve/main/tokenizer.json'
        ),
        'google/electra-small-discriminator': (
            'https://huggingface.co/google/electra-small-discriminator/resolve/main/tokenizer.json'
        ),
        'google/electra-base-discriminator': (
            'https://huggingface.co/google/electra-base-discriminator/resolve/main/tokenizer.json'
        ),
        'google/electra-large-discriminator': (
            'https://huggingface.co/google/electra-large-discriminator/resolve/main/tokenizer.json'
        ),
    },
}

lowerCAmelCase__     						=			{
    'google/electra-small-generator': 512,
    'google/electra-base-generator': 512,
    'google/electra-large-generator': 512,
    'google/electra-small-discriminator': 512,
    'google/electra-base-discriminator': 512,
    'google/electra-large-discriminator': 512,
}

lowerCAmelCase__     						=			{
    'google/electra-small-generator': {'do_lower_case': True},
    'google/electra-base-generator': {'do_lower_case': True},
    'google/electra-large-generator': {'do_lower_case': True},
    'google/electra-small-discriminator': {'do_lower_case': True},
    'google/electra-base-discriminator': {'do_lower_case': True},
    'google/electra-large-discriminator': {'do_lower_case': True},
}
class     a_			(						__lowerCamelCase						):






 '''simple docstring'''






 UpperCAmelCase_     			= VOCAB_FILES_NAMES
 UpperCAmelCase_     			= PRETRAINED_VOCAB_FILES_MAP
 UpperCAmelCase_     			= PRETRAINED_INIT_CONFIGURATION
 UpperCAmelCase_     			= PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 UpperCAmelCase_     			= ElectraTokenizer




 def __init__(      self :  int      ,   lowercase__ :  str=None      ,   lowercase__ :  int=None      ,   lowercase__ :  Tuple=True      ,   lowercase__ :  str="[UNK]"      ,   lowercase__ :  List[Any]="[SEP]"      ,   lowercase__ :  Optional[int]="[PAD]"      ,   lowercase__ :  Tuple="[CLS]"      ,   lowercase__ :  Any="[MASK]"      ,   lowercase__ :  List[Any]=True      ,   lowercase__ :  Any=None      ,   **lowercase__ :  Dict      ,   ):







        '''simple docstring'''



        super().__init__(
            __lowercase      ,   tokenizer_file=__lowercase      ,   do_lower_case=__lowercase      ,   unk_token=__lowercase      ,   sep_token=__lowercase      ,   pad_token=__lowercase      ,   cls_token=__lowercase      ,   mask_token=__lowercase      ,   tokenize_chinese_chars=__lowercase      ,   strip_accents=__lowercase      ,   **__lowercase      ,   )

        lowerCAmelCase__					     = json.loads(self.backend_tokenizer.normalizer.__getstate__())
        if (
            normalizer_state.get('lowercase'      ,   __lowercase) != do_lower_case
            or normalizer_state.get('strip_accents'      ,   __lowercase) != strip_accents
            or normalizer_state.get('handle_chinese_chars'      ,   __lowercase) != tokenize_chinese_chars
        ):
               lowerCAmelCase__					     = getattr(__lowercase      ,   normalizer_state.pop('type'))
               lowerCAmelCase__					     = do_lower_case
               lowerCAmelCase__					     = strip_accents
               lowerCAmelCase__					     = tokenize_chinese_chars
               lowerCAmelCase__					     = normalizer_class(**__lowercase)

        lowerCAmelCase__					     = do_lower_case




 def 		__snake_case						(      self :  Tuple      ,   lowercase__ :  Tuple      ,   lowercase__ :  Any=None):







        '''simple docstring'''



        lowerCAmelCase__					     = [self.cls_token_id] + token_ids_a + [self.sep_token_id]

        if token_ids_a:
               output += token_ids_a + [self.sep_token_id]

        return output




 def 		__snake_case						(      self :  Union[str, Any]      ,   lowercase__ :  List[int]      ,   lowercase__ :  Optional[List[int]] = None):







        '''simple docstring'''



        lowerCAmelCase__					     = [self.sep_token_id]
        lowerCAmelCase__					     = [self.cls_token_id]
        if token_ids_a is None:
               return len(cls + token_ids_a + sep) * [0]
        return len(cls + token_ids_a + sep) * [0] + len(token_ids_a + sep) * [1]




 def 		__snake_case						(      self :  Any      ,   lowercase__ :  str      ,   lowercase__ :  Optional[str] = None):







        '''simple docstring'''



        lowerCAmelCase__					     = self._tokenizer.model.save(__lowercase      ,   name=__lowercase)
        return tuple(__lowercase)

from math import log

from scipy.constants import Boltzmann, physical_constants

lowerCAmelCase__     						=			300  # TEMPERATURE (unit = K)






def 				__lowerCamelCase		(						lowerCAmelCase__     ,  lowerCAmelCase__     ,  lowerCAmelCase__     ,  ):

       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()
