



from math import radians as angle_to_radians
from math import sin

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



def        __a     (    lowerCAmelCase_   :					float			,lowerCAmelCase_   :					float				)      -> None:






						'''simple docstring'''



						if not isinstance(lowerCAmelCase_			,(int, float)				):
												raise TypeError("""Invalid velocity. Should be a positive number."""				)

						if not isinstance(lowerCAmelCase_			,(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        __a     (    lowerCAmelCase_   :					float			,lowerCAmelCase_   :					float				)      -> float:






						'''simple docstring'''



						check_args(lowerCAmelCase_			,lowerCAmelCase_				)
						UpperCAmelCase_=   angle_to_radians(2 * angle				)
						return round(init_velocity**2 * sin(lowerCAmelCase_				) / g			,2				)



def        __a     (    lowerCAmelCase_   :					float			,lowerCAmelCase_   :					float				)      -> float:






						'''simple docstring'''



						check_args(lowerCAmelCase_			,lowerCAmelCase_				)
						UpperCAmelCase_=   angle_to_radians(lowerCAmelCase_				)
						return round(init_velocity**2 * sin(lowerCAmelCase_				) ** 2 / (2 * g)			,2				)



def        __a     (    lowerCAmelCase_   :					float			,lowerCAmelCase_   :					float				)      -> float:






						'''simple docstring'''



						check_args(lowerCAmelCase_			,lowerCAmelCase_				)
						UpperCAmelCase_=   angle_to_radians(lowerCAmelCase_				)
						return round(2 * init_velocity * sin(lowerCAmelCase_				) / g			,2				)



def        __a     (    )      -> None:






						'''simple docstring'''



						UpperCAmelCase_,   UpperCAmelCase_=   25, 20
						assert horizontal_distance(lowerCAmelCase_			,lowerCAmelCase_				) == 40.97
						assert max_height(lowerCAmelCase_			,lowerCAmelCase_				) == 3.73
						assert total_time(lowerCAmelCase_			,lowerCAmelCase_				) == 1.74


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

	testmod()

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

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









from collections import OrderedDict
from typing import Any, List, Mapping, Optional

from ... import PretrainedConfig, PreTrainedTokenizer
from ...onnx import OnnxConfig, PatchingSpec
from ...utils import TensorType, is_torch_available, logging


__A				    =						logging.get_logger(__name__)

__A				    =						{
    '''microsoft/layoutlm-base-uncased''': (
        '''https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/config.json'''
    ),
    '''microsoft/layoutlm-large-uncased''': (
        '''https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/config.json'''
    ),
}






class 		lowercase						( snake_case__):






	"""simple docstring"""


	a__      :					Dict		   =							"layoutlm"




	def __init__(	self	:						List[Any]						,  __UpperCAmelCase	:						int=30_522						,  __UpperCAmelCase	:						List[Any]=768						,  __UpperCAmelCase	:						Optional[int]=12						,  __UpperCAmelCase	:						List[str]=12						,  __UpperCAmelCase	:						int=3_072						,  __UpperCAmelCase	:						str="gelu"						,  __UpperCAmelCase	:						str=0.1						,  __UpperCAmelCase	:						Any=0.1						,  __UpperCAmelCase	:						Union[str, Any]=512						,  __UpperCAmelCase	:						Any=2						,  __UpperCAmelCase	:						Any=0.02						,  __UpperCAmelCase	:						Dict=1E-12						,  __UpperCAmelCase	:						Optional[int]=0						,  __UpperCAmelCase	:						List[str]="absolute"						,  __UpperCAmelCase	:						List[Any]=True						,  __UpperCAmelCase	:						Optional[int]=1_024						,  **__UpperCAmelCase	:						int						,  )			-> Union[str, Any]:
							super().__init__(pad_token_id=__UpperCAmelCase						,  **__UpperCAmelCase     )
							UpperCAmelCase_=   vocab_size
							UpperCAmelCase_=   hidden_size
							UpperCAmelCase_=   num_hidden_layers
							UpperCAmelCase_=   num_attention_heads
							UpperCAmelCase_=   hidden_act
							UpperCAmelCase_=   intermediate_size
							UpperCAmelCase_=   hidden_dropout_prob
							UpperCAmelCase_=   attention_probs_dropout_prob
							UpperCAmelCase_=   max_position_embeddings
							UpperCAmelCase_=   type_vocab_size
							UpperCAmelCase_=   initializer_range
							UpperCAmelCase_=   layer_norm_eps
							UpperCAmelCase_=   position_embedding_type
							UpperCAmelCase_=   use_cache
							UpperCAmelCase_=   max_ad_position_embeddings






class 		lowercase						( snake_case__):






	"""simple docstring"""


	def __init__(	self	:						List[str]						,  __UpperCAmelCase	:						PretrainedConfig						,  __UpperCAmelCase	:						str = "default"						,  __UpperCAmelCase	:						List[PatchingSpec] = None						,  )			-> str:
							super().__init__(__UpperCAmelCase						,  task=__UpperCAmelCase						,  patching_specs=__UpperCAmelCase     )
							UpperCAmelCase_=   config.max_ad_position_embeddings - 1




	@property
	def   _SCREAMING_SNAKE_CASE		(	self	:						Optional[Any]     )			-> Mapping[str, Mapping[int, str]]:
							return OrderedDict(
							    [
							        ("""input_ids""", {0: """batch""", 1: """sequence"""}),
							        ("""bbox""", {0: """batch""", 1: """sequence"""}),
							        ("""attention_mask""", {0: """batch""", 1: """sequence"""}),
							        ("""token_type_ids""", {0: """batch""", 1: """sequence"""}),
							    ]     )




	def   _SCREAMING_SNAKE_CASE		(	self	:						Any						,  __UpperCAmelCase	:						PreTrainedTokenizer						,  __UpperCAmelCase	:						int = -1						,  __UpperCAmelCase	:						int = -1						,  __UpperCAmelCase	:						bool = False						,  __UpperCAmelCase	:						Optional[TensorType] = None						,  )			-> Mapping[str, Any]:
							UpperCAmelCase_=   super().generate_dummy_inputs(
							    __UpperCAmelCase						,  batch_size=__UpperCAmelCase						,  seq_length=__UpperCAmelCase						,  is_pair=__UpperCAmelCase						,  framework=__UpperCAmelCase     )

							# Generate a dummy bbox
							UpperCAmelCase_=   [48, 84, 73, 128]

							if not framework == TensorType.PYTORCH:
													raise NotImplementedError("""Exporting LayoutLM to ONNX is currently only supported for PyTorch."""     )

							if not is_torch_available():
													raise ValueError("""Cannot generate dummy inputs without PyTorch installed."""     )
							import torch

							UpperCAmelCase_,   UpperCAmelCase_=   input_dict["""input_ids"""].shape
							UpperCAmelCase_=   torch.tensor([*[box] * seq_length]     ).tile(__UpperCAmelCase						,  1						,  1     )
							return input_dict




