




'''simple docstring'''





UpperCamelCase_		:    Dict									=		(1, 153, 370, 371, 1634, 24678051, 115132219018763992565095597973971522401)
UpperCamelCase_		:    tuple									=		(-153, -1, 0, 1.2, 200, "A", [], {}, None)





def 			__a			(     _UpperCamelCase:					int					)		->				bool:

     """simple docstring"""




     if not isinstance(_UpperCamelCase      ,		_UpperCamelCase					) or n < 1:
          return False

     # Initialization of sum and number of digits.
     _snake_case							=   0
     _snake_case							=   0
     _snake_case							=   n
     # Calculation of digits of the number
     while temp > 0:
          number_of_digits += 1
          temp //= 10
     # Dividing number into separate digits and find Armstrong number
     _snake_case							=   n
     while temp > 0:
          _snake_case							=   temp % 10
          total += rem**number_of_digits
          temp //= 10
     return n == total





def 			__a			(     _UpperCamelCase:					int					)		->				bool:

     """simple docstring"""




     if not isinstance(_UpperCamelCase      ,		_UpperCamelCase					) or n < 1:
          return False

     # Init a "histogram" of the digits
     _snake_case							=   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     _snake_case							=   0
     _snake_case							=   0
     _snake_case							=   n
     while temp > 0:
          _snake_case							,      _snake_case							=   divmod(_UpperCamelCase      ,		10					)
          digit_histogram[rem] += 1
          digit_total += 1

     for cnt, i in zip(_UpperCamelCase      ,		range(len(_UpperCamelCase					)					)					):
          total += cnt * i**digit_total

     return n == total





def 			__a			(     _UpperCamelCase:					int					)		->				bool:

     """simple docstring"""




     if not isinstance(_UpperCamelCase      ,		_UpperCamelCase					) or n < 1:
          return False
     _snake_case							=   len(str(_UpperCamelCase					)					)  # the power that all digits will be raised to
     # check if sum of each digit multiplied expo times is equal to number
     return n == sum(int(_UpperCamelCase					) ** expo for i in str(_UpperCamelCase					)					)





def 			__a			(     )		->				List[Any]:

     """simple docstring"""




     _snake_case							=   int(input("Enter an integer to see if it is an Armstrong number: "					).strip()					)
     print(F"""{num} is {'' if armstrong_number(_UpperCamelCase					) else 'not '}an Armstrong number."""					)
     print(F"""{num} is {'' if narcissistic_number(_UpperCamelCase					) else 'not '}an Armstrong number."""					)
     print(F"""{num} is {'' if pluperfect_number(_UpperCamelCase					) else 'not '}an Armstrong number."""					)


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()








'''simple docstring'''





import unittest

import numpy as np

from transformers import ElectraConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
   from transformers.models.electra.modeling_flax_electra import (
       FlaxElectraForCausalLM,
       FlaxElectraForMaskedLM,
       FlaxElectraForMultipleChoice,
       FlaxElectraForPreTraining,
       FlaxElectraForQuestionAnswering,
       FlaxElectraForSequenceClassification,
       FlaxElectraForTokenClassification,
       FlaxElectraModel,
   )

class      _a       (		unittest.TestCase							):






     def __init__(				self      ,_SCREAMING_SNAKE_CASE      ,_SCREAMING_SNAKE_CASE=13      ,_SCREAMING_SNAKE_CASE=7      ,_SCREAMING_SNAKE_CASE=True      ,_SCREAMING_SNAKE_CASE=True      ,_SCREAMING_SNAKE_CASE=True      ,_SCREAMING_SNAKE_CASE=True      ,_SCREAMING_SNAKE_CASE=99      ,_SCREAMING_SNAKE_CASE=24      ,_SCREAMING_SNAKE_CASE=32      ,_SCREAMING_SNAKE_CASE=5      ,_SCREAMING_SNAKE_CASE=4      ,_SCREAMING_SNAKE_CASE=37      ,_SCREAMING_SNAKE_CASE="gelu"      ,_SCREAMING_SNAKE_CASE=0.1      ,_SCREAMING_SNAKE_CASE=0.1      ,_SCREAMING_SNAKE_CASE=512      ,_SCREAMING_SNAKE_CASE=16      ,_SCREAMING_SNAKE_CASE=2      ,_SCREAMING_SNAKE_CASE=0.0_2      ,_SCREAMING_SNAKE_CASE=4      ,)							->    List[str]:
          _snake_case							=   parent
          _snake_case							=   batch_size
          _snake_case							=   seq_length
          _snake_case							=   is_training
          _snake_case							=   use_attention_mask
          _snake_case							=   use_token_type_ids
          _snake_case							=   use_labels
          _snake_case							=   vocab_size
          _snake_case							=   hidden_size
          _snake_case							=   embedding_size
          _snake_case							=   num_hidden_layers
          _snake_case							=   num_attention_heads
          _snake_case							=   intermediate_size
          _snake_case							=   hidden_act
          _snake_case							=   hidden_dropout_prob
          _snake_case							=   attention_probs_dropout_prob
          _snake_case							=   max_position_embeddings
          _snake_case							=   type_vocab_size
          _snake_case							=   type_sequence_label_size
          _snake_case							=   initializer_range
          _snake_case							=   num_choices






     def        _lowercase			(				self					)							->    int:
          _snake_case							=   ids_tensor([self.batch_size, self.seq_length]      ,self.vocab_size					)

          _snake_case							=   None
          if self.use_attention_mask:
               _snake_case							=   random_attention_mask([self.batch_size, self.seq_length]					)

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

          _snake_case							=   ElectraConfig(
              vocab_size=self.vocab_size      ,hidden_size=self.hidden_size      ,embedding_size=self.embedding_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      ,initializer_range=self.initializer_range      ,)

          return config, input_ids, token_type_ids, attention_mask






     def        _lowercase			(				self					)							->    List[str]:
          _snake_case							=   self.prepare_config_and_inputs()
          _snake_case							,      _snake_case							,      _snake_case							,      _snake_case							=   config_and_inputs
          _snake_case							=   {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": attention_mask}
          return config, inputs_dict







@require_flax
class      _a       (		__lowerCAmelCase      ,      unittest.TestCase							):
     SCREAMING_SNAKE_CASE_							:					List[str]					       =		True

     SCREAMING_SNAKE_CASE_							:					Any					       =		(
         (
             FlaxElectraModel,
             FlaxElectraForCausalLM,
             FlaxElectraForMaskedLM,
             FlaxElectraForPreTraining,
             FlaxElectraForTokenClassification,
             FlaxElectraForQuestionAnswering,
             FlaxElectraForMultipleChoice,
             FlaxElectraForSequenceClassification,
         )
         if is_flax_available()
         else ()
     )






     def        _lowercase			(				self					)							->    List[Any]:
          _snake_case							=   FlaxElectraModelTester(self					)






     @slow
     def        _lowercase			(				self					)							->    List[Any]:
          for model_class_name in self.all_model_classes:
               if model_class_name == FlaxElectraForMaskedLM:
                    _snake_case							=   model_class_name.from_pretrained("google/electra-small-generator"					)
               else:
                    _snake_case							=   model_class_name.from_pretrained("google/electra-small-discriminator"					)
               _snake_case							=   model(np.ones((1, 1)					)					)
               self.assertIsNotNone(_SCREAMING_SNAKE_CASE					)


