'''simple docstring'''






from __future__ import annotations

import unittest

from transformers import is_tf_available, is_torch_available
from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER, SMALL_MODEL_IDENTIFIER, is_pt_tf_cross_test, slow


if is_tf_available():
    from transformers import (
        AutoConfig,
        BertConfig,
        GPTaConfig,
        TaConfig,
        TFAutoModel,
        TFAutoModelForCausalLM,
        TFAutoModelForMaskedLM,
        TFAutoModelForPreTraining,
        TFAutoModelForQuestionAnswering,
        TFAutoModelForSeqaSeqLM,
        TFAutoModelForSequenceClassification,
        TFAutoModelWithLMHead,
        TFBertForMaskedLM,
        TFBertForPreTraining,
        TFBertForQuestionAnswering,
        TFBertForSequenceClassification,
        TFBertModel,
        TFGPTaLMHeadModel,
        TFRobertaForMaskedLM,
        TFTaForConditionalGeneration,
    )
    from transformers.models.bert.modeling_tf_bert import TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST
    from transformers.models.gpta.modeling_tf_gpta import TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST
    from transformers.models.ta.modeling_tf_ta import TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST

if is_torch_available():
    from transformers import (
        AutoModel,
        AutoModelForCausalLM,
        AutoModelForMaskedLM,
        AutoModelForPreTraining,
        AutoModelForQuestionAnswering,
        AutoModelForSeqaSeqLM,
        AutoModelForSequenceClassification,
        AutoModelWithLMHead,
        BertForMaskedLM,
        BertForPreTraining,
        BertForQuestionAnswering,
        BertForSequenceClassification,
        BertModel,
        GPTaLMHeadModel,
        RobertaForMaskedLM,
        TaForConditionalGeneration,
    )




@is_pt_tf_cross_test
class    a (       unittest.TestCase				):



  """simple docstring"""







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in ["bert-base-uncased"]:
      __UpperCAmelCase:					Optional[int]		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Optional[Any]		= TFAutoModel.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Tuple		= AutoModel.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in ["bert-base-uncased"]:
      __UpperCAmelCase:					Tuple		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Optional[Any]		= TFAutoModelForPreTraining.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Dict		= AutoModelForPreTraining.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
      __UpperCAmelCase:					Dict		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Tuple		= TFAutoModelForCausalLM.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      __UpperCAmelCase, __UpperCAmelCase:					int		= TFAutoModelForCausalLM.from_pretrained(
          snake_case_   ,    output_loading_info=snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Union[str, Any]		= AutoModelForCausalLM.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      __UpperCAmelCase, __UpperCAmelCase:					List[Any]		= AutoModelForCausalLM.from_pretrained(
          snake_case_   ,    output_loading_info=snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
      __UpperCAmelCase:					Dict		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Optional[Any]		= TFAutoModelWithLMHead.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Optional[int]		= AutoModelWithLMHead.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
      __UpperCAmelCase:					str		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					int		= TFAutoModelForMaskedLM.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      __UpperCAmelCase, __UpperCAmelCase:					List[Any]		= TFAutoModelForMaskedLM.from_pretrained(
          snake_case_   ,    output_loading_info=snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					List[Any]		= AutoModelForMaskedLM.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      __UpperCAmelCase, __UpperCAmelCase:					Optional[Any]		= AutoModelForMaskedLM.from_pretrained(
          snake_case_   ,    output_loading_info=snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
      __UpperCAmelCase:					Tuple		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					str		= TFAutoModelForSeqaSeqLM.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      __UpperCAmelCase, __UpperCAmelCase:					List[str]		= TFAutoModelForSeqaSeqLM.from_pretrained(
          snake_case_   ,    output_loading_info=snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					int		= AutoModelForSeqaSeqLM.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      __UpperCAmelCase, __UpperCAmelCase:					Dict		= AutoModelForSeqaSeqLM.from_pretrained(
          snake_case_   ,    output_loading_info=snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in ["bert-base-uncased"]:
      __UpperCAmelCase:					List[Any]		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Tuple		= TFAutoModelForSequenceClassification.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Tuple		= AutoModelForSequenceClassification.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  @slow
  def    lowercase_  (							self					):

    '''simple docstring'''







    for model_name in ["bert-base-uncased"]:
      __UpperCAmelCase:					Optional[int]		= AutoConfig.from_pretrained(snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Tuple		= TFAutoModelForQuestionAnswering.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)

      __UpperCAmelCase:					Any		= AutoModelForQuestionAnswering.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
      self.assertIsNotNone(snake_case_					)
      self.assertIsInstance(snake_case_   ,    snake_case_					)







  def    lowercase_  (							self					):

    '''simple docstring'''







    __UpperCAmelCase:					str		= TFAutoModelWithLMHead.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
    self.assertIsInstance(snake_case_   ,    snake_case_					)
    self.assertEqual(model.num_parameters()   ,    1_4410					)
    self.assertEqual(model.num_parameters(only_trainable=snake_case_					)   ,    1_4410					)

    __UpperCAmelCase:					Tuple		= AutoModelWithLMHead.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
    self.assertIsInstance(snake_case_   ,    snake_case_					)
    self.assertEqual(model.num_parameters()   ,    1_4410					)
    self.assertEqual(model.num_parameters(only_trainable=snake_case_					)   ,    1_4410					)







  def    lowercase_  (							self					):

    '''simple docstring'''







    __UpperCAmelCase:					str		= TFAutoModelWithLMHead.from_pretrained(snake_case_   ,    from_pt=snake_case_					)
    self.assertIsInstance(snake_case_   ,    snake_case_					)
    self.assertEqual(model.num_parameters()   ,    1_4410					)
    self.assertEqual(model.num_parameters(only_trainable=snake_case_					)   ,    1_4410					)

    __UpperCAmelCase:					Dict		= AutoModelWithLMHead.from_pretrained(snake_case_   ,    from_tf=snake_case_					)
    self.assertIsInstance(snake_case_   ,    snake_case_					)
    self.assertEqual(model.num_parameters()   ,    1_4410					)
    self.assertEqual(model.num_parameters(only_trainable=snake_case_					)   ,    1_4410					)
'''simple docstring'''






import itertools
import math






def  UpperCamelCase__					(					_lowercase    :				int     )							->	bool:

  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5   ,    int(math.sqrt(_lowercase     ) + 1     )   ,    6     ):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True






def  UpperCamelCase__					(					)							->	Optional[int]:
  __UpperCAmelCase:					Union[str, Any]		= 2
  while True:
    if is_prime(_lowercase     ):
      yield num
    num += 1






def  UpperCamelCase__					(					_lowercase    :				int = 1_0_0_0_1     )							->	int:
  return next(itertools.islice(prime_generator()   ,    nth - 1   ,    _lowercase     )     )


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