





from math import atan, cos, radians, sin, tan

from .haversine_distance import haversine_distance

__lowerCamelCase :  str										=  637_8137.0
__lowerCamelCase :  List[Any]										=  635_6752.31_4245
__lowerCamelCase :  int										=  637_8137



def 	A_       (  _lowerCAmelCase							,     _lowerCAmelCase							,     _lowerCAmelCase							,     _lowerCAmelCase  )		->				Union[str, Any]:
 UpperCamelCase			:      Dict 			=     (AXIS_A - AXIS_B) / AXIS_A
 # Parametric latitudes
 # https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
 UpperCamelCase			:      Union[str, Any] 			=     atan((1 - flattening) * tan(radians(SCREAMING_SNAKE_CASE__  )  )  )
 UpperCamelCase			:      List[Any] 			=     atan((1 - flattening) * tan(radians(SCREAMING_SNAKE_CASE__  )  )  )

 # Compute central angle between two points
 # using haversine theta. sigma =  haversine_distance / equatorial radius
 UpperCamelCase			:      Union[str, Any] 			=     haversine_distance(SCREAMING_SNAKE_CASE__							,     SCREAMING_SNAKE_CASE__							,     SCREAMING_SNAKE_CASE__							,     SCREAMING_SNAKE_CASE__  ) / EQUATORIAL_RADIUS

 # Intermediate P and Q values
 UpperCamelCase			:      Union[str, Any] 			=     (b_lata + b_lata) / 2
 UpperCamelCase			:      Optional[int] 			=     (b_lata - b_lata) / 2

 # Intermediate X value
 # X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
 UpperCamelCase			:      int 			=     (sin(SCREAMING_SNAKE_CASE__  ) ** 2) * (cos(SCREAMING_SNAKE_CASE__  ) ** 2)
 UpperCamelCase			:      Optional[Any] 			=     cos(sigma / 2  ) ** 2
 UpperCamelCase			:      Optional[Any] 			=     (sigma - sin(SCREAMING_SNAKE_CASE__  )) * (x_numerator / x_demonimator)

 # Intermediate Y value
 # Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
 UpperCamelCase			:      Optional[int] 			=     (cos(SCREAMING_SNAKE_CASE__  ) ** 2) * (sin(SCREAMING_SNAKE_CASE__  ) ** 2)
 UpperCamelCase			:      List[str] 			=     sin(sigma / 2  ) ** 2
 UpperCamelCase			:      Optional[Any] 			=     (sigma + sin(SCREAMING_SNAKE_CASE__  )) * (y_numerator / y_denominator)

 return EQUATORIAL_RADIUS * (sigma - ((flattening / 2) * (x_value + y_value)))


if __name__ == "__main__":
      import doctest

      doctest.testmod()







from typing import List, Optional

from tokenizers import ByteLevelBPETokenizer

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_blenderbot_small import BlenderbotSmallTokenizer


__lowerCamelCase :  Dict										=  logging.get_logger(__name__)

__lowerCamelCase :  Union[str, Any]										=  {
    """vocab_file""": """vocab.json""",
    """merges_file""": """merges.txt""",
    """tokenizer_config_file""": """tokenizer_config.json""",
}

__lowerCamelCase :  Dict										=  {
    """vocab_file""": {
        """facebook/blenderbot_small-90M""": """https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/vocab.json"""
    },
    """merges_file""": {
        """facebook/blenderbot_small-90M""": """https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/merges.txt"""
    },
    """tokenizer_config_file""": {
        """facebook/blenderbot_small-90M""": (
            """https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/tokenizer_config.json"""
        )
    },
}

__lowerCamelCase :  Tuple										=  {
    """facebook/blenderbot_small-90M""": 512,
}



class       A__     ( __snake_case    ):
      _UpperCAmelCase			:Union[str, Any]							=     VOCAB_FILES_NAMES
      _UpperCAmelCase			:Dict							=     PRETRAINED_VOCAB_FILES_MAP
      _UpperCAmelCase			:List[Any]							=     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      _UpperCAmelCase			:Optional[Any]							=     BlenderbotSmallTokenizer





      def __init__(				self ,							A_=None ,							A_=None ,							A_="<|endoftext|>" ,							A_="<|endoftext|>" ,							A_="<|endoftext|>" ,							A_=False ,							A_=True ,							**A_ ,							):
       '''simple docstring'''




       super().__init__(
           ByteLevelBPETokenizer(
               vocab=A_ ,							merges=A_ ,							add_prefix_space=A_ ,							trim_offsets=A_ ,							) ,							bos_token=A_ ,							eos_token=A_ ,							unk_token=A_ ,							**A_ ,							)
       UpperCamelCase			:      Union[str, Any] 			=     add_prefix_space





      def  __UpperCamelCase(				self ,							A_ ,							A_=None     ):
       '''simple docstring'''




       UpperCamelCase			:      Dict 			=     [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  __UpperCamelCase(				self ,							A_ ,							A_ = None     ):
       '''simple docstring'''




       UpperCamelCase			:      Tuple 			=     [self.sep_token_id]
       UpperCamelCase			:      int 			=     [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]
