






"""simple docstring"""



from __future__ import annotations

import unittest

from transformers import DebertaConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
    import tensorflow as tf

    from transformers import (
        TFDebertaForMaskedLM,
        TFDebertaForQuestionAnswering,
        TFDebertaForSequenceClassification,
        TFDebertaForTokenClassification,
        TFDebertaModel,
    )

class 	a					:







    def __init__(      self							,		_lowerCamelCase							,		_lowerCamelCase=1_3							,		_lowerCamelCase=7							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase=9_9							,		_lowerCamelCase=3_2							,		_lowerCamelCase=2							,		_lowerCamelCase=4							,		_lowerCamelCase=3_7							,		_lowerCamelCase="gelu"							,		_lowerCamelCase=0.1							,		_lowerCamelCase=0.1							,		_lowerCamelCase=5_1_2							,		_lowerCamelCase=1_6							,		_lowerCamelCase=2							,		_lowerCamelCase=0.0_2							,		_lowerCamelCase=3							,		_lowerCamelCase=4							,		_lowerCamelCase=None							,		):
      lowercase							   =	parent
      lowercase							   =	1_3
      lowercase							   =	7
      lowercase							   =	True
      lowercase							   =	True
      lowercase							   =	True
      lowercase							   =	True
      lowercase							   =	9_9
      lowercase							   =	3_2
      lowercase							   =	2
      lowercase							   =	4
      lowercase							   =	3_7
      lowercase							   =	'gelu'
      lowercase							   =	0.1
      lowercase							   =	0.1
      lowercase							   =	5_1_2
      lowercase							   =	1_6
      lowercase							   =	False
      lowercase							   =	-1
      lowercase							   =	True
      lowercase							   =	2
      lowercase							   =	0.0_2
      lowercase							   =	3
      lowercase							   =	4
      lowercase							   =	None







    def       UpperCamelCase_				(      self	):
      lowercase							   =	ids_tensor([self.batch_size, self.seq_length]							,		self.vocab_size	)

      lowercase							   =	None
      if self.use_input_mask:
        lowercase							   =	random_attention_mask([self.batch_size, self.seq_length]	)

      lowercase							   =	None
      if self.use_token_type_ids:
        lowercase							   =	ids_tensor([self.batch_size, self.seq_length]							,		self.type_vocab_size	)

      lowercase							   =	None
      lowercase							   =	None
      lowercase							   =	None
      if self.use_labels:
        lowercase							   =	ids_tensor([self.batch_size]							,		self.type_sequence_label_size	)
        lowercase							   =	ids_tensor([self.batch_size, self.seq_length]							,		self.num_labels	)

      lowercase							   =	DebertaConfig(
          vocab_size=self.vocab_size							,		hidden_size=self.hidden_size							,		num_hidden_layers=self.num_hidden_layers							,		num_attention_heads=self.num_attention_heads							,		intermediate_size=self.intermediate_size							,		hidden_act=self.hidden_act							,		hidden_dropout_prob=self.hidden_dropout_prob							,		attention_probs_dropout_prob=self.attention_probs_dropout_prob							,		max_position_embeddings=self.max_position_embeddings							,		type_vocab_size=self.type_vocab_size							,		relative_attention=self.relative_attention							,		max_relative_positions=self.max_relative_positions							,		position_biased_input=self.position_biased_input							,		initializer_range=self.initializer_range							,		return_dict=_lowerCamelCase							,		)

      return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase	):
      lowercase							   =	TFDebertaModel(config=_lowerCamelCase	)
      lowercase							   =	{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}

      lowercase							   =	[input_ids, input_mask]
      lowercase							   =	model(_lowerCamelCase	)

      lowercase							   =	model(_lowerCamelCase	)

      self.parent.assertEqual(result.last_hidden_state.shape							,		(self.batch_size, self.seq_length, self.hidden_size)	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase	):
      lowercase							   =	TFDebertaForMaskedLM(config=_lowerCamelCase	)
      lowercase							   =	{
          'input_ids': input_ids,
          'attention_mask': input_mask,
          'token_type_ids': token_type_ids,
      }
      lowercase							   =	model(_lowerCamelCase	)
      self.parent.assertEqual(result.logits.shape							,		(self.batch_size, self.seq_length, self.vocab_size)	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase	):
      lowercase							   =	self.num_labels
      lowercase							   =	TFDebertaForSequenceClassification(config=_lowerCamelCase	)
      lowercase							   =	{
          'input_ids': input_ids,
          'attention_mask': input_mask,
          'token_type_ids': token_type_ids,
      }

      lowercase							   =	model(_lowerCamelCase	)
      self.parent.assertEqual(result.logits.shape							,		(self.batch_size, self.num_labels)	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase	):
      lowercase							   =	self.num_labels
      lowercase							   =	TFDebertaForTokenClassification(config=_lowerCamelCase	)
      lowercase							   =	{
          'input_ids': input_ids,
          'attention_mask': input_mask,
          'token_type_ids': token_type_ids,
      }
      lowercase							   =	model(_lowerCamelCase	)
      self.parent.assertEqual(result.logits.shape							,		(self.batch_size, self.seq_length, self.num_labels)	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase	):
      lowercase							   =	TFDebertaForQuestionAnswering(config=_lowerCamelCase	)
      lowercase							   =	{
          'input_ids': input_ids,
          'attention_mask': input_mask,
          'token_type_ids': token_type_ids,
      }

      lowercase							   =	model(_lowerCamelCase	)
      self.parent.assertEqual(result.start_logits.shape							,		(self.batch_size, self.seq_length)	)
      self.parent.assertEqual(result.end_logits.shape							,		(self.batch_size, self.seq_length)	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	self.prepare_config_and_inputs()
      (
          (
          lowercase
      )   ,					(
          lowercase
      )   ,					(
          lowercase
      )   ,					(
          lowercase
      )   ,					(
          lowercase
      )   ,					(
          lowercase
      )   ,					(
          lowercase
      )   ,					
      )							   =	config_and_inputs
      lowercase							   =	{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
      return config, inputs_dict


@require_tf
class 	a					(       a_,    a_,    unittest.TestCase     ):
    UpperCAmelCase_			:					Optional[int]     					=(
        (
            TFDebertaModel,
            TFDebertaForMaskedLM,
            TFDebertaForQuestionAnswering,
            TFDebertaForSequenceClassification,
            TFDebertaForTokenClassification,
        )
        if is_tf_available()
        else ()
    )
    UpperCAmelCase_			:					Optional[int]     					=(
        {
            "feature-extraction": TFDebertaModel,
            "fill-mask": TFDebertaForMaskedLM,
            "question-answering": TFDebertaForQuestionAnswering,
            "text-classification": TFDebertaForSequenceClassification,
            "token-classification": TFDebertaForTokenClassification,
            "zero-shot": TFDebertaForSequenceClassification,
        }
        if is_tf_available()
        else {}
    )

    UpperCAmelCase_			:					Union[str, Any]     					=False
    UpperCAmelCase_			:					Optional[int]     					=False







    def       UpperCamelCase_				(      self	):
      lowercase							   =	TFDebertaModelTester(self	)
      lowercase							   =	ConfigTester(self							,		config_class=_lowerCamelCase							,		hidden_size=3_7	)







    def       UpperCamelCase_				(      self	):
      self.config_tester.run_common_tests()







    def       UpperCamelCase_				(      self	):
      lowercase							   =	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*_lowerCamelCase	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_masked_lm(*_lowerCamelCase	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_question_answering(*_lowerCamelCase	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_sequence_classification(*_lowerCamelCase	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_token_classification(*_lowerCamelCase	)







    @slow
    def       UpperCamelCase_				(      self	):
      lowercase							   =	TFDebertaModel.from_pretrained('kamalkraj/deberta-base'	)
      self.assertIsNotNone(_lowerCamelCase	)


@require_tf
class 	a					(       unittest.TestCase     ):







    @unittest.skip(reason='Model not available yet'	)
    def       UpperCamelCase_				(      self	):
      pass







    @slow
    def       UpperCamelCase_				(      self	):
      lowercase							   =	TFDebertaModel.from_pretrained('kamalkraj/deberta-base'	)
      lowercase							   =	tf.constant([[0, 3_1_4_1_4, 2_3_2, 3_2_8, 7_4_0, 1_1_4_0, 1_2_6_9_5, 6_9, 4_6_0_7_8, 1_5_8_8, 2]]	)
      lowercase							   =	tf.constant([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]	)
      lowercase							   =	model(_lowerCamelCase							,		attention_mask=_lowerCamelCase	)[0]

      lowercase							   =	tf.constant(
          [
              [
                  [-0.5_9_8_5_5_8_9_6, -0.8_0_5_5_2_5_6_6, -0.8_4_6_2_1_3_5],
                  [1.4_4_8_4_0_2_5, -0.9_3_4_8_3_7_9_4, -0.8_0_5_9_3_0_8_5],
                  [0.3_1_2_2_7_4_1, 0.0_0_3_1_6_0_5_9, -1.4_1_3_1_3_7_7],
              ]
          ]	)
      tf.debugging.assert_near(output[:, 1:4, 1:4]							,		_lowerCamelCase							,		atol=1e-4	)










"""simple docstring"""



_UpperCamelCase		:  str						=		1_0**8
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  int   ):





  '''simple docstring'''





  if n % 10 == 0:
    return False
  lowercase							   =	str(__snake_case   )
  return s == s[::-1]
def 						_SCREAMING_SNAKE_CASE			(   ):





  '''simple docstring'''





  lowercase							   =	set()
  lowercase							   =	1
  lowercase							   =	5
  while sum_squares < LIMIT:
    lowercase							   =	first_square + 1
    while sum_squares < LIMIT:
      if is_palindrome(__snake_case   ):
        answer.add(__snake_case   )
      last_square += 1
      sum_squares += last_square**2
    first_square += 1
    lowercase							   =	first_square**2 + (first_square + 1) ** 2

  return sum(__snake_case   )


if __name__ == "__main__":
    print(solution())


