

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

from .haversine_distance import haversine_distance

SCREAMING_SNAKE_CASE_        =      637_8137.0
SCREAMING_SNAKE_CASE_        =      635_6752.31_4245
SCREAMING_SNAKE_CASE_        =      6378137

def 							__SCREAMING_SNAKE_CASE							(				lowerCAmelCase:  float  ,      lowerCAmelCase:  float  ,      lowerCAmelCase:  float  ,      lowerCAmelCase:  float )   ->       float:
				_UpperCAmelCase       :		List[str] 		=    (AXIS_A - AXIS_B) / AXIS_A
				# Parametric latitudes
				# https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
				_UpperCAmelCase       :		List[Any] 		=    atan((1 - flattening) * tan(radians(lowerCAmelCase ) ) )
				_UpperCAmelCase       :		Any 		=    atan((1 - flattening) * tan(radians(lowerCAmelCase ) ) )

				# Compute central angle between two points
				# using haversine theta. sigma =  haversine_distance / equatorial radius
				_UpperCAmelCase       :		Any 		=    haversine_distance(lowerCAmelCase  ,      lowerCAmelCase  ,      lowerCAmelCase  ,      lowerCAmelCase ) / EQUATORIAL_RADIUS

				# Intermediate P and Q values
				_UpperCAmelCase       :		Tuple 		=    (b_lata + b_lata) / 2
				_UpperCAmelCase       :		Tuple 		=    (b_lata - b_lata) / 2

				# Intermediate X value
				# X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
				_UpperCAmelCase       :		int 		=    (sin(lowerCAmelCase ) ** 2) * (cos(lowerCAmelCase ) ** 2)
				_UpperCAmelCase       :		int 		=    cos(sigma / 2 ) ** 2
				_UpperCAmelCase       :		str 		=    (sigma - sin(lowerCAmelCase )) * (x_numerator / x_demonimator)

				# Intermediate Y value
				# Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
				_UpperCAmelCase       :		Tuple 		=    (cos(lowerCAmelCase ) ** 2) * (sin(lowerCAmelCase ) ** 2)
				_UpperCAmelCase       :		Dict 		=    sin(sigma / 2 ) ** 2
				_UpperCAmelCase       :		Dict 		=    (sigma + sin(lowerCAmelCase )) * (y_numerator / y_denominator)

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


if __name__ == "__main__":
					import doctest

					doctest.testmod()





import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


SCREAMING_SNAKE_CASE_        =      '\nHugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf originally as a company that developed a chatbot app targeted at teenagers.[2] After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning.\n\nIn March 2021, Hugging Face raised $40 million in a Series B funding round.[3]\n\nOn April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model.[4] In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters.[5]\n'

class 				a  (	unittest.TestCase							, UpperCAmelCase				):


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Tuple 		=    load_tool("text-question-answering"	)
										self.tool.setup()
										_UpperCAmelCase       :		str 		=    load_tool("text-question-answering"						,					remote=A_	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[str] 		=    self.tool(A_						,					"What did Hugging Face do in April 2021?"	)
										self.assertEqual(A_						,					"launched the BigScience Research Workshop"	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Optional[Any] 		=    self.remote_tool(A_						,					"What did Hugging Face do in April 2021?"	)
										self.assertEqual(A_						,					"launched the BigScience Research Workshop"	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		int 		=    self.tool(text=A_						,					question="What did Hugging Face do in April 2021?"	)
										self.assertEqual(A_						,					"launched the BigScience Research Workshop"	)





						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[Any] 		=    self.remote_tool(text=A_						,					question="What did Hugging Face do in April 2021?"	)
										self.assertEqual(A_						,					"launched the BigScience Research Workshop"	)


