





from transformers import (
    DPRContextEncoderTokenizer,
    DPRContextEncoderTokenizerFast,
    DPRQuestionEncoderTokenizer,
    DPRQuestionEncoderTokenizerFast,
    DPRReaderOutput,
    DPRReaderTokenizer,
    DPRReaderTokenizerFast,
)
from transformers.testing_utils import require_tokenizers, slow
from transformers.tokenization_utils_base import BatchEncoding

from ..bert.test_tokenization_bert import BertTokenizationTest



@require_tokenizers
class       __lowerCAmelCase (    _a  ):
			lowerCamelCase_  :  List[Any]     =   DPRContextEncoderTokenizer
			lowerCamelCase_  :  Union[str, Any]     =   DPRContextEncoderTokenizerFast
			lowerCamelCase_  :  int     =   True




@require_tokenizers
class       __lowerCAmelCase (    _a  ):
			lowerCamelCase_  :  Optional[int]     =   DPRQuestionEncoderTokenizer
			lowerCamelCase_  :  str     =   DPRQuestionEncoderTokenizerFast
			lowerCamelCase_  :  Union[str, Any]     =   True




@require_tokenizers
class       __lowerCAmelCase (    _a  ):
			lowerCamelCase_  :  Tuple     =   DPRReaderTokenizer
			lowerCamelCase_  :  List[Any]     =   DPRReaderTokenizerFast
			lowerCamelCase_  :  Any     =   True






			@slow
			def     lowerCamelCase						(self					)  ->     List[str]:


							'''simple docstring'''



							snake_case_		:					Any			    =						self.tokenizer_class.from_pretrained('''bert-base-uncased'''					)

							snake_case_		:					Dict			    =						tokenizer.encode('''question sequence'''      ,							add_special_tokens=lowerCamelCase__					)
							snake_case_		:					str			    =						tokenizer.encode('''title sequence'''      ,							add_special_tokens=lowerCamelCase__					)
							snake_case_		:					str			    =						tokenizer.encode('''text sequence ''' * 4      ,							add_special_tokens=lowerCamelCase__					)
							snake_case_		:					List[str]			    =						[[101] + text_a + [102] + text_a + [102] + text_a]
							snake_case_		:					str			    =						BatchEncoding({'''input_ids''': input_ids}					)

							snake_case_		:					Union[str, Any]			    =						[[0] * len(input_ids[0]					)]
							snake_case_		:					Tuple			    =						[[0] * len(input_ids[0]					)]
							snake_case_		:					Optional[int]			    =						[0]
							snake_case_		:					Any			    =						DPRReaderOutput(lowerCamelCase__      ,							lowerCamelCase__      ,							lowerCamelCase__					)

							snake_case_		:					Optional[Any]			    =						8, 9
							snake_case_		:					str			    =						10
							snake_case_		:					Dict			    =						10
							snake_case_		:					List[Any]			    =						tokenizer.decode_best_spans(lowerCamelCase__      ,							lowerCamelCase__					)
							self.assertEqual(predicted_spans[0].start_index      ,							lowerCamelCase__					)
							self.assertEqual(predicted_spans[0].end_index      ,							lowerCamelCase__					)
							self.assertEqual(predicted_spans[0].doc_id      ,							0					)






			@slow
			def     lowerCamelCase						(self					)  ->     Optional[int]:


							'''simple docstring'''



							snake_case_		:					Optional[Any]			    =						self.tokenizer_class.from_pretrained('''bert-base-uncased'''					)

							snake_case_		:					Union[str, Any]			    =						tokenizer.encode('''question sequence'''      ,							add_special_tokens=lowerCamelCase__					)
							snake_case_		:					List[Any]			    =						tokenizer.encode('''title sequence'''      ,							add_special_tokens=lowerCamelCase__					)
							snake_case_		:					List[Any]			    =						tokenizer.encode('''text sequence'''      ,							add_special_tokens=lowerCamelCase__					)
							snake_case_		:					Dict			    =						[101] + text_a + [102] + text_a + [102] + text_a
							snake_case_		:					str			    =						tokenizer(questions=['''question sequence''']      ,							titles=['''title sequence''']      ,							texts=['''text sequence''']					)
							self.assertIn('''input_ids'''      ,							lowerCamelCase__					)
							self.assertIn('''attention_mask'''      ,							lowerCamelCase__					)
							self.assertListEqual(encoded_input['''input_ids'''][0]      ,							lowerCamelCase__					)







from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
lowerCAmelCase_												=       9.80_665






def   lowerCamelCase_		(       _UpperCamelCase				,       _UpperCamelCase				)	->		None:






				"""simple docstring"""


				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   lowerCamelCase_		(       _UpperCamelCase				,       _UpperCamelCase				)	->		float:






				"""simple docstring"""


				check_args(_UpperCamelCase				,       _UpperCamelCase				)
				snake_case_		:					List[str]			    =						angle_to_radians(2 * angle				)
				return round(init_velocity**2 * sin(_UpperCamelCase				) / g				,       2				)






def   lowerCamelCase_		(       _UpperCamelCase				,       _UpperCamelCase				)	->		float:






				"""simple docstring"""


				check_args(_UpperCamelCase				,       _UpperCamelCase				)
				snake_case_		:					Tuple			    =						angle_to_radians(_UpperCamelCase				)
				return round(init_velocity**2 * sin(_UpperCamelCase				) ** 2 / (2 * g)				,       2				)






def   lowerCamelCase_		(       _UpperCamelCase				,       _UpperCamelCase				)	->		float:






				"""simple docstring"""


				check_args(_UpperCamelCase				,       _UpperCamelCase				)
				snake_case_		:					Optional[Any]			    =						angle_to_radians(_UpperCamelCase				)
				return round(2 * init_velocity * sin(_UpperCamelCase				) / g				,       2				)






def   lowerCamelCase_		(       )	->		None:






				"""simple docstring"""


				snake_case_    ,							snake_case_		:					Dict			    =						25, 20
				assert horizontal_distance(_UpperCamelCase				,       _UpperCamelCase				) == 40.97
				assert max_height(_UpperCamelCase				,       _UpperCamelCase				) == 3.73
				assert total_time(_UpperCamelCase				,       _UpperCamelCase				) == 1.74


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

	testmod()

	# Get input from user
	lowerCAmelCase_												=       float(input('''Initial Velocity: ''').strip())

	# Get input from user
	lowerCAmelCase_												=       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]''')
