



import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

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


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

lowerCAmelCase__					  =  {
    '''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'''
        ),
    },
}

lowerCAmelCase__					  =  {
    '''unc-nlp/lxmert-base-uncased''': 5_1_2,
}

lowerCAmelCase__					  =  {
    '''unc-nlp/lxmert-base-uncased''': {'''do_lower_case''': True},
}

class 				snake_case__(lowerCamelCase__      ):

					"""simple docstring"""






					lowercase_								=		VOCAB_FILES_NAMES
					lowercase_								=		PRETRAINED_VOCAB_FILES_MAP
					lowercase_								=		PRETRAINED_INIT_CONFIGURATION
					lowercase_								=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
					lowercase_								=		LxmertTokenizer







					def __init__(							self :     Dict				,       SCREAMING_SNAKE_CASE :     Optional[Any]=None				,       SCREAMING_SNAKE_CASE :     List[str]=None				,       SCREAMING_SNAKE_CASE :     Dict=True				,       SCREAMING_SNAKE_CASE :     Any="[UNK]"				,       SCREAMING_SNAKE_CASE :     Union[str, Any]="[SEP]"				,       SCREAMING_SNAKE_CASE :     List[str]="[PAD]"				,       SCREAMING_SNAKE_CASE :     List[Any]="[CLS]"				,       SCREAMING_SNAKE_CASE :     Union[str, Any]="[MASK]"				,       SCREAMING_SNAKE_CASE :     Tuple=True				,       SCREAMING_SNAKE_CASE :     Union[str, Any]=None				,       **SCREAMING_SNAKE_CASE :     int				,       ):
									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__				,       )

									lowercase__					:   Optional[Any]													=					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
									):
													lowercase__					:   Optional[int]													=					getattr(lowercase__				,       normalizer_state.pop("type"					)					)
													lowercase__					:   Optional[Any]													=					do_lower_case
													lowercase__					:   Optional[int]													=					strip_accents
													lowercase__					:   Optional[int]													=					tokenize_chinese_chars
													lowercase__					:   Optional[int]													=					normalizer_class(**lowercase__					)

									lowercase__					:   Optional[int]													=					do_lower_case







					def 			snake_case					(							self :     int				,       SCREAMING_SNAKE_CASE :     int				,       SCREAMING_SNAKE_CASE :     str=None					):
									lowercase__					:   Optional[Any]													=					[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 :     Tuple				,       SCREAMING_SNAKE_CASE :     List[int]				,       SCREAMING_SNAKE_CASE :     Optional[List[int]] = None					):
									lowercase__					:   Union[str, Any]													=					[self.sep_token_id]
									lowercase__					:   List[Any]													=					[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 :     Optional[int]				,       SCREAMING_SNAKE_CASE :     str				,       SCREAMING_SNAKE_CASE :     Optional[str] = None					):
									lowercase__					:   List[str]													=					self._tokenizer.model.save(lowercase__				,       name=lowercase__					)
									return tuple(lowercase__					)









from __future__ import annotations

from math import pi

# Define the Reduced Planck Constant ℏ (H bar), speed of light C, value of
# Pi and the function
lowerCAmelCase__					  =  1.054571817e-34  # unit of ℏ : J * s

lowerCAmelCase__					  =  3e8  # unit of c : m * s^-1


def  __lowerCamelCase (       lowerCamelCase__					,			lowerCamelCase__					,			lowerCamelCase__						):

				"""simple docstring"""


				if (force, area, distance).count(0						) != 1:
								raise ValueError("One and only one argument must be 0"						)
				if force < 0:
								raise ValueError("Magnitude of force can not be negative"						)
				if distance < 0:
								raise ValueError("Distance can not be negative"						)
				if area < 0:
								raise ValueError("Area can not be negative"						)
				if force == 0:
								lowercase__					:   Optional[Any]													=					(REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2 * area) / (
								    240 * (distance) ** 4
								)
								return {"force": force}
				elif area == 0:
								lowercase__					:   str													=					(240 * force * (distance) ** 4) / (
								    REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2
								)
								return {"area": area}
				elif distance == 0:
								lowercase__					:   Tuple													=					(
								    (REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2 * area) / (240 * force)
								) ** (1 / 4)
								return {"distance": distance}
				raise ValueError("One and only one argument must be 0"						)


# Run doctest
if __name__ == "__main__":
				import doctest

				doctest.testmod()




