



'''simple docstring'''

import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_lxmert import LxmertTokenizer


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

SCREAMING_SNAKE_CASE__     :						Dict	=  {
    '''vocab_file''': {
        '''unc-nlp/lxmert-base-uncased''': '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/vocab.txt''',
    },
    '''tokenizer_file''': {
        '''unc-nlp/lxmert-base-uncased''': (
            '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/tokenizer.json'''
        ),
    },
}

SCREAMING_SNAKE_CASE__     :						Union[str, Any]	=  {
    '''unc-nlp/lxmert-base-uncased''': 5_1_2,
}

SCREAMING_SNAKE_CASE__     :						Optional[Any]	=  {
    '''unc-nlp/lxmert-base-uncased''': {'''do_lower_case''': True},
}

class 							a__( snake_case__     ):
			a_	: int									=      VOCAB_FILES_NAMES
			a_	: List[Any]									=      PRETRAINED_VOCAB_FILES_MAP
			a_	: Optional[int]									=      PRETRAINED_INIT_CONFIGURATION
			a_	: List[str]									=      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			a_	: Tuple									=      LxmertTokenizer






			def __init__(     self					,   _UpperCAmelCase=None					,   _UpperCAmelCase=None					,   _UpperCAmelCase=True					,   _UpperCAmelCase="[UNK]"					,   _UpperCAmelCase="[SEP]"					,   _UpperCAmelCase="[PAD]"					,   _UpperCAmelCase="[CLS]"					,   _UpperCAmelCase="[MASK]"					,   _UpperCAmelCase=True					,   _UpperCAmelCase=None					,   **_UpperCAmelCase					,   )							->							Union[str, Any]:
					super().__init__(
					    _UpperCAmelCase					,   tokenizer_file=_UpperCAmelCase					,   do_lower_case=_UpperCAmelCase					,   unk_token=_UpperCAmelCase					,   sep_token=_UpperCAmelCase					,   pad_token=_UpperCAmelCase					,   cls_token=_UpperCAmelCase					,   mask_token=_UpperCAmelCase					,   tokenize_chinese_chars=_UpperCAmelCase					,   strip_accents=_UpperCAmelCase					,   **_UpperCAmelCase					,   )

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

					snake_case__	     =do_lower_case






			def 						_lowercase  (     self					,   _UpperCAmelCase					,   _UpperCAmelCase=None						)							->							int:
					snake_case__	     =[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 						_lowercase  (     self					,   _UpperCAmelCase					,   _UpperCAmelCase = None						)							->							List[int]:
					snake_case__	     =[self.sep_token_id]
					snake_case__	     =[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 						_lowercase  (     self					,   _UpperCAmelCase					,   _UpperCAmelCase = None						)							->							Tuple[str]:
					snake_case__	     =self._tokenizer.model.save(_UpperCAmelCase					,   name=_UpperCAmelCase						)
					return tuple(_UpperCAmelCase						)









'''simple docstring'''

from __future__ import annotations

SCREAMING_SNAKE_CASE__     :						List[Any]	=  1.6021e-19  # units = C






def 				a  (     UpperCamelCase_    :    float      ,					UpperCamelCase_    :    float      ,					UpperCamelCase_    :    float      ,					)       ->	tuple[str, float]:
		if (conductivity, electron_conc, mobility).count(0			) != 1:
				raise ValueError('You cannot supply more or less than 2 values'			)
		elif conductivity < 0:
				raise ValueError('Conductivity cannot be negative'			)
		elif electron_conc < 0:
				raise ValueError('Electron concentration cannot be negative'			)
		elif mobility < 0:
				raise ValueError('mobility cannot be negative'			)
		elif conductivity == 0:
				return (
				    "conductivity",
				    mobility * electron_conc * ELECTRON_CHARGE,
				)
		elif electron_conc == 0:
				return (
				    "electron_conc",
				    conductivity / (mobility * ELECTRON_CHARGE),
				)
		else:
				return (
				    "mobility",
				    conductivity / (electron_conc * ELECTRON_CHARGE),
				)


if __name__ == "__main__":
			import doctest

			doctest.testmod()




