code: 
  
  
  
  import argparse
  
  import torch
  
  from transformers import HubertConfig, HubertForSequenceClassification, WavaVecaFeatureExtractor, logging
  
  
  logging.set_verbosity_info()
  __A       					=		logging.get_logger(__name__)
  
  __A       					=		['''UtteranceLevel''']
  
  
  
  @torch.no_grad()
  def  __a  (					lowerCAmelCase_     :      Optional[Any]    ,lowerCAmelCase_     :      Optional[Any]    ,lowerCAmelCase_     :      Union[str, Any]    ,lowerCAmelCase_     :      Tuple       )   ->				int:
  
  
  
  
  
  
  						'''simple docstring'''
  
  
  
  						UpperCAmelCase_=     torch.load(lowerCAmelCase_    ,map_location="""cpu"""       )
  						if checkpoint["Config"]["downstream_expert"]["modelrc"]["select"] not in SUPPORTED_MODELS:
  												raise NotImplementedError(F"""The supported s3prl models are {SUPPORTED_MODELS}"""       )
  
  						UpperCAmelCase_=     checkpoint["""Downstream"""]
  
  						UpperCAmelCase_=     HubertConfig.from_pretrained(lowerCAmelCase_       )
  						UpperCAmelCase_=     HubertForSequenceClassification.from_pretrained(lowerCAmelCase_    ,config=lowerCAmelCase_       )
  						UpperCAmelCase_=     WavaVecaFeatureExtractor.from_pretrained(
  						    lowerCAmelCase_    ,return_attention_mask=lowerCAmelCase_    ,do_normalize=lowerCAmelCase_       )
  
  						if hf_congfig.use_weighted_layer_sum:
  												UpperCAmelCase_=     checkpoint["""Featurizer"""]["""weights"""]
  
  						UpperCAmelCase_=     downstream_dict["""projector.weight"""]
  						UpperCAmelCase_=     downstream_dict["""projector.bias"""]
  						UpperCAmelCase_=     downstream_dict["""model.post_net.linear.weight"""]
  						UpperCAmelCase_=     downstream_dict["""model.post_net.linear.bias"""]
  
  						hf_feature_extractor.save_pretrained(lowerCAmelCase_       )
  						hf_model.save_pretrained(lowerCAmelCase_       )
  
  
  if __name__ == "__main__":
  						__A       					=		argparse.ArgumentParser()
  						parser.add_argument(
  						    '''--base_model_name''', default=None, type=str, help='''Name of the huggingface pretrained base model.'''
  						)
  						parser.add_argument('''--config_path''', default=None, type=str, help='''Path to the huggingface classifier config.''')
  						parser.add_argument('''--checkpoint_path''', default=None, type=str, help='''Path to the s3prl checkpoint.''')
  						parser.add_argument('''--model_dump_path''', default=None, type=str, help='''Path to the final converted model.''')
  						__A       					=		parser.parse_args()
  						convert_saprl_checkpoint(args.base_model_name, args.config_path, args.checkpoint_path, args.model_dump_path)
  
  
  
  
  
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]')
  
  
  
  
  