



from typing import Optional, Tuple

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


A__  :  Tuple       = logging.get_logger(__name__)

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

A__  :  int       = {
    '''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'''},
}

A__  :  Any       = {
    '''openai-gpt''': 512,
}



class     __snake_case						(					UpperCamelCase_						):
							_a      				=			VOCAB_FILES_NAMES
							_a      				=			PRETRAINED_VOCAB_FILES_MAP
							_a      				=			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							_a      				=			['''input_ids''', '''attention_mask''']
							_a      				=			OpenAIGPTTokenizer




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




							@property
							def        UpperCAmelCase__      (	self					:	List[str]):
									return True







							def        UpperCAmelCase__      (	self					:	Dict    ,    A_					:	str    ,    A_					:	Optional[str] = None):
									lowerCAmelCase_      :					str     =			self._tokenizer.model.save(A_    ,    name=A_)
									return tuple(A_)










A__  :  str       = 1000


def       UpperCamelCase(  __UpperCamelCase							:		float			):
		return x * x


def       UpperCamelCase(  __UpperCamelCase							:		Optional[int]					,__UpperCamelCase							:		float					,__UpperCamelCase							:		float					,__UpperCamelCase							:		int = 4			):
		assert callable(
		    __UpperCamelCase			), f"""the function(object) passed should be callable your input : {function}"""
		assert isinstance(__UpperCamelCase					,(float, int)			), f"""a should be float or integer your input : {a}"""
		assert isinstance(function(__UpperCamelCase			)					,(float, int)			), (
		    "the function should return integer or float return type of your function, "
		    f"""{type(__UpperCamelCase			)}"""
		)
		assert isinstance(__UpperCamelCase					,(float, int)			), f"""b should be float or integer your input : {b}"""
		assert (
		    isinstance(__UpperCamelCase					,__UpperCamelCase			) and precision > 0
		), f"""precision should be positive integer your input : {precision}"""

		# just applying the formula of simpson for approximate integration written in
		# mentioned article in first comment of this file and above this function

		lowerCAmelCase_      :					List[str]     =			(b - a) / N_STEPS
		lowerCAmelCase_      :					str     =			function(__UpperCamelCase			) + function(__UpperCamelCase			)

		for i in range(1					,__UpperCamelCase			):
				lowerCAmelCase_      :					Optional[Any]     =			a + h * i
				result += function(__UpperCamelCase			) * (4 if i % 2 else 2)

		result *= h / 3
		return round(__UpperCamelCase					,__UpperCamelCase			)


if __name__ == "__main__":
						import doctest

						doctest.testmod()





