



import os
from shutil import copyfile
from typing import Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
						from .tokenization_reformer import ReformerTokenizer
else:
						A__  :  List[Any]       = None


A__  :  Optional[int]       = logging.get_logger(__name__)


A__  :  List[Any]       = '''▁'''

A__  :  Any       = {'''vocab_file''': '''spiece.model''', '''tokenizer_file''': '''tokenizer.json'''}

A__  :  Optional[int]       = {
    '''vocab_file''': {
        '''google/reformer-crime-and-punishment''': (
            '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/spiece.model'''
        )
    },
    '''tokenizer_file''': {
        '''google/reformer-crime-and-punishment''': (
            '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/tokenizer.json'''
        )
    },
}

A__  :  int       = {
    '''google/reformer-crime-and-punishment''': 52_4288,
}



class     __snake_case						(					__lowerCAmelCase						):






							"""simple docstring"""




							_a      				=			VOCAB_FILES_NAMES
							_a      				=			PRETRAINED_VOCAB_FILES_MAP
							_a      				=			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							_a      				=			['''input_ids''', '''attention_mask''']
							_a      				=			ReformerTokenizer




							def __init__(	self					:	Optional[Any]    ,    A_					:	List[Any]=None    ,    A_					:	Optional[Any]=None    ,    A_					:	Union[str, Any]="</s>"    ,    A_					:	int="<unk>"    ,    A_					:	Any=[]    ,    **A_					:	List[Any]    ,    ):
									super().__init__(
									    __SCREAMING_SNAKE_CASE    ,    tokenizer_file=__SCREAMING_SNAKE_CASE    ,    eos_token=__SCREAMING_SNAKE_CASE    ,    unk_token=__SCREAMING_SNAKE_CASE    ,    additional_special_tokens=__SCREAMING_SNAKE_CASE    ,    **__SCREAMING_SNAKE_CASE    ,    )

									lowerCAmelCase_      :					Dict     =			vocab_file
									lowerCAmelCase_      :					Any     =			False if not self.vocab_file else True







							def        UpperCAmelCase__      (	self					:	int    ,    A_					:	List[str]    ,    A_					:	int = None):




									if not self.can_save_slow_tokenizer:
											raise ValueError(
											    '''Your fast tokenizer does not have the necessary information to save the vocabulary for a slow '''
											    '''tokenizer.''')

									if not os.path.isdir(__SCREAMING_SNAKE_CASE):
											logger.error(F"""Vocabulary path ({save_directory}) should be a directory""")
											return
									lowerCAmelCase_      :					str     =			os.path.join(
									    __SCREAMING_SNAKE_CASE    ,    (filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file'''])

									if os.path.abspath(self.vocab_file) != os.path.abspath(__SCREAMING_SNAKE_CASE):
											copyfile(self.vocab_file    ,    __SCREAMING_SNAKE_CASE)

									return (out_vocab_file,)










from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
A__  :  Any       = 9.8_0_6_6_5


def       UpperCamelCase(  __UpperCamelCase							:		float					,__UpperCamelCase							:		float			):

		# Ensure valid instance
		if not isinstance(__UpperCamelCase					,(int, float)			):
				raise TypeError('''Invalid velocity. Should be a positive number.'''			)

		if not isinstance(__UpperCamelCase					,(int, float)			):
				raise TypeError('''Invalid angle. Range is 1-90 degrees.'''			)

		# Ensure valid angle
		if angle > 90 or angle < 1:
				raise ValueError('''Invalid angle. Range is 1-90 degrees.'''			)

		# Ensure valid velocity
		if init_velocity < 0:
				raise ValueError('''Invalid velocity. Should be a positive number.'''			)


def       UpperCamelCase(  __UpperCamelCase							:		float					,__UpperCamelCase							:		float			):
		check_args(__UpperCamelCase					,__UpperCamelCase			)
		lowerCAmelCase_      :					Optional[Any]     =			angle_to_radians(2 * angle			)
		return round(init_velocity**2 * sin(__UpperCamelCase			) / g					,2			)


def       UpperCamelCase(  __UpperCamelCase							:		float					,__UpperCamelCase							:		float			):
		check_args(__UpperCamelCase					,__UpperCamelCase			)
		lowerCAmelCase_      :					Any     =			angle_to_radians(__UpperCamelCase			)
		return round(init_velocity**2 * sin(__UpperCamelCase			) ** 2 / (2 * g)					,2			)


def       UpperCamelCase(  __UpperCamelCase							:		float					,__UpperCamelCase							:		float			):
		check_args(__UpperCamelCase					,__UpperCamelCase			)
		lowerCAmelCase_      :					Dict     =			angle_to_radians(__UpperCamelCase			)
		return round(2 * init_velocity * sin(__UpperCamelCase			) / g					,2			)


def       UpperCamelCase(  ):
		lowerCAmelCase_ ,  lowerCAmelCase_      :					Any     =			25, 20
		assert horizontal_distance(__UpperCamelCase					,__UpperCamelCase			) == 4_0.9_7
		assert max_height(__UpperCamelCase					,__UpperCamelCase			) == 3.7_3
		assert total_time(__UpperCamelCase					,__UpperCamelCase			) == 1.7_4


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

						testmod()

						# Get input from user
						A__  :  List[Any]       = float(input('''Initial Velocity: ''').strip())

						# Get input from user
						A__  :  Dict       = float(input('''angle: ''').strip())

						# Print results
						print()
						print('''Results: ''')
						print(F'''Horizontal Distance: {horizontal_distance(init_vel, angle)!s} [m]''')
						print(F'''Maximum Height: {max_height(init_vel, angle)!s} [m]''')
						print(F'''Total Time: {total_time(init_vel, angle)!s} [s]''')





