





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







							"""simple docstring"""




							@slow
							def  A_     ( self     :					Any						)				->			Any:





														"""simple docstring"""
														# for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														for model_name in ["bert-base-uncased"]:
																					SCREAMING_SNAKE_CASE__       :      str     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Tuple     =						TFAutoModel.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						AutoModel.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							@slow
							def  A_     ( self     :					Optional[int]						)				->			int:





														"""simple docstring"""
														# for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														for model_name in ["bert-base-uncased"]:
																					SCREAMING_SNAKE_CASE__       :      Optional[Any]     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      str     =						TFAutoModelForPreTraining.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Any     =						AutoModelForPreTraining.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							@slow
							def  A_     ( self     :					Union[str, Any]						)				->			str:





														"""simple docstring"""
														for model_name in TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																					SCREAMING_SNAKE_CASE__       :      Tuple     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      List[Any]     =						TFAutoModelForCausalLM.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      Tuple     =						TFAutoModelForCausalLM.from_pretrained(
																					    _lowercase,			output_loading_info=_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						AutoModelForCausalLM.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						AutoModelForCausalLM.from_pretrained(
																					    _lowercase,			output_loading_info=_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							@slow
							def  A_     ( self     :					Union[str, Any]						)				->			str:





														"""simple docstring"""
														for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																					SCREAMING_SNAKE_CASE__       :      int     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      str     =						TFAutoModelWithLMHead.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      str     =						AutoModelWithLMHead.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							@slow
							def  A_     ( self     :					Dict						)				->			Tuple:





														"""simple docstring"""
														for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																					SCREAMING_SNAKE_CASE__       :      Dict     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Tuple     =						TFAutoModelForMaskedLM.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      Any     =						TFAutoModelForMaskedLM.from_pretrained(
																					    _lowercase,			output_loading_info=_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Tuple     =						AutoModelForMaskedLM.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      Any     =						AutoModelForMaskedLM.from_pretrained(
																					    _lowercase,			output_loading_info=_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							@slow
							def  A_     ( self     :					Tuple						)				->			Optional[int]:





														"""simple docstring"""
														for model_name in TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																					SCREAMING_SNAKE_CASE__       :      str     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Optional[int]     =						TFAutoModelForSeqaSeqLM.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      Dict     =						TFAutoModelForSeqaSeqLM.from_pretrained(
																					    _lowercase,			output_loading_info=_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      List[str]     =						AutoModelForSeqaSeqLM.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      Optional[Any]     =						AutoModelForSeqaSeqLM.from_pretrained(
																					    _lowercase,			output_loading_info=_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							@slow
							def  A_     ( self     :					int						)				->			List[Any]:





														"""simple docstring"""
														# for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														for model_name in ["bert-base-uncased"]:
																					SCREAMING_SNAKE_CASE__       :      List[str]     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      int     =						TFAutoModelForSequenceClassification.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Dict     =						AutoModelForSequenceClassification.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							@slow
							def  A_     ( self     :					Tuple						)				->			List[Any]:





														"""simple docstring"""
														# for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														for model_name in ["bert-base-uncased"]:
																					SCREAMING_SNAKE_CASE__       :      Dict     =						AutoConfig.from_pretrained(_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Any     =						TFAutoModelForQuestionAnswering.from_pretrained(_lowercase,			from_pt=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)

																					SCREAMING_SNAKE_CASE__       :      Dict     =						AutoModelForQuestionAnswering.from_pretrained(_lowercase,			from_tf=_lowercase						)
																					self.assertIsNotNone(_lowercase						)
																					self.assertIsInstance(_lowercase,			_lowercase						)






							def  A_     ( self     :					List[Any]						)				->			Tuple:





														"""simple docstring"""
														SCREAMING_SNAKE_CASE__       :      List[str]     =						TFAutoModelWithLMHead.from_pretrained(_lowercase,			from_pt=_lowercase						)
														self.assertIsInstance(_lowercase,			_lowercase						)
														self.assertEqual(model.num_parameters(),			1_4_4_1_0						)
														self.assertEqual(model.num_parameters(only_trainable=_lowercase						),			1_4_4_1_0						)

														SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						AutoModelWithLMHead.from_pretrained(_lowercase,			from_tf=_lowercase						)
														self.assertIsInstance(_lowercase,			_lowercase						)
														self.assertEqual(model.num_parameters(),			1_4_4_1_0						)
														self.assertEqual(model.num_parameters(only_trainable=_lowercase						),			1_4_4_1_0						)






							def  A_     ( self     :					Optional[Any]						)				->			List[Any]:





														"""simple docstring"""
														SCREAMING_SNAKE_CASE__       :      str     =						TFAutoModelWithLMHead.from_pretrained(_lowercase,			from_pt=_lowercase						)
														self.assertIsInstance(_lowercase,			_lowercase						)
														self.assertEqual(model.num_parameters(),			1_4_4_1_0						)
														self.assertEqual(model.num_parameters(only_trainable=_lowercase						),			1_4_4_1_0						)

														SCREAMING_SNAKE_CASE__       :      str     =						AutoModelWithLMHead.from_pretrained(_lowercase,			from_tf=_lowercase						)
														self.assertIsInstance(_lowercase,			_lowercase						)
														self.assertEqual(model.num_parameters(),			1_4_4_1_0						)
														self.assertEqual(model.num_parameters(only_trainable=_lowercase						),			1_4_4_1_0						)













def _a (  SCREAMING_SNAKE_CASE__      :  int = 50_00_00_00       )	->    int:

							'''simple docstring'''






							SCREAMING_SNAKE_CASE__       :      str     =						set()
							SCREAMING_SNAKE_CASE__       :      Dict     =						int((limit - 24) ** (1 / 2)       )

							SCREAMING_SNAKE_CASE__       :      Any     =						set(range(3			,				prime_square_limit + 1			,				2       )       )
							primes.add(2       )
							for p in range(3			,				prime_square_limit + 1			,				2       ):
														if p not in primes:
																					continue
														primes.difference_update(set(range(p * p			,				prime_square_limit + 1			,				SCREAMING_SNAKE_CASE__       )       )       )

							for primea in primes:
														SCREAMING_SNAKE_CASE__       :      Optional[int]     =						primea * primea
														for primea in primes:
																					SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						primea * primea * primea
																					if square + cube >= limit - 16:
																												break
																					for primea in primes:
																												SCREAMING_SNAKE_CASE__       :      List[str]     =						primea * primea * primea * primea
																												SCREAMING_SNAKE_CASE__       :      Optional[int]     =						square + cube + tetr
																												if total >= limit:
																																			break
																												ret.add(SCREAMING_SNAKE_CASE__       )

							return len(SCREAMING_SNAKE_CASE__       )


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






