
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A__       :   List[Any]   						=					logging.get_logger(__name__)

A__       :   Union[str, Any]   						=					{
    'MBZUAI/swiftformer-xs': 'https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json',
}





class 						lowercase       (  __UpperCamelCase					):
					__a					=    """swiftformer"""
					def __init__(		self ,	SCREAMING_SNAKE_CASE__=3 ,	SCREAMING_SNAKE_CASE__=[3, 3, 6, 4] ,	SCREAMING_SNAKE_CASE__=[48, 56, 112, 220] ,	SCREAMING_SNAKE_CASE__=4 ,	SCREAMING_SNAKE_CASE__=[True, True, True, True] ,	SCREAMING_SNAKE_CASE__="gelu" ,	SCREAMING_SNAKE_CASE__=3 ,	SCREAMING_SNAKE_CASE__=2 ,	SCREAMING_SNAKE_CASE__=1 ,	SCREAMING_SNAKE_CASE__=0.0 ,	SCREAMING_SNAKE_CASE__=True ,	SCREAMING_SNAKE_CASE__=1E-5 ,	SCREAMING_SNAKE_CASE__=1E-5 ,	**SCREAMING_SNAKE_CASE__ ,	):
								"""simple docstring"""







								super().__init__(**SCREAMING_SNAKE_CASE__    )
								lowerCAmelCase__ :    List[str]				      =			num_channels
								lowerCAmelCase__ :    Optional[Any]				      =			depths
								lowerCAmelCase__ :    Optional[Any]				      =			embed_dims
								lowerCAmelCase__ :    Tuple				      =			mlp_ratio
								lowerCAmelCase__ :    List[str]				      =			downsamples
								lowerCAmelCase__ :    List[str]				      =			hidden_act
								lowerCAmelCase__ :    Optional[int]				      =			down_patch_size
								lowerCAmelCase__ :    List[str]				      =			down_stride
								lowerCAmelCase__ :    str				      =			down_pad
								lowerCAmelCase__ :    List[Any]				      =			drop_path_rate
								lowerCAmelCase__ :    Any				      =			use_layer_scale
								lowerCAmelCase__ :    Optional[Any]				      =			layer_scale_init_value
								lowerCAmelCase__ :    Dict				      =			batch_norm_eps





class 						lowercase       (  __UpperCamelCase					):
					__a					=    version.parse("""1.11"""					)
					@property
					def lowercase_			(		self    ):
								"""simple docstring"""







								return OrderedDict(
								    [
								        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
								    ]    )
					@property
					def lowercase_			(		self    ):
								"""simple docstring"""







								return 1E-4





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



