
"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase_							=					{
    'configuration_blip_2': [
        'BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'Blip2Config',
        'Blip2QFormerConfig',
        'Blip2VisionConfig',
    ],
    'processing_blip_2': ['Blip2Processor'],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase_							=					[
          'BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST',
          'Blip2Model',
          'Blip2QFormerModel',
          'Blip2PreTrainedModel',
          'Blip2ForConditionalGeneration',
          'Blip2VisionModel',
      ]

if TYPE_CHECKING:
      from .configuration_blip_a import (
          BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP,
          BlipaConfig,
          BlipaQFormerConfig,
          BlipaVisionConfig,
      )
      from .processing_blip_a import BlipaProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_blip_a import (
                BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST,
                BlipaForConditionalGeneration,
                BlipaModel,
                BlipaPreTrainedModel,
                BlipaQFormerModel,
                BlipaVisionModel,
            )

else:
      import sys

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


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


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):

						if not isinstance(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
												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_   =	426880 * Decimal(10005       ).sqrt()
						snake_case_   =	1
						snake_case_   =	13591409
						snake_case_   =	Decimal(SCREAMING_SNAKE_CASE__       )
						for k in range(1  ,		SCREAMING_SNAKE_CASE__       ):
												snake_case_   =	factorial(6 * k       ) // (factorial(3 * k       ) * factorial(SCREAMING_SNAKE_CASE__       ) ** 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__":
					lowerCAmelCase_       	=	50
					print(f"""The first {n} digits of pi is: {pi(n)}""")