from __future__ import annotations


def SCREAMING_SNAKE_CASE					(  lowercase_:						int		,    lowercase_:						int		,    lowercase_:						int					):
       assert n > 1 and a > 0 and greatest_common_divisor(lowercase_		,    lowercase_					) == 1
       ((_UpperCamelCase)    ,   (_UpperCamelCase)    ,   (_UpperCamelCase))  :							Optional[Any]	    =	extended_gcd(lowercase_		,    lowercase_					)  # Implemented below
       _UpperCamelCase  :							Tuple	    =	(b * s) % n
       return x


def SCREAMING_SNAKE_CASE					(  lowercase_:						int		,    lowercase_:						int					):
       ((_UpperCamelCase)    ,   (_UpperCamelCase))  :							Dict	    =	extended_euclid(lowercase_		,    lowercase_					)  # Implemented below
       if b < 0:
              _UpperCamelCase  :							Optional[Any]	    =	(b % n + n) % n
       return b


def SCREAMING_SNAKE_CASE					(  lowercase_:						int		,    lowercase_:						int		,    lowercase_:						int					):
       _UpperCamelCase  :							Dict	    =	invert_modulo(lowercase_		,    lowercase_					)
       _UpperCamelCase  :							str	    =	(b * s) % n
       return x


def SCREAMING_SNAKE_CASE					(  lowercase_:						int		,    lowercase_:						int					):
       assert a >= 0 and b >= 0

       if b == 0:
              _UpperCamelCase    ,   _UpperCamelCase    ,   _UpperCamelCase  :							Dict	    =	a, 1, 0
       else:
              ((_UpperCamelCase)    ,   (_UpperCamelCase)    ,   (_UpperCamelCase))  :							Dict	    =	extended_gcd(lowercase_		,    a % b					)
              _UpperCamelCase  :							int	    =	q
              _UpperCamelCase  :							Optional[Any]	    =	p - q * (a // b)

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

       return (d, x, y)


def SCREAMING_SNAKE_CASE					(  lowercase_:						int		,    lowercase_:						int					):





       if b == 0:
              return (1, 0)
       ((_UpperCamelCase)    ,   (_UpperCamelCase))  :							str	    =	extended_euclid(lowercase_		,    a % b					)
       _UpperCamelCase  :							Dict	    =	a // b
       return (y, x - k * y)


def SCREAMING_SNAKE_CASE					(  lowercase_:						int		,    lowercase_:						int					):





       if a < b:
              _UpperCamelCase    ,   _UpperCamelCase  :							Optional[Any]	    =	b, a

       while a % b != 0:
              _UpperCamelCase    ,   _UpperCamelCase  :							Any	    =	b, a % b

       return b


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

 testmod(name='''modular_division''', verbose=True)
 testmod(name='''modular_division2''', verbose=True)
 testmod(name='''invert_modulo''', verbose=True)
 testmod(name='''extended_gcd''', verbose=True)
 testmod(name='''extended_euclid''', verbose=True)
 testmod(name='''greatest_common_divisor''', verbose=True)








from typing import Optional, Tuple

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


_lowercase:					List[str]      =						logging.get_logger(__name__)

_lowercase:					str      =						{"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"}

_lowercase:					Union[str, Any]      =						{
    "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"},
}

_lowercase:					int      =						{
    "openai-gpt": 512,
}



class       _lowercase				(  lowerCAmelCase      ):





	"""simple docstring"""
	__A		      =				VOCAB_FILES_NAMES
	__A		      =				PRETRAINED_VOCAB_FILES_MAP
	__A		      =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	__A		      =				["input_ids", "attention_mask"]
	__A		      =				OpenAIGPTTokenizer




	def __init__(self						,			lowerCamelCase_=None						,			lowerCamelCase_=None						,			lowerCamelCase_=None						,			lowerCamelCase_="<unk>"						,			**lowerCamelCase_						):
						"""simple docstring"""

						super().__init__(lowerCamelCase_						,			lowerCamelCase_						,			tokenizer_file=lowerCamelCase_						,			unk_token=lowerCamelCase_						,			**lowerCamelCase_						)




	@property
	def 	UpperCamelCase_			(self						):
						"""simple docstring"""

						return True




	def 	UpperCamelCase_			(self						,			lowerCamelCase_						,			lowerCamelCase_ = None						):
						"""simple docstring"""

						a   	=  self._tokenizer.model.save(lowerCamelCase_						,			name=lowerCamelCase_						)
						return tuple(lowerCamelCase_						)
