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


A__       :   Any   						=					logging.get_logger(__name__)

A__       :   Any   						=					{
    """openbmb/cpm-ant-10b""": """https://huggingface.co/openbmb/cpm-ant-10b/blob/main/config.json"""
    # See all CPMAnt models at https://huggingface.co/models?filter=cpmant
}





class 						lowercase       (  __UpperCamelCase					):
					__a					=    """cpmant"""
					def __init__(		self ,	SCREAMING_SNAKE_CASE__ = 30720 ,	SCREAMING_SNAKE_CASE__ = 4096 ,	SCREAMING_SNAKE_CASE__ = 32 ,	SCREAMING_SNAKE_CASE__ = 128 ,	SCREAMING_SNAKE_CASE__ = 10240 ,	SCREAMING_SNAKE_CASE__ = 48 ,	SCREAMING_SNAKE_CASE__ = 0.0 ,	SCREAMING_SNAKE_CASE__ = 512 ,	SCREAMING_SNAKE_CASE__ = 2048 ,	SCREAMING_SNAKE_CASE__ = 1E-6 ,	SCREAMING_SNAKE_CASE__ = 1.0 ,	SCREAMING_SNAKE_CASE__ = 32 ,	SCREAMING_SNAKE_CASE__ = 32 ,	SCREAMING_SNAKE_CASE__ = 32 ,	SCREAMING_SNAKE_CASE__ = True ,	**SCREAMING_SNAKE_CASE__ ,	):
								"""simple docstring"""







								super().__init__(**SCREAMING_SNAKE_CASE__    )
								lowerCAmelCase__ :    int				      =			prompt_types
								lowerCAmelCase__ :    List[Any]				      =			prompt_length
								lowerCAmelCase__ :    Union[str, Any]				      =			segment_types
								lowerCAmelCase__ :    List[Any]				      =			hidden_size
								lowerCAmelCase__ :    Any				      =			num_attention_heads
								lowerCAmelCase__ :    Any				      =			dim_head
								lowerCAmelCase__ :    int				      =			dim_ff
								lowerCAmelCase__ :    Union[str, Any]				      =			num_hidden_layers
								lowerCAmelCase__ :    Any				      =			position_bias_num_buckets
								lowerCAmelCase__ :    Any				      =			position_bias_max_distance
								lowerCAmelCase__ :    Union[str, Any]				      =			dropout_p
								lowerCAmelCase__ :    str				      =			eps
								lowerCAmelCase__ :    Optional[Any]				      =			use_cache
								lowerCAmelCase__ :    Any				      =			vocab_size
								lowerCAmelCase__ :    int				      =			init_std





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]""")



