



from typing import Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_openai import OpenAIGPTTokenizer


__magic_name__       =     logging.get_logger(__name__)

__magic_name__       =     {'''vocab_file''': '''vocab.json''', '''merges_file''': '''merges.txt''', '''tokenizer_file''': '''tokenizer.json'''}

__magic_name__       =     {
    '''vocab_file''': {'''openai-gpt''': '''https://huggingface.co/openai-gpt/resolve/main/vocab.json'''},
    '''merges_file''': {'''openai-gpt''': '''https://huggingface.co/openai-gpt/resolve/main/merges.txt'''},
    '''tokenizer_file''': {'''openai-gpt''': '''https://huggingface.co/openai-gpt/resolve/main/tokenizer.json'''},
}

__magic_name__       =     {
    '''openai-gpt''': 512,
}


class 	a__       (       _snake_case       ):


					"""simple docstring"""



					A__  :				int					 =				VOCAB_FILES_NAMES
					A__  :				Tuple					 =				PRETRAINED_VOCAB_FILES_MAP
					A__  :				Dict					 =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
					A__  :				Dict					 =				['''input_ids''', '''attention_mask''']
					A__  :				Optional[Any]					 =				OpenAIGPTTokenizer

					def __init__(		self     :Optional[int]      ,  lowercase__     :Any=None      ,  lowercase__     :Any=None      ,  lowercase__     :List[str]=None      ,  lowercase__     :str="<unk>"      ,  **lowercase__     :List[str]    ):
										super().__init__(lowercase__      ,  lowercase__      ,  tokenizer_file=lowercase__      ,  unk_token=lowercase__      ,  **lowercase__    )

					@property
					def 				__UpperCAmelCase		(		self     :Dict    ):
										return True



					def 				__UpperCAmelCase		(		self     :List[Any]      ,  lowercase__     :str      ,  lowercase__     :Optional[str] = None    ):
										lowercase						   =       self._tokenizer.model.save(lowercase__      ,  name=lowercase__    )
										return tuple(lowercase__    )











from __future__ import annotations





def 		__snake_case						(    _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase				):
					"""simple docstring"""






					assert (
					    c % greatest_common_divisor(_UpperCAmelCase       ,			_UpperCAmelCase				) == 0
					)  # greatest_common_divisor(a,b) function implemented below
					((lowercase)   ,      (lowercase)   ,      (lowercase))						   =       extended_gcd(_UpperCAmelCase       ,			_UpperCAmelCase				)  # extended_gcd(a,b) function implemented below
					lowercase						   =       c / d
					return (r * x, r * y)





def 		__snake_case						(    _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase = 2				):
					"""simple docstring"""






					((lowercase)   ,      (lowercase))						   =       diophantine(_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase				)  # Initial value
					lowercase						   =       greatest_common_divisor(_UpperCAmelCase       ,			_UpperCAmelCase				)
					lowercase						   =       a // d
					lowercase						   =       b // d

					for i in range(_UpperCAmelCase				):
										lowercase						   =       xa + i * q
										lowercase						   =       ya - i * p
										print(_UpperCAmelCase       ,			_UpperCAmelCase				)





def 		__snake_case						(    _UpperCAmelCase       ,			_UpperCAmelCase				):
					"""simple docstring"""






					if a < b:
										lowercase   ,      lowercase						   =       b, a

					while a % b != 0:
										lowercase   ,      lowercase						   =       b, a % b

					return b





def 		__snake_case						(    _UpperCAmelCase       ,			_UpperCAmelCase				):
					"""simple docstring"""






					assert a >= 0 and b >= 0

					if b == 0:
										lowercase   ,      lowercase   ,      lowercase						   =       a, 1, 0
					else:
										((lowercase)   ,      (lowercase)   ,      (lowercase))						   =       extended_gcd(_UpperCAmelCase       ,			a % b				)
										lowercase						   =       q
										lowercase						   =       p - q * (a // b)

					assert a % d == 0 and b % d == 0
					assert d == a * x + b * y

					return (d, x, y)


if __name__ == "__main__":
		from doctest import testmod

		testmod(name='''diophantine''', verbose=True)
		testmod(name='''diophantine_all_soln''', verbose=True)
		testmod(name='''extended_gcd''', verbose=True)
		testmod(name='''greatest_common_divisor''', verbose=True)






