"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE									=						{
    """configuration_xmod""": [
        """XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """XmodConfig""",
        """XmodOnnxConfig""",
    ],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						SCREAMING_SNAKE_CASE									=						[
						    """XMOD_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """XmodForCausalLM""",
						    """XmodForMaskedLM""",
						    """XmodForMultipleChoice""",
						    """XmodForQuestionAnswering""",
						    """XmodForSequenceClassification""",
						    """XmodForTokenClassification""",
						    """XmodModel""",
						    """XmodPreTrainedModel""",
						]

if TYPE_CHECKING:
						from .configuration_xmod import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP, XmodConfig, XmodOnnxConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_xmod import (
												    XMOD_PRETRAINED_MODEL_ARCHIVE_LIST,
												    XmodForCausalLM,
												    XmodForMaskedLM,
												    XmodForMultipleChoice,
												    XmodForQuestionAnswering,
												    XmodForSequenceClassification,
												    XmodForTokenClassification,
												    XmodModel,
												    XmodPreTrainedModel,
												)

else:
						import sys

						SCREAMING_SNAKE_CASE									=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




"""simple docstring"""







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


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





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

	_lowercase :    Optional[Any]							=							precision
	_lowercase :    Dict							=							ceil(precision / 14			)
	_lowercase :    int							=							426_880 * Decimal(10_005			).sqrt()
	_lowercase :    Optional[Any]							=							1
	_lowercase :    Union[str, Any]							=							13_591_409
	_lowercase :    Optional[int]							=							Decimal(__UpperCAmelCase			)
	for k in range(1     ,__UpperCAmelCase			):
		_lowercase :    List[str]							=							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__":
						SCREAMING_SNAKE_CASE									=						50
						print(f"""The first {n} digits of pi is: {pi(n)}""")



