


'''simple docstring'''

import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict

@pytest.mark.parametrize(
    '''split_dict''',				[
        SplitDict(),
        SplitDict({'''train''': SplitInfo(name='''train''',				num_bytes=1_3_3_7,				num_examples=4_2,				dataset_name='''my_dataset''')}),
        SplitDict({'''train''': SplitInfo(name='''train''',				num_bytes=1_3_3_7,				num_examples=4_2)}),
        SplitDict({'''train''': SplitInfo()}),
    ],				)
def 							__magic_name__(						lowerCamelCase):
						__lowerCAmelCase							       =				split_dict._to_yaml_list()
						assert len(lowerCamelCase) == len(lowerCamelCase)
						__lowerCAmelCase							       =				SplitDict._from_yaml_list(lowerCamelCase)
						for split_name, split_info in split_dict.items():
												# dataset_name field is deprecated, and is therefore not part of the YAML dump
												__lowerCAmelCase							       =				None
												# the split name of split_dict takes over the name of the split info object
												__lowerCAmelCase							       =				split_name
						assert split_dict == reloaded




@pytest.mark.parametrize(
    '''split_info''',				[SplitInfo(), SplitInfo(dataset_name=lowerCamelCase), SplitInfo(dataset_name='''my_dataset''')])
def 							__magic_name__(						lowerCamelCase):
						__lowerCAmelCase							       =				asdict(SplitDict({'''train''': split_info}))
						assert "dataset_name" in split_dict_asdict["train"]
						assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name





'''simple docstring'''

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

_UpperCAmelCase				: str							    =				6_37_81_37.0
_UpperCAmelCase				: Tuple							    =				6_35_67_52.31_42_45
_UpperCAmelCase				: Optional[Any]							    =				6_3_7_8_1_3_7

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase,				lowerCamelCase,				lowerCamelCase):
						__lowerCAmelCase							       =				(AXIS_A - AXIS_B) / AXIS_A
						__lowerCAmelCase							       =				atan((1 - flattening) * tan(radians(lowerCamelCase)))
						__lowerCAmelCase							       =				atan((1 - flattening) * tan(radians(lowerCamelCase)))
						__lowerCAmelCase							       =				radians(lowerCamelCase)
						__lowerCAmelCase							       =				radians(lowerCamelCase)
						# Equation
						__lowerCAmelCase							       =				sin((phi_a - phi_a) / 2)
						__lowerCAmelCase							       =				sin((lambda_a - lambda_a) / 2)
						# Square both values
						sin_sq_phi *= sin_sq_phi
						sin_sq_lambda *= sin_sq_lambda
						__lowerCAmelCase							       =				sqrt(sin_sq_phi + (cos(lowerCamelCase) * cos(lowerCamelCase) * sin_sq_lambda))
						return 2 * RADIUS * asin(lowerCamelCase)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

