



from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
	if not (is_transformers_available() and is_torch_available() and is_transformers_version(""">=""", """4.25.0""")):
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	from ...utils.dummy_torch_and_transformers_objects import UnCLIPImageVariationPipeline, UnCLIPPipeline
else:
	from .pipeline_unclip import UnCLIPPipeline
	from .pipeline_unclip_image_variation import UnCLIPImageVariationPipeline
	from .text_proj import UnCLIPTextProjModel





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



def    _lowerCAmelCase    (_lowerCAmelCase):

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

					UpperCamelCase_		  =   precision
					UpperCamelCase_		  =   ceil(precision / 14)
					UpperCamelCase_		  =   42_68_80 * Decimal(1_00_05).sqrt()
					UpperCamelCase_		  =   1
					UpperCamelCase_		  =   13_59_14_09
					UpperCamelCase_		  =   Decimal(_lowerCAmelCase)
					for k in range(1   ,	_lowerCAmelCase):
										UpperCamelCase_		  =   factorial(6 * k) // (factorial(3 * k) * factorial(_lowerCAmelCase) ** 3)
										linear_term += 5_45_14_01_34
										exponential_term *= -26_25_37_41_26_40_76_80_00
										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)}")
