



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







     @slow
     def  _lowercase			(       self      :     int):
           for model_name in ["bert-base-cased", "bert-large-uncased"]:
                 with self.subTest(_A):
                       A__	:							int						    = AutoConfig.from_pretrained(_A)
                       self.assertIsNotNone(_A)
                       self.assertIsInstance(_A			,		_A)

                       A__	:							List[Any]						    = FlaxAutoModel.from_pretrained(_A)
                       self.assertIsNotNone(_A)
                       self.assertIsInstance(_A			,		_A)







     @slow
     def  _lowercase			(       self      :     Dict):
           for model_name in ["roberta-base", "roberta-large"]:
                 with self.subTest(_A):
                       A__	:							Optional[int]						    = AutoConfig.from_pretrained(_A)
                       self.assertIsNotNone(_A)
                       self.assertIsInstance(_A			,		_A)

                       A__	:							Tuple						    = FlaxAutoModel.from_pretrained(_A)
                       self.assertIsNotNone(_A)
                       self.assertIsInstance(_A			,		_A)







     @slow
     def  _lowercase			(       self      :     str):
           for model_name in ["bert-base-cased", "bert-large-uncased"]:
                 A__	:							List[Any]						    = AutoTokenizer.from_pretrained(_A)
                 A__	:							Optional[Any]						    = FlaxBertModel.from_pretrained(_A)
                 A__	:							List[str]						    = tokenizer("Do you support jax jitted function?"			,		return_tensors=TensorType.JAX)

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

                 eval(**_A).block_until_ready()







     @slow
     def  _lowercase			(       self      :     int):
           for model_name in ["roberta-base", "roberta-large"]:
                 A__	:							Dict						    = AutoTokenizer.from_pretrained(_A)
                 A__	:							int						    = FlaxRobertaModel.from_pretrained(_A)
                 A__	:							Union[str, Any]						    = tokenizer("Do you support jax jitted function?"			,		return_tensors=TensorType.JAX)

                 @jax.jit
                 def eval(**_A      :     List[str]):
                       return model(**_A)

                 eval(**_A).block_until_ready()







     def  _lowercase			(       self      :     List[str]):
           with self.assertRaisesRegex(
               _A			,		"bert-base is not a local folder and is not a valid model identifier"):
                 A__	:							List[str]						    = FlaxAutoModel.from_pretrained("bert-base")







     def  _lowercase			(       self      :     Optional[int]):
           with self.assertRaisesRegex(
               _A			,		r"aaaaaa is not a valid git identifier \(branch name, tag name or commit id\)"):
                 A__	:							Optional[int]						    = FlaxAutoModel.from_pretrained(_A			,		revision="aaaaaa")







     def  _lowercase			(       self      :     Optional[int]):
           with self.assertRaisesRegex(
               _A			,		"hf-internal-testing/config-no-model does not appear to have a file named flax_model.msgpack"			,		):
                 A__	:							Dict						    = FlaxAutoModel.from_pretrained("hf-internal-testing/config-no-model")







     def  _lowercase			(       self      :     int):
           with self.assertRaisesRegex(_A			,		"Use `from_pt=True` to load this model"):
                 A__	:							Optional[int]						    = FlaxAutoModel.from_pretrained("hf-internal-testing/tiny-bert-pt-only")




def 	snake_case__       (					__lowercase       )		->		int:







						"""simple docstring"""

						if divisor % 5 == 0 or divisor % 2 == 0:
												return 0
						A__	:							Tuple						    = 1
						A__	:							Union[str, Any]						    = 1
						while repunit:
												A__	:							Union[str, Any]						    = (1_0 * repunit + 1) % divisor
												repunit_index += 1
						return repunit_index
def 	snake_case__       (					__lowercase = 1_0_0_0_0_0_0       )		->		int:







						"""simple docstring"""

						A__	:							Dict						    = limit - 1
						if divisor % 2 == 0:
												divisor += 1
						while least_divisible_repunit(__lowercase       ) <= limit:
												divisor += 2
						return divisor


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