






"""simple docstring"""







from unittest import TestCase

from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset


class      UpperCamelCase		(__snake_case     ):






						def      __snake_case      (		self  :Tuple				)      ->str:
										return [
										    {"col_1": 3, "col_2": "a"},
										    {"col_1": 2, "col_2": "b"},
										    {"col_1": 1, "col_2": "c"},
										    {"col_1": 0, "col_2": "d"},
										]






						def      __snake_case      (		self  :Union[str, Any]				)      ->List[Any]:
										lowercase    :      Union[str, Any]       = {"""col_1""": [3, 2, 1, 0], """col_2""": ["""a""", """b""", """c""", """d"""]}
										return Dataset.from_dict(SCREAMING_SNAKE_CASE__				)






						def      __snake_case      (		self  :Tuple				)      ->Optional[int]:
										lowercase    :      Tuple       = self._create_example_records()
										lowercase    :      int       = Dataset.from_list(SCREAMING_SNAKE_CASE__				)
										self.assertListEqual(dset.column_names			, ["""col_1""", """col_2"""]				)
										for i, r in enumerate(SCREAMING_SNAKE_CASE__				):
														self.assertDictEqual(SCREAMING_SNAKE_CASE__			, example_records[i]				)






						def      __snake_case      (		self  :Optional[int]				)      ->Dict:
										lowercase    :      str       = self._create_example_records()
										lowercase    :      Optional[int]       = Dataset.from_list(SCREAMING_SNAKE_CASE__				)
										lowercase    :      int       = Dataset.from_dict({k: [r[k] for r in example_records] for k in example_records[0]}				)
										self.assertEqual(dset.info			, dset_from_dict.info				)






						def      __snake_case      (		self  :Union[str, Any]				)      ->Optional[int]:  # checks what happens with missing columns
										lowercase    :      Union[str, Any]       = [{"""col_1""": 1}, {"""col_2""": """x"""}]
										lowercase    :      Tuple       = Dataset.from_list(SCREAMING_SNAKE_CASE__				)
										self.assertDictEqual(dset[0]			, {"""col_1""": 1}				)
										self.assertDictEqual(dset[1]			, {"""col_1""": None}				)  # NB: first record is used for columns






						def      __snake_case      (		self  :Optional[Any]				)      ->Optional[Any]:  # checks if the type can be inferred from the second record
										lowercase    :      Dict       = [{"""col_1""": []}, {"""col_1""": [1, 2]}]
										lowercase    :      Union[str, Any]       = Dataset.from_list(SCREAMING_SNAKE_CASE__				)
										self.assertEqual(dset.info.features["""col_1"""]			, Sequence(Value("""int64"""				)				)				)






						def      __snake_case      (		self  :Tuple				)      ->List[str]:
										lowercase    :      Any       = Dataset.from_list([]				)
										self.assertEqual(len(SCREAMING_SNAKE_CASE__				)			, 0				)
										self.assertListEqual(dset.column_names			, []				)


from decimal import Decimal, getcontext
from math import ceil, factorial

def  __lowerCamelCase					( _lowercase			)       ->      str:

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

     UpperCamelCase						    =					precision
     UpperCamelCase						    =					ceil(precision / 14			)
     UpperCamelCase						    =					426880 * Decimal(10005			).sqrt()
     UpperCamelCase						    =					1
     UpperCamelCase						    =					13591409
     UpperCamelCase						    =					Decimal(_lowercase			)
     for k in range(1						,     _lowercase			):
          UpperCamelCase						    =					factorial(6 * k			) // (factorial(3 * k			) * factorial(_lowercase			) ** 3)
          linear_term += 545140134
          exponential_term *= -262537412640768000
          partial_sum += Decimal(multinomial_term * linear_term			) / exponential_term
     return str(constant_term / partial_sum			)[:-1]


if __name__ == "__main__":
 _snake_case      = 50
 print(F"The first {n} digits of pi is: {pi(n)}")


