from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__a  :     int       =  {
    """configuration_trajectory_transformer""": [
        """TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """TrajectoryTransformerConfig""",
    ],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__a  :     Any       =  [
		    """TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """TrajectoryTransformerModel""",
		    """TrajectoryTransformerPreTrainedModel""",
		    """load_tf_weights_in_trajectory_transformer""",
		]


if TYPE_CHECKING:
		from .configuration_trajectory_transformer import (
		    TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    TrajectoryTransformerConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_trajectory_transformer import (
				    TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TrajectoryTransformerModel,
				    TrajectoryTransformerPreTrainedModel,
				    load_tf_weights_in_trajectory_transformer,
				)


else:
		import sys

		__a  :     int       =  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
from decimal import Decimal, getcontext
from math import ceil, factorial





def 				UpperCAmelCase						(    lowercase							):







				"""simple docstring"""



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

				__lowercase 			=							precision
				__lowercase 			=							ceil(precision / 14							)
				__lowercase 			=							426880 * Decimal(10005							).sqrt()
				__lowercase 			=							1
				__lowercase 			=							13591409
				__lowercase 			=							Decimal(lowercase							)
				for k in range(1							,			lowercase							):
								__lowercase 			=							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__":
		__a  :     Optional[Any]       =  5_0
		print(F'''The first {n} digits of pi is: {pi(n)}''')