
from ...configuration_utils import PretrainedConfig
from ...utils import logging


A__       :   Any   						=					logging.get_logger(__name__)

A__       :   int   						=					{
    """facebook/opt-125m""": """https://huggingface.co/facebook/opt-125m/blob/main/config.json""",
    """facebook/opt-350m""": """https://huggingface.co/facebook/opt-350m/blob/main/config.json""",
    """facebook/opt-1.3b""": """https://huggingface.co/facebook/opt-1.3b/blob/main/config.json""",
    """facebook/opt-2.7b""": """https://huggingface.co/facebook/opt-2.7b/blob/main/config.json""",
    """facebook/opt-6.7b""": """https://huggingface.co/facebook/opt-6.7b/blob/main/config.json""",
    """facebook/opt-13b""": """https://huggingface.co/facebook/opt-13b/blob/main/config.json""",
}





class 						lowercase       (  __UpperCamelCase					):
					__a					=    """opt"""
					__a					=    ["""past_key_values"""]
					def __init__(		self ,	SCREAMING_SNAKE_CASE__=50272 ,	SCREAMING_SNAKE_CASE__=768 ,	SCREAMING_SNAKE_CASE__=12 ,	SCREAMING_SNAKE_CASE__=3072 ,	SCREAMING_SNAKE_CASE__=2048 ,	SCREAMING_SNAKE_CASE__=True ,	SCREAMING_SNAKE_CASE__=False ,	SCREAMING_SNAKE_CASE__=None ,	SCREAMING_SNAKE_CASE__=0.1 ,	SCREAMING_SNAKE_CASE__=0.0 ,	SCREAMING_SNAKE_CASE__=12 ,	SCREAMING_SNAKE_CASE__="relu" ,	SCREAMING_SNAKE_CASE__=0.0 ,	SCREAMING_SNAKE_CASE__=0.02 ,	SCREAMING_SNAKE_CASE__=True ,	SCREAMING_SNAKE_CASE__=1 ,	SCREAMING_SNAKE_CASE__=2 ,	SCREAMING_SNAKE_CASE__=2 ,	SCREAMING_SNAKE_CASE__=True ,	SCREAMING_SNAKE_CASE__=True ,	**SCREAMING_SNAKE_CASE__ ,	):
								"""simple docstring"""







								super().__init__(
								    pad_token_id=SCREAMING_SNAKE_CASE__ ,	bos_token_id=SCREAMING_SNAKE_CASE__ ,	eos_token_id=SCREAMING_SNAKE_CASE__ ,	**SCREAMING_SNAKE_CASE__ ,	)
								lowerCAmelCase__ :    List[str]				      =			vocab_size
								lowerCAmelCase__ :    Optional[Any]				      =			max_position_embeddings
								lowerCAmelCase__ :    Dict				      =			num_attention_heads
								lowerCAmelCase__ :    Tuple				      =			word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
								lowerCAmelCase__ :    str				      =			ffn_dim
								lowerCAmelCase__ :    Dict				      =			hidden_size
								lowerCAmelCase__ :    Optional[Any]				      =			num_hidden_layers
								lowerCAmelCase__ :    List[str]				      =			dropout
								lowerCAmelCase__ :    List[Any]				      =			attention_dropout
								lowerCAmelCase__ :    Optional[Any]				      =			activation_function
								lowerCAmelCase__ :    int				      =			init_std
								lowerCAmelCase__ :    Optional[Any]				      =			layerdrop
								lowerCAmelCase__ :    str				      =			use_cache
								lowerCAmelCase__ :    Dict				      =			do_layer_norm_before
								# We keep these variables at `True` for backward compatibility.
								lowerCAmelCase__ :    Dict				      =			enable_bias
								lowerCAmelCase__ :    List[str]				      =			layer_norm_elementwise_affine

								# Note that the only purpose of `_remove_final_layer_norm` is to keep backward compatibility
								# with checkpoints that have been fine-tuned before transformers v4.20.1
								# see https://github.com/facebookresearch/metaseq/pull/164
								lowerCAmelCase__ :    int				      =			_remove_final_layer_norm





from math import radians as angle_to_radians
from math import sin

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



def      _a     (   __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      _a     (   __UpperCamelCase       :  float	,__UpperCamelCase       :  float    ):
			check_args(__UpperCamelCase	,__UpperCamelCase    )
			lowerCAmelCase__ :    Union[str, Any]				      =			angle_to_radians(2 * angle    )
			return round(init_velocity**2 * sin(__UpperCamelCase    ) / g	,2    )



def      _a     (   __UpperCamelCase       :  float	,__UpperCamelCase       :  float    ):
			check_args(__UpperCamelCase	,__UpperCamelCase    )
			lowerCAmelCase__ :    List[str]				      =			angle_to_radians(__UpperCamelCase    )
			return round(init_velocity**2 * sin(__UpperCamelCase    ) ** 2 / (2 * g)	,2    )



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



def      _a     (   ):
			lowerCAmelCase__      ,				lowerCAmelCase__ :    List[Any]				      =			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
							A__       :   List[Any]   						=					float(input("""Initial Velocity: """).strip())

							# Get input from user
							A__       :   Optional[Any]   						=					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]""")



