




'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


UpperCamelCase       			= {
    """configuration_efficientformer""": [
        """EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """EfficientFormerConfig""",
    ]
}

try:
     if not is_vision_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase       			= ["""EfficientFormerImageProcessor"""]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase       			= [
         """EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """EfficientFormerForImageClassification""",
         """EfficientFormerForImageClassificationWithTeacher""",
         """EfficientFormerModel""",
         """EfficientFormerPreTrainedModel""",
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase       			= [
         """TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """TFEfficientFormerForImageClassification""",
         """TFEfficientFormerForImageClassificationWithTeacher""",
         """TFEfficientFormerModel""",
         """TFEfficientFormerPreTrainedModel""",
     ]

if TYPE_CHECKING:
     from .configuration_efficientformer import EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientFormerConfig

     try:
          if not is_vision_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .image_processing_efficientformer import EfficientFormerImageProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_efficientformer import (
              EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              EfficientFormerForImageClassification,
              EfficientFormerForImageClassificationWithTeacher,
              EfficientFormerModel,
              EfficientFormerPreTrainedModel,
          )
     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_efficientformer import (
              TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFEfficientFormerForImageClassification,
              TFEfficientFormerForImageClassificationWithTeacher,
              TFEfficientFormerModel,
              TFEfficientFormerPreTrainedModel,
          )

else:
     import sys

     UpperCamelCase       			= _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)}''')