code: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  import os
  from pathlib import Path
  from typing import Dict, List
  
  import fire
  import torch
  
  from transformers import AutoModelForSeqaSeqLM, AutoTokenizer
  from transformers.utils.logging import get_logger
  
  
  A_			  =    get_logger(__name__)
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
        if text.startswith(lowercase_			):
              return text[len(lowercase_			) :]
        return text  # or whatever
  
  
  
  
  def 						_UpperCamelCase			(  A			):
        return {remove_prefix(lowercase_    ,       "model."			): v for k, v in sd.items()}
  
  
  
  
  def 						_UpperCamelCase			(  A			):
        UpperCamelCase_     ={}
        for k in state_dicts[0].keys():
              UpperCamelCase_     =[sd[k] for sd in state_dicts]
              UpperCamelCase_     =sum(lowercase_			) / len(lowercase_			)
              assert isinstance(lowercase_    ,       torch.Tensor			)
              UpperCamelCase_     =new_t
        return new_sd
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A			):
        UpperCamelCase_     =AutoModelForSeqaSeqLM.from_pretrained(lowercase_			)
        if os.path.isfile(lowercase_			):
              UpperCamelCase_     =[pl_ckpt_path]
        else:
              assert os.path.isdir(lowercase_			)
              UpperCamelCase_     =list(Path(lowercase_			).glob("*.ckpt"			)			)
              assert ckpt_files, f"""could not find any ckpt files inside the {pl_ckpt_path} directory"""
  
        if len(lowercase_			) > 1:
              logger.info(f"""averaging the weights of {ckpt_files}"""			)
  
        UpperCamelCase_     =[sanitize(torch.load(lowercase_    ,       map_location="cpu"			)["state_dict"]			) for x in ckpt_files]
        UpperCamelCase_     =average_state_dicts(lowercase_			)
  
        UpperCamelCase_     =hf_model.load_state_dict(lowercase_    ,       strict=lowercase_			)
        assert not missing, f"""missing keys: {missing}"""
        hf_model.save_pretrained(lowercase_			)
        try:
              UpperCamelCase_     =AutoTokenizer.from_pretrained(lowercase_			)
              tok.save_pretrained(lowercase_			)
        except Exception:
              pass
              # dont copy tokenizer if cant
  
  
  if __name__ == "__main__":
      fire.Fire(convert_pl_to_hf)
  
style_context: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  from math import radians as angle_to_radians
  from math import sin
  
  # Acceleration Constant on Earth (unit m/s^2)
  A_			  =    9.80665
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
  
     # Ensure valid instance
     if not isinstance(A    ,       (int, float)			):
        raise TypeError("Invalid velocity. Should be a positive number."			)
  
     if not isinstance(A    ,       (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 						_UpperCamelCase			(  A    ,       A			):
     check_args(A    ,       A			)
     UpperCamelCase_     =angle_to_radians(2 * angle			)
     return round(init_velocity**2 * sin(A			) / g    ,       2			)
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
     check_args(A    ,       A			)
     UpperCamelCase_     =angle_to_radians(A			)
     return round(init_velocity**2 * sin(A			) ** 2 / (2 * g)    ,       2			)
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
     check_args(A    ,       A			)
     UpperCamelCase_     =angle_to_radians(A			)
     return round(2 * init_velocity * sin(A			) / g    ,       2			)
  
  
  
  
  def 						_UpperCamelCase			(  ):
     UpperCamelCase_    ,							UpperCamelCase_     =25, 20
     assert horizontal_distance(A    ,       A			) == 40.97
     assert max_height(A    ,       A			) == 3.73
     assert total_time(A    ,       A			) == 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]''')
  