
"""simple docstring"""







import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils import AddedToken
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_mpnet import MPNetTokenizer


lowercase_						    =					logging.get_logger(__name__)

lowercase_						    =					{"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

lowercase_						    =					{
    "vocab_file": {
        "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/vocab.txt",
    },
    "tokenizer_file": {
        "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/tokenizer.json",
    },
}

lowercase_						    =					{
    "microsoft/mpnet-base": 512,
}

lowercase_						    =					{
    "microsoft/mpnet-base": {"do_lower_case": True},
}



class 		UpperCAmelCase_	(lowerCamelCase_						):
 """simple docstring"""




 UpperCamelCase_						:     List[Any]				   =    VOCAB_FILES_NAMES
 UpperCamelCase_						:     Union[str, Any]				   =    PRETRAINED_VOCAB_FILES_MAP
 UpperCamelCase_						:     Union[str, Any]				   =    PRETRAINED_INIT_CONFIGURATION
 UpperCamelCase_						:     str				   =    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 UpperCamelCase_						:     Union[str, Any]				   =    MPNetTokenizer
 UpperCamelCase_						:     Optional[Any]				   =    ["""input_ids""", """attention_mask"""]




 def __init__( self       : Tuple     ,   a_       : Union[str, Any]=None     ,   a_       : Union[str, Any]=None     ,   a_       : Optional[int]=True     ,   a_       : str="<s>"     ,   a_       : int="</s>"     ,   a_       : Union[str, Any]="</s>"     ,   a_       : List[str]="<s>"     ,   a_       : List[str]="[UNK]"     ,   a_       : str="<pad>"     ,   a_       : Optional[int]="<mask>"     ,   a_       : Dict=True     ,   a_       : Union[str, Any]=None     ,   **a_       : Optional[Any]     ,   )->					Optional[Any]:



      """simple docstring"""

      super().__init__(
          a_     ,   tokenizer_file=a_     ,   do_lower_case=a_     ,   bos_token=a_     ,   eos_token=a_     ,   sep_token=a_     ,   cls_token=a_     ,   unk_token=a_     ,   pad_token=a_     ,   mask_token=a_     ,   tokenize_chinese_chars=a_     ,   strip_accents=a_     ,   **a_     ,   )

      UpperCAmelCase_						:    Union[str, Any]    					=  json.loads(self.backend_tokenizer.normalizer.__getstate__() )
      if (
          pre_tok_state.get("""lowercase"""     ,   a_ ) != do_lower_case
          or pre_tok_state.get("""strip_accents"""     ,   a_ ) != strip_accents
      ):
           UpperCAmelCase_						:    List[Any]    					=  getattr(a_     ,   pre_tok_state.pop("""type""" ) )
           UpperCAmelCase_						:    Optional[int]    					=  do_lower_case
           UpperCAmelCase_						:    Any    					=  strip_accents
           UpperCAmelCase_						:    List[Any]    					=  pre_tok_class(**a_ )

      UpperCAmelCase_						:    Optional[int]    					=  do_lower_case




 @property
 def   a      ( self       : List[Any] )->					str:



      """simple docstring"""

      if self._mask_token is None:
           if self.verbose:
                logger.error("""Using mask_token, but it is not set yet.""" )
           return None
      return str(self._mask_token )




 @mask_token.setter
 def   a      ( self       : Any     ,   a_       : Optional[int] )->					str:



      """simple docstring"""

      UpperCAmelCase_						:    Dict    					=  AddedToken(a_     ,   lstrip=a_     ,   rstrip=a_ ) if isinstance(a_     ,   a_ ) else value
      UpperCAmelCase_						:    Optional[Any]    					=  value




 def   a      ( self       : List[str]     ,   a_       : Dict     ,   a_       : List[str]=None )->					Optional[int]:



      """simple docstring"""

      UpperCAmelCase_						:    List[str]    					=  [self.bos_token_id] + token_ids_a + [self.eos_token_id]
      if token_ids_a is None:
           return output

      return output + [self.eos_token_id] + token_ids_a + [self.eos_token_id]




 def   a      ( self       : List[str]     ,   a_       : List[int]     ,   a_       : Optional[List[int]] = None )->					List[int]:



      """simple docstring"""

      UpperCAmelCase_						:    List[str]    					=  [self.sep_token_id]
      UpperCAmelCase_						:    Dict    					=  [self.cls_token_id]

      if token_ids_a is None:
           return len(cls + token_ids_a + sep ) * [0]
      return len(cls + token_ids_a + sep + sep + token_ids_a + sep ) * [0]






 def   a      ( self       : Union[str, Any]     ,   a_       : str     ,   a_       : Optional[str] = None )->					Tuple[str]:



      """simple docstring"""

      UpperCAmelCase_						:    Dict    					=  self._tokenizer.model.save(a_     ,   name=a_ )
      return tuple(a_ )



"""simple docstring"""







from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
lowercase_						    =					9.8_0665




def 			A_			(					lowercase						, lowercase      )     ->							None:


     """simple docstring"""







     if not isinstance(lowercase						, (int, float)      ):
          raise TypeError("""Invalid velocity. Should be a positive number."""      )

     if not isinstance(lowercase						, (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_			(					lowercase						, lowercase      )     ->							float:


     """simple docstring"""







     check_args(lowercase						, lowercase      )
     UpperCAmelCase_						:    Any    					=  angle_to_radians(2 * angle      )
     return round(init_velocity**2 * sin(lowercase      ) / g						, 2      )




def 			A_			(					lowercase						, lowercase      )     ->							float:


     """simple docstring"""







     check_args(lowercase						, lowercase      )
     UpperCAmelCase_						:    Union[str, Any]    					=  angle_to_radians(lowercase      )
     return round(init_velocity**2 * sin(lowercase      ) ** 2 / (2 * g)						, 2      )




def 			A_			(					lowercase						, lowercase      )     ->							float:


     """simple docstring"""







     check_args(lowercase						, lowercase      )
     UpperCAmelCase_						:    Optional[int]    					=  angle_to_radians(lowercase      )
     return round(2 * init_velocity * sin(lowercase      ) / g						, 2      )




def 			A_			(					)     ->							None:


     """simple docstring"""







     UpperCAmelCase_					,UpperCAmelCase_						:    Optional[int]    					=  25, 20
     assert horizontal_distance(lowercase						, lowercase      ) == 40.97
     assert max_height(lowercase						, lowercase      ) == 3.73
     assert total_time(lowercase						, lowercase      ) == 1.74


if __name__ == "__main__":
       from doctest import testmod

       testmod()

       # Get input from user
       lowercase_						    =					float(input("Initial Velocity: ").strip())

       # Get input from user
       lowercase_						    =					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]""")

