code: 
  
  
  
  import unittest
  
  from transformers import (
      MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
      TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
      PreTrainedTokenizer,
      is_vision_available,
  )
  from transformers.pipelines import ImageClassificationPipeline, pipeline
  from transformers.testing_utils import (
      is_pipeline_test,
      nested_simplify,
      require_tf,
      require_torch,
      require_torch_or_tf,
      require_vision,
      slow,
  )
  
  from .test_pipelines_common import ANY
  
  
  if is_vision_available():
  						from PIL import Image
  else:
  
  
  
  
  
  
  						class 	lowercase		:
  
  
  
  
  
  
  							"""simple docstring"""
  
  
  							@staticmethod
  							def 						_SCREAMING_SNAKE_CASE	(			*__UpperCAmelCase			:		Dict		,						**__UpperCAmelCase			:		Any  )    ->				Optional[int]:
  													pass
  
  
  
  
  
  
  @is_pipeline_test
  @require_torch_or_tf
  @require_vision
  class 	lowercase		(				unittest.TestCase):
  
  
  
  
  
  
  	"""simple docstring"""
  
  
  	a__   :      Union[str, Any]	     =							MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
  	a__   :      str	     =							TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
  
  
  
  
  	def 						_SCREAMING_SNAKE_CASE	(			self			:		str		,						__UpperCAmelCase			:		List[str]		,						__UpperCAmelCase			:		Optional[int]		,						__UpperCAmelCase			:		Optional[int]  )    ->				int:
  							UpperCAmelCase_=     ImageClassificationPipeline(model=__snake_case		,						image_processor=__snake_case		,						top_k=2  )
  							UpperCAmelCase_=     [
  							    Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""  ),
  							    """http://images.cocodataset.org/val2017/000000039769.jpg""",
  							]
  							return image_classifier, examples
  
  
  
  
  	def 						_SCREAMING_SNAKE_CASE	(			self			:		str		,						__UpperCAmelCase			:		List[str]		,						__UpperCAmelCase			:		Optional[int]  )    ->				Union[str, Any]:
  							UpperCAmelCase_=     image_classifier("""./tests/fixtures/tests_samples/COCO/000000039769.png"""  )
  
  							self.assertEqual(
  							    __snake_case		,						[
  							        {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							        {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							    ]		,						)
  
  							import datasets
  
  							UpperCAmelCase_=     datasets.load_dataset("""hf-internal-testing/fixtures_image_utils"""		,						"""image"""		,						split="""test"""  )
  
  							# Accepts URL + PIL.Image + lists
  							UpperCAmelCase_=     image_classifier(
  							    [
  							        Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""  ),
  							        """http://images.cocodataset.org/val2017/000000039769.jpg""",
  							        # RGBA
  							        dataset[0]["""file"""],
  							        # LA
  							        dataset[1]["""file"""],
  							        # L
  							        dataset[2]["""file"""],
  							    ]  )
  							self.assertEqual(
  							    __snake_case		,						[
  							        [
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							        ],
  							        [
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							        ],
  							        [
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							        ],
  							        [
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							        ],
  							        [
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							            {"""score""": ANY(__snake_case  ), """label""": ANY(__snake_case  )},
  							        ],
  							    ]		,						)
  
  
  
  
  	@require_torch
  	def 						_SCREAMING_SNAKE_CASE	(			self			:		Tuple  )    ->				Optional[Any]:
  							UpperCAmelCase_=     """hf-internal-testing/tiny-random-vit"""
  							UpperCAmelCase_=     pipeline("""image-classification"""		,						model=__snake_case  )
  
  							UpperCAmelCase_=     image_classifier("""http://images.cocodataset.org/val2017/000000039769.jpg"""  )
  							self.assertEqual(
  							    nested_simplify(__snake_case		,						decimals=4  )		,						[{"""label""": """LABEL_1""", """score""": 0.574}, {"""label""": """LABEL_0""", """score""": 0.426}]		,						)
  
  							UpperCAmelCase_=     image_classifier(
  							    [
  							        """http://images.cocodataset.org/val2017/000000039769.jpg""",
  							        """http://images.cocodataset.org/val2017/000000039769.jpg""",
  							    ]		,						top_k=2		,						)
  							self.assertEqual(
  							    nested_simplify(__snake_case		,						decimals=4  )		,						[
  							        [{"""label""": """LABEL_1""", """score""": 0.574}, {"""label""": """LABEL_0""", """score""": 0.426}],
  							        [{"""label""": """LABEL_1""", """score""": 0.574}, {"""label""": """LABEL_0""", """score""": 0.426}],
  							    ]		,						)
  
  
  
  
  	@require_tf
  	def 						_SCREAMING_SNAKE_CASE	(			self			:		int  )    ->				Any:
  							UpperCAmelCase_=     """hf-internal-testing/tiny-random-vit"""
  							UpperCAmelCase_=     pipeline("""image-classification"""		,						model=__snake_case		,						framework="""tf"""  )
  
  							UpperCAmelCase_=     image_classifier("""http://images.cocodataset.org/val2017/000000039769.jpg"""  )
  							self.assertEqual(
  							    nested_simplify(__snake_case		,						decimals=4  )		,						[{"""label""": """LABEL_1""", """score""": 0.574}, {"""label""": """LABEL_0""", """score""": 0.426}]		,						)
  
  							UpperCAmelCase_=     image_classifier(
  							    [
  							        """http://images.cocodataset.org/val2017/000000039769.jpg""",
  							        """http://images.cocodataset.org/val2017/000000039769.jpg""",
  							    ]		,						top_k=2		,						)
  							self.assertEqual(
  							    nested_simplify(__snake_case		,						decimals=4  )		,						[
  							        [{"""label""": """LABEL_1""", """score""": 0.574}, {"""label""": """LABEL_0""", """score""": 0.426}],
  							        [{"""label""": """LABEL_1""", """score""": 0.574}, {"""label""": """LABEL_0""", """score""": 0.426}],
  							    ]		,						)
  
  
  
  
  	def 						_SCREAMING_SNAKE_CASE	(			self			:		Tuple  )    ->				int:
  							UpperCAmelCase_=     PreTrainedTokenizer()
  
  							# Assert that the pipeline can be initialized with a feature extractor that is not in any mapping
  							UpperCAmelCase_=     pipeline(
  							    """image-classification"""		,						model="""hf-internal-testing/tiny-random-vit"""		,						tokenizer=__snake_case  )
  
  							self.assertIs(image_classifier.tokenizer		,						__snake_case  )
  
  
  
  
  	@slow
  	@require_torch
  	def 						_SCREAMING_SNAKE_CASE	(			self			:		Union[str, Any]  )    ->				Optional[int]:
  							# Perceiver is not tested by `run_pipeline_test` properly.
  							# That is because the type of feature_extractor and model preprocessor need to be kept
  							# in sync, which is not the case in the current design
  							UpperCAmelCase_=     pipeline("""image-classification"""		,						model="""deepmind/vision-perceiver-conv"""  )
  							UpperCAmelCase_=     image_classifier("""http://images.cocodataset.org/val2017/000000039769.jpg"""  )
  							self.assertEqual(
  							    nested_simplify(__snake_case		,						decimals=4  )		,						[
  							        {"""score""": 0.4_385, """label""": """tabby, tabby cat"""},
  							        {"""score""": 0.321, """label""": """tiger cat"""},
  							        {"""score""": 0.0_502, """label""": """Egyptian cat"""},
  							        {"""score""": 0.0_137, """label""": """crib, cot"""},
  							        {"""score""": 0.007, """label""": """radiator"""},
  							    ]		,						)
  
  							UpperCAmelCase_=     pipeline("""image-classification"""		,						model="""deepmind/vision-perceiver-fourier"""  )
  							UpperCAmelCase_=     image_classifier("""http://images.cocodataset.org/val2017/000000039769.jpg"""  )
  							self.assertEqual(
  							    nested_simplify(__snake_case		,						decimals=4  )		,						[
  							        {"""score""": 0.5_658, """label""": """tabby, tabby cat"""},
  							        {"""score""": 0.1_309, """label""": """tiger cat"""},
  							        {"""score""": 0.0_722, """label""": """Egyptian cat"""},
  							        {"""score""": 0.0_707, """label""": """remote control, remote"""},
  							        {"""score""": 0.0_082, """label""": """computer keyboard, keypad"""},
  							    ]		,						)
  
  							UpperCAmelCase_=     pipeline("""image-classification"""		,						model="""deepmind/vision-perceiver-learned"""  )
  							UpperCAmelCase_=     image_classifier("""http://images.cocodataset.org/val2017/000000039769.jpg"""  )
  							self.assertEqual(
  							    nested_simplify(__snake_case		,						decimals=4  )		,						[
  							        {"""score""": 0.3_022, """label""": """tabby, tabby cat"""},
  							        {"""score""": 0.2_362, """label""": """Egyptian cat"""},
  							        {"""score""": 0.1_856, """label""": """tiger cat"""},
  							        {"""score""": 0.0_324, """label""": """remote control, remote"""},
  							        {"""score""": 0.0_096, """label""": """quilt, comforter, comfort, puff"""},
  							    ]		,						)
  
  
  
  
  
style_context: 
  
  
  
  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]')
  
  
  
  
  