






'''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 	_a(					UpperCamelCase__			:  SplitDict							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			Optional[int]													=split_dict._to_yaml_list()
      assert len(UpperCamelCase__							) == len(UpperCamelCase__							)
      SCREAMING_SNAKE_CASE__       :			int													=SplitDict._from_yaml_list(UpperCamelCase__							)
      for split_name, split_info in split_dict.items():
            # dataset_name field is deprecated, and is therefore not part of the YAML dump
            SCREAMING_SNAKE_CASE__       :			Tuple													=None
            # the split name of split_dict takes over the name of the split info object
            SCREAMING_SNAKE_CASE__       :			str													=split_name
      assert split_dict == reloaded







@pytest.mark.parametrize(
    '''split_info''',		[SplitInfo(), SplitInfo(dataset_name=UpperCamelCase__							), SplitInfo(dataset_name='''my_dataset'''							)]							)
def 	_a(					UpperCamelCase__			:  List[Any]							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			str													=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 decimal import Decimal, getcontext
from math import ceil, factorial





def 	_a(					UpperCamelCase__			:  int							):




      '''simple docstring'''






      if not isinstance(UpperCamelCase__,		UpperCamelCase__							):
            raise TypeError('''Undefined for non-integers'''							)
      elif precision < 1:
            raise ValueError('''Undefined for non-natural numbers'''							)

      SCREAMING_SNAKE_CASE__       :			Optional[Any]													=precision
      SCREAMING_SNAKE_CASE__       :			int													=ceil(precision / 1_4							)
      SCREAMING_SNAKE_CASE__       :			int													=4_2_6_8_8_0 * Decimal(1_0_0_0_5							).sqrt()
      SCREAMING_SNAKE_CASE__       :			Tuple													=1
      SCREAMING_SNAKE_CASE__       :			Any													=1_3_5_9_1_4_0_9
      SCREAMING_SNAKE_CASE__       :			List[Any]													=Decimal(UpperCamelCase__							)
      for k in range(1,		UpperCamelCase__							):
            SCREAMING_SNAKE_CASE__       :			str													=factorial(6 * k							) // (factorial(3 * k							) * factorial(UpperCamelCase__							) ** 3)
            linear_term += 5_4_5_1_4_0_1_3_4
            exponential_term *= -2_6_2_5_3_7_4_1_2_6_4_0_7_6_8_0_0_0
            partial_sum += Decimal(multinomial_term * linear_term							) / exponential_term
      return str(constant_term / partial_sum							)[:-1]


if __name__ == "__main__":
  a_					=	5_0
  print(F'''The first {n} digits of pi is: {pi(n)}''')