



'''simple docstring'''






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

from .haversine_distance import haversine_distance

lowerCAmelCase:   str					=		637_8137.0
lowerCAmelCase:   str					=		635_6752.31_4245
lowerCAmelCase:   Optional[int]					=		6_3_7_8_1_3_7
def  lowerCamelCase__			(		_A					,     _A					,     _A					,     _A							):
  a		:   Dict	  =	(AXIS_A - AXIS_B) / AXIS_A
  # Parametric latitudes
  # https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
  a		:   Dict	  =	atan((1 - flattening) * tan(radians(_A							)							)							)
  a		:   Dict	  =	atan((1 - flattening) * tan(radians(_A							)							)							)

  # Compute central angle between two points
  # using haversine theta. sigma =  haversine_distance / equatorial radius
  a		:   Optional[Any]	  =	haversine_distance(_A					,     _A					,     _A					,     _A							) / EQUATORIAL_RADIUS

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

  # Intermediate X value
  # X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
  a		:   List[Any]	  =	(sin(_A							) ** 2) * (cos(_A							) ** 2)
  a		:   Tuple	  =	cos(sigma / 2							) ** 2
  a		:   List[Any]	  =	(sigma - sin(_A							)) * (x_numerator / x_demonimator)

  # Intermediate Y value
  # Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
  a		:   int	  =	(cos(_A							) ** 2) * (sin(_A							) ** 2)
  a		:   Tuple	  =	sin(sigma / 2							) ** 2
  a		:   Optional[Any]	  =	(sigma + sin(_A							)) * (y_numerator / y_denominator)

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


if __name__ == "__main__":
     import doctest

     doctest.testmod()




'''simple docstring'''






from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCAmelCase:   Optional[int]					=		logging.get_logger(__name__)

lowerCAmelCase:   int					=		{'ctrl': 'https://huggingface.co/ctrl/resolve/main/config.json'}

class 				a__(   lowerCamelCase__      ):
    lowercase__					=       """ctrl"""
    lowercase__					=       ["""past_key_values"""]
    lowercase__					=       {
        """max_position_embeddings""": """n_positions""",
        """hidden_size""": """n_embd""",
        """num_attention_heads""": """n_head""",
        """num_hidden_layers""": """n_layer""",
    }







    def __init__( self					:    Optional[int]		,     __snake_case					:    Union[str, Any]=24_65_34		,     __snake_case					:    Dict=2_56		,     __snake_case					:    Optional[int]=12_80		,     __snake_case					:    Optional[int]=81_92		,     __snake_case					:    Union[str, Any]=48		,     __snake_case					:    str=16		,     __snake_case					:    Any=0.1		,     __snake_case					:    List[Any]=0.1		,     __snake_case					:    str=1e-6		,     __snake_case					:    List[str]=0.02		,     __snake_case					:    int=True		,     **__snake_case					:    Any		,     ):
      a		:   int	  =	vocab_size
      a		:   Union[str, Any]	  =	n_positions
      a		:   Optional[int]	  =	n_embd
      a		:   Dict	  =	n_layer
      a		:   Union[str, Any]	  =	n_head
      a		:   Tuple	  =	dff
      a		:   Union[str, Any]	  =	resid_pdrop
      a		:   Tuple	  =	embd_pdrop
      a		:   int	  =	layer_norm_epsilon
      a		:   str	  =	initializer_range

      a		:   Any	  =	use_cache

      super().__init__(**__snake_case      )