



'''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  SCREAMING_SNAKE_CASE (  unittest.TestCase		):






    """simple docstring"""





    @slow
    def  A       (  self      :					Optional[int] ):


       """simple docstring"""







       for model_name in ["bert-base-cased", "bert-large-uncased"]:
          with self.subTest(UpperCamelCase__ ):
             UpperCamelCase					=  AutoConfig.from_pretrained(UpperCamelCase__ )
             self.assertIsNotNone(UpperCamelCase__ )
             self.assertIsInstance(UpperCamelCase__  ,						UpperCamelCase__ )

             UpperCamelCase					=  FlaxAutoModel.from_pretrained(UpperCamelCase__ )
             self.assertIsNotNone(UpperCamelCase__ )
             self.assertIsInstance(UpperCamelCase__  ,						UpperCamelCase__ )






    @slow
    def  A       (  self      :					List[Any] ):


       """simple docstring"""







       for model_name in ["roberta-base", "roberta-large"]:
          with self.subTest(UpperCamelCase__ ):
             UpperCamelCase					=  AutoConfig.from_pretrained(UpperCamelCase__ )
             self.assertIsNotNone(UpperCamelCase__ )
             self.assertIsInstance(UpperCamelCase__  ,						UpperCamelCase__ )

             UpperCamelCase					=  FlaxAutoModel.from_pretrained(UpperCamelCase__ )
             self.assertIsNotNone(UpperCamelCase__ )
             self.assertIsInstance(UpperCamelCase__  ,						UpperCamelCase__ )






    @slow
    def  A       (  self      :					Union[str, Any] ):


       """simple docstring"""







       for model_name in ["bert-base-cased", "bert-large-uncased"]:
          UpperCamelCase					=  AutoTokenizer.from_pretrained(UpperCamelCase__ )
          UpperCamelCase					=  FlaxBertModel.from_pretrained(UpperCamelCase__ )
          UpperCamelCase					=  tokenizer('Do you support jax jitted function?'  ,						return_tensors=TensorType.JAX )

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

          eval(**UpperCamelCase__ ).block_until_ready()






    @slow
    def  A       (  self      :					List[Any] ):


       """simple docstring"""







       for model_name in ["roberta-base", "roberta-large"]:
          UpperCamelCase					=  AutoTokenizer.from_pretrained(UpperCamelCase__ )
          UpperCamelCase					=  FlaxRobertaModel.from_pretrained(UpperCamelCase__ )
          UpperCamelCase					=  tokenizer('Do you support jax jitted function?'  ,						return_tensors=TensorType.JAX )

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

          eval(**UpperCamelCase__ ).block_until_ready()






    def  A       (  self      :					Union[str, Any] ):


       """simple docstring"""







       with self.assertRaisesRegex(
           UpperCamelCase__  ,						'bert-base is not a local folder and is not a valid model identifier' ):
          UpperCamelCase					=  FlaxAutoModel.from_pretrained('bert-base' )






    def  A       (  self      :					List[Any] ):


       """simple docstring"""







       with self.assertRaisesRegex(
           UpperCamelCase__  ,						R'aaaaaa is not a valid git identifier \(branch name, tag name or commit id\)' ):
          UpperCamelCase					=  FlaxAutoModel.from_pretrained(UpperCamelCase__  ,						revision='aaaaaa' )






    def  A       (  self      :					Union[str, Any] ):


       """simple docstring"""







       with self.assertRaisesRegex(
           UpperCamelCase__  ,						'hf-internal-testing/config-no-model does not appear to have a file named flax_model.msgpack'  ,						):
          UpperCamelCase					=  FlaxAutoModel.from_pretrained('hf-internal-testing/config-no-model' )






    def  A       (  self      :					str ):


       """simple docstring"""







       with self.assertRaisesRegex(UpperCamelCase__  ,						'Use `from_pt=True` to load this model' ):
          UpperCamelCase					=  FlaxAutoModel.from_pretrained('hf-internal-testing/tiny-bert-pt-only' )






'''simple docstring'''


def 				__lowerCamelCase				(   A__ = 10**9    )       ->	int:






   """simple docstring"""
   UpperCamelCase					=  1
   UpperCamelCase					=  2

   UpperCamelCase					=  0
   UpperCamelCase					=  0
   UpperCamelCase					=  0
   while perimeter <= max_perimeter:
      perimeters_sum += perimeter

      prev_value += 2 * value
      value += prev_value

      UpperCamelCase					=  2 * value + 2 if i % 2 == 0 else 2 * value - 2
      i += 1

   return perimeters_sum


if __name__ == "__main__":
   print(f'''{solution() = }''')

