




'''simple docstring'''





import doctest
import logging
import os
import unittest
from pathlib import Path
from typing import List, Union

import transformers
from transformers.testing_utils import require_tf, require_torch, slow


UpperCamelCase_						:      Tuple       =						logging.getLogger()

@unittest.skip("""Temporarily disable the doc tests."""							)
@require_torch
@require_tf
@slow
class        _a    (						unittest.TestCase							):






					def     _lowercase     (			self ,_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE = None ,_SCREAMING_SNAKE_CASE = None ,_SCREAMING_SNAKE_CASE = None ,_SCREAMING_SNAKE_CASE = True ,)							->      Optional[int]:
										_snake_case							=				[file for file in os.listdir(_SCREAMING_SNAKE_CASE   ) if os.path.isfile(os.path.join(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE   )   )]

										if identifier is not None:
															_snake_case							=				[file for file in files if identifier in file]

										if n_identifier is not None:
															if isinstance(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE   ):
																				for n_ in n_identifier:
																									_snake_case							=				[file for file in files if n_ not in file]
															else:
																				_snake_case							=				[file for file in files if n_identifier not in file]

										_snake_case							=				ignore_files or []
										ignore_files.append("__init__.py"   )
										_snake_case							=				[file for file in files if file not in ignore_files]

										for file in files:
															# Open all files
															print("Testing" ,_SCREAMING_SNAKE_CASE   )

															if only_modules:
																				_snake_case							=				file.split("."   )[0]
																				try:
																									_snake_case							=				getattr(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE   )
																									_snake_case							=				doctest.DocTestSuite(_SCREAMING_SNAKE_CASE   )
																									_snake_case							=				unittest.TextTestRunner().run(_SCREAMING_SNAKE_CASE   )
																									self.assertIs(len(result.failures   ) ,0   )
																				except AttributeError:
																									logger.info(f"""{module_identifier} is not a module."""   )
															else:
																				_snake_case							=				doctest.testfile(str(".." / directory / file   ) ,optionflags=doctest.ELLIPSIS   )
																				self.assertIs(result.failed ,0   )






					def     _lowercase     (			self   )							->      List[Any]:
										_snake_case							=				Path("src/transformers"   )
										_snake_case							=				"modeling"
										_snake_case							=				[
										    "modeling_ctrl.py",
										    "modeling_tf_ctrl.py",
										]
										self.analyze_directory(_SCREAMING_SNAKE_CASE ,identifier=_SCREAMING_SNAKE_CASE ,ignore_files=_SCREAMING_SNAKE_CASE   )






					def     _lowercase     (			self   )							->      Tuple:
										_snake_case							=				Path("src/transformers"   )
										_snake_case							=				"tokenization"
										self.analyze_directory(_SCREAMING_SNAKE_CASE ,identifier=_SCREAMING_SNAKE_CASE   )






					def     _lowercase     (			self   )							->      Tuple:
										_snake_case							=				Path("src/transformers"   )
										_snake_case							=				"configuration"
										self.analyze_directory(_SCREAMING_SNAKE_CASE ,identifier=_SCREAMING_SNAKE_CASE   )






					def     _lowercase     (			self   )							->      List[Any]:
										_snake_case							=				Path("src/transformers"   )
										_snake_case							=				["configuration", "modeling", "tokenization"]
										self.analyze_directory(_SCREAMING_SNAKE_CASE ,n_identifier=_SCREAMING_SNAKE_CASE   )






					def     _lowercase     (			self   )							->      List[str]:
										_snake_case							=				Path("docs/source"   )
										_snake_case							=				["favicon.ico"]
										self.analyze_directory(_SCREAMING_SNAKE_CASE ,ignore_files=_SCREAMING_SNAKE_CASE ,only_modules=_SCREAMING_SNAKE_CASE   )








'''simple docstring'''





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





def      __a     (       _UpperCamelCase:   int   )						->			str:

     """simple docstring"""




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

     _snake_case							=				precision
     _snake_case							=				ceil(precision / 14   )
     _snake_case							=				426_880 * Decimal(10_005   ).sqrt()
     _snake_case							=				1
     _snake_case							=				13_591_409
     _snake_case							=				Decimal(_UpperCamelCase   )
     for k in range(1 ,						_UpperCamelCase   ):
          _snake_case							=				factorial(6 * k   ) // (factorial(3 * k   ) * factorial(_UpperCamelCase   ) ** 3)
          linear_term += 545_140_134
          exponential_term *= -262_537_412_640_768_000
          partial_sum += Decimal(multinomial_term * linear_term   ) / exponential_term
     return str(constant_term / partial_sum   )[:-1]


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


