






'''simple docstring'''



import copy
import random

from transformers import CLIPTokenizer





class _UpperCamelCase		(     A		):





				'''simple docstring'''





				def __init__(							self  :  Optional[int]  ,       *_lowerCAmelCase  :  Union[str, Any]  ,       **_lowerCAmelCase  :  Any):







											'''simple docstring'''

											super().__init__(*_lowerCAmelCase  ,       **_lowerCAmelCase)
											__lowercase       	={}

				def 				__lowerCamelCase     (							self  :  Optional[int]  ,       _lowerCAmelCase  :  Dict  ,       *_lowerCAmelCase  :  Tuple  ,       **_lowerCAmelCase  :  str):







											'''simple docstring'''

											__lowercase       	=super().add_tokens(_lowerCAmelCase  ,       *_lowerCAmelCase  ,       **_lowerCAmelCase)
											if num_added_tokens == 0:
																		raise ValueError(
																		    f"""The tokenizer already contains the token {placeholder_token}. Please pass a different"""
																		    ' `placeholder_token` that is not already in the tokenizer.')

				def 				__lowerCamelCase     (							self  :  str  ,       _lowerCAmelCase  :  Optional[Any]  ,       *_lowerCAmelCase  :  Any  ,       _lowerCAmelCase  :  Tuple=1  ,       **_lowerCAmelCase  :  Union[str, Any]):







											'''simple docstring'''

											__lowercase       	=[]
											if num_vec_per_token == 1:
																		self.try_adding_tokens(_lowerCAmelCase  ,       *_lowerCAmelCase  ,       **_lowerCAmelCase)
																		output.append(_lowerCAmelCase)
											else:
																		__lowercase       	=[]
																		for i in range(_lowerCAmelCase):
																									__lowercase       	=placeholder_token + f"""_{i}"""
																									self.try_adding_tokens(_lowerCAmelCase  ,       *_lowerCAmelCase  ,       **_lowerCAmelCase)
																									output.append(_lowerCAmelCase)
        # handle cases where there is a new placeholder token that contains the current placeholder token but is larger
											for token in self.token_map:
																		if token in placeholder_token:
																									raise ValueError(
																									    f"""The tokenizer already has placeholder token {token} that can get confused with"""
																									    f""" {placeholder_token}keep placeholder tokens independent""")
											__lowercase       	=output

				def 				__lowerCamelCase     (							self  :  Optional[int]  ,       _lowerCAmelCase  :  Dict  ,       _lowerCAmelCase  :  Optional[Any]=False  ,       _lowerCAmelCase  :  Optional[Any]=1.0):







											'''simple docstring'''

											if isinstance(_lowerCAmelCase  ,       _lowerCAmelCase):
																		__lowercase       	=[]
																		for i in range(len(_lowerCAmelCase)):
																									output.append(self.replace_placeholder_tokens_in_text(text[i]  ,       vector_shuffle=_lowerCAmelCase))
																		return output
											for placeholder_token in self.token_map:
																		if placeholder_token in text:
																									__lowercase       	=self.token_map[placeholder_token]
																									__lowercase       	=tokens[: 1 + int(len(_lowerCAmelCase) * prop_tokens_to_load)]
																									if vector_shuffle:
																																__lowercase       	=copy.copy(_lowerCAmelCase)
																																random.shuffle(_lowerCAmelCase)
																									__lowercase       	=text.replace(_lowerCAmelCase  ,       ' '.join(_lowerCAmelCase))
											return text

				def __call__(							self  :  List[Any]  ,       _lowerCAmelCase  :  Optional[Any]  ,       *_lowerCAmelCase  :  Optional[Any]  ,       _lowerCAmelCase  :  str=False  ,       _lowerCAmelCase  :  List[str]=1.0  ,       **_lowerCAmelCase  :  Any):







											'''simple docstring'''

											return super().__call__(
											    self.replace_placeholder_tokens_in_text(
											        _lowerCAmelCase  ,       vector_shuffle=_lowerCAmelCase  ,       prop_tokens_to_load=_lowerCAmelCase)  ,       *_lowerCAmelCase  ,       **_lowerCAmelCase  ,       )

				def 				__lowerCamelCase     (							self  :  Tuple  ,       _lowerCAmelCase  :  Optional[int]  ,       *_lowerCAmelCase  :  List[str]  ,       _lowerCAmelCase  :  Optional[int]=False  ,       _lowerCAmelCase  :  Optional[int]=1.0  ,       **_lowerCAmelCase  :  str):







											'''simple docstring'''

											return super().encode(
											    self.replace_placeholder_tokens_in_text(
											        _lowerCAmelCase  ,       vector_shuffle=_lowerCAmelCase  ,       prop_tokens_to_load=_lowerCAmelCase)  ,       *_lowerCAmelCase  ,       **_lowerCAmelCase  ,       )








'''simple docstring'''



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



def   _A       (   _lowerCAmelCase					):



							"""simple docstring"""



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

							__lowercase       	=precision
							__lowercase       	=ceil(precision / 14					)
							__lowercase       	=426_880 * Decimal(10_005					).sqrt()
							__lowercase       	=1
							__lowercase       	=13_591_409
							__lowercase       	=Decimal(_lowerCAmelCase					)
							for k in range(1  ,   _lowerCAmelCase					):
														__lowercase       	=factorial(6 * k					) // (factorial(3 * k					) * factorial(_lowerCAmelCase					) ** 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__":
		lowerCamelCase	 =       50
		print(f"The first {n} digits of pi is: {pi(n)}")



