'''simple docstring'''




import unittest

from transformers import AutoConfig, AutoTokenizer, BertConfig, TensorType, is_flax_available
from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER, require_flax, slow


if is_flax_available():
 import jax

 from transformers.models.auto.modeling_flax_auto import FlaxAutoModel
 from transformers.models.bert.modeling_flax_bert import FlaxBertModel
 from transformers.models.roberta.modeling_flax_roberta import FlaxRobertaModel


@require_flax
class       UpperCAmelCase__  (       unittest.TestCase			):






   """simple docstring"""
   @slow
   def 		_lowerCamelCase (self				)    ->     Optional[int]:
        for model_name in ["bert-base-cased", "bert-large-uncased"]:
             with self.subTest(_a				):
                  lowercase_					:       List[str]     				=					AutoConfig.from_pretrained(_a				)
                  self.assertIsNotNone(_a				)
                  self.assertIsInstance(_a       ,				_a				)

                  lowercase_					:       Any     				=					FlaxAutoModel.from_pretrained(_a				)
                  self.assertIsNotNone(_a				)
                  self.assertIsInstance(_a       ,				_a				)
   @slow
   def 		_lowerCamelCase (self				)    ->     int:
        for model_name in ["roberta-base", "roberta-large"]:
             with self.subTest(_a				):
                  lowercase_					:       int     				=					AutoConfig.from_pretrained(_a				)
                  self.assertIsNotNone(_a				)
                  self.assertIsInstance(_a       ,				_a				)

                  lowercase_					:       Dict     				=					FlaxAutoModel.from_pretrained(_a				)
                  self.assertIsNotNone(_a				)
                  self.assertIsInstance(_a       ,				_a				)
   @slow
   def 		_lowerCamelCase (self				)    ->     List[str]:
        for model_name in ["bert-base-cased", "bert-large-uncased"]:
             lowercase_					:       int     				=					AutoTokenizer.from_pretrained(_a				)
             lowercase_					:       List[str]     				=					FlaxBertModel.from_pretrained(_a				)
             lowercase_					:       List[Any]     				=					tokenizer('Do you support jax jitted function?'       ,				return_tensors=TensorType.JAX				)

             @jax.jit
             def eval(**_a				):
                  return model(**_a				)

             eval(**_a				).block_until_ready()
   @slow
   def 		_lowerCamelCase (self				)    ->     Union[str, Any]:
        for model_name in ["roberta-base", "roberta-large"]:
             lowercase_					:       Any     				=					AutoTokenizer.from_pretrained(_a				)
             lowercase_					:       List[Any]     				=					FlaxRobertaModel.from_pretrained(_a				)
             lowercase_					:       List[str]     				=					tokenizer('Do you support jax jitted function?'       ,				return_tensors=TensorType.JAX				)

             @jax.jit
             def eval(**_a				):
                  return model(**_a				)

             eval(**_a				).block_until_ready()
   def 		_lowerCamelCase (self				)    ->     Optional[int]:
        with self.assertRaisesRegex(
            _a       ,				'bert-base is not a local folder and is not a valid model identifier'				):
             lowercase_					:       Optional[int]     				=					FlaxAutoModel.from_pretrained('bert-base'				)
   def 		_lowerCamelCase (self				)    ->     Union[str, Any]:
        with self.assertRaisesRegex(
            _a       ,				R'aaaaaa is not a valid git identifier \(branch name, tag name or commit id\)'				):
             lowercase_					:       Optional[Any]     				=					FlaxAutoModel.from_pretrained(_a       ,				revision='aaaaaa'				)
   def 		_lowerCamelCase (self				)    ->     int:
        with self.assertRaisesRegex(
            _a       ,				'hf-internal-testing/config-no-model does not appear to have a file named flax_model.msgpack'       ,				):
             lowercase_					:       Optional[int]     				=					FlaxAutoModel.from_pretrained('hf-internal-testing/config-no-model'				)





   def 		_lowerCamelCase (self				)    ->     List[str]:
        with self.assertRaisesRegex(_a       ,				'Use `from_pt=True` to load this model'				):
             lowercase_					:       Any     				=					FlaxAutoModel.from_pretrained('hf-internal-testing/tiny-bert-pt-only'				)





'''simple docstring'''




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

def _UpperCamelCase   (       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'							)

     lowercase_					:       str     				=					precision
     lowercase_					:       List[str]     				=					ceil(precision / 14							)
     lowercase_					:       Union[str, Any]     				=					426_880 * Decimal(10_005							).sqrt()
     lowercase_					:       List[Any]     				=					1
     lowercase_					:       Optional[int]     				=					13_591_409
     lowercase_					:       Dict     				=					Decimal(SCREAMING_SNAKE_CASE_							)
     for k in range(1  ,       SCREAMING_SNAKE_CASE_							):
          lowercase_					:       List[str]     				=					factorial(6 * k							) // (factorial(3 * k							) * factorial(SCREAMING_SNAKE_CASE_							) ** 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__":
 _A								=   5_0
 print(F"""The first {n} digits of pi is: {pi(n)}""")




