



A__     				=	(1, 1_53, 3_70, 3_71, 16_34, 24_67_80_51, 1_15_13_22_19_01_87_63_99_25_65_09_55_97_97_39_71_52_24_01)
A__     				=	(-1_53, -1, 0, 1.2, 2_00, "A", [], {}, None)


def 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

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

					# Initialization of sum and number of digits.
					_lowerCAmelCase      =   0
					_lowerCAmelCase      =   0
					_lowerCAmelCase      =   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
					_lowerCAmelCase      =   n
					while temp > 0:
										_lowerCAmelCase      =   temp % 10
										total += rem**number_of_digits
										temp //= 10
					return n == total


def 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

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

					# Init a "histogram" of the digits
					_lowerCAmelCase      =   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
					_lowerCAmelCase      =   0
					_lowerCAmelCase      =   0
					_lowerCAmelCase      =   n
					while temp > 0:
										_lowerCAmelCase     ,     _lowerCAmelCase      =   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 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

					if not isinstance(UpperCamelCase_     ,						UpperCamelCase_      ) or n < 1:
										return False
					_lowerCAmelCase      =   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 		_UpperCAmelCase    (				):





					"""simple docstring"""

					_lowerCAmelCase      =   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()








# Lint as: python3

import hashlib
from typing import Union


def 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

					if isinstance(snake_case     ,						snake_case      ):
										# Data already in bytes, returns as it as
										return hash_data
					elif isinstance(snake_case     ,						snake_case      ):
										# We keep the data as it as for it ot be later encoded to UTF-8
										# However replace `\\` with `/` for Windows compatibility
										_lowerCAmelCase      =   hash_data.replace("""\\"""     ,						"""/"""      )
					elif isinstance(snake_case     ,						snake_case      ):
										_lowerCAmelCase      =   str(snake_case      )
					else:
										# If data is not of the required type, raise error
										raise InvalidKeyError(snake_case      )

					return hash_data.encode("""utf-8"""      )





class  __lowerCAmelCase			(					lowerCamelCase__	):




				def __init__(							self						,    _snake_case		):



									"""simple docstring"""





									_lowerCAmelCase      =   """\nFAILURE TO GENERATE DATASET: Invalid key type detected"""
									_lowerCAmelCase      =   F'\nFound Key {hash_data} of type {type(_snake_case		)}'
									_lowerCAmelCase      =   """\nKeys should be either str, int or bytes type"""
									super().__init__(F'{self.prefix}{self.err_msg}{self.suffix}'		)





class  __lowerCAmelCase			(					lowerCamelCase__	):




				def __init__(							self						,    _snake_case						,    _snake_case						,    _snake_case=""		):



									"""simple docstring"""





									_lowerCAmelCase      =   key
									_lowerCAmelCase      =   duplicate_key_indices
									_lowerCAmelCase      =   fix_msg
									_lowerCAmelCase      =   """Found multiple examples generated with the same key"""
									if len(_snake_case		) <= 20:
														_lowerCAmelCase      =   F'\nThe examples at index {", ".join(_snake_case		)} have the key {key}'
									else:
														_lowerCAmelCase      =   F'\nThe examples at index {", ".join(duplicate_key_indices[:20]		)}... ({len(_snake_case		) - 20} more) have the key {key}'
									_lowerCAmelCase      =   """\n""" + fix_msg if fix_msg else """"""
									super().__init__(F'{self.prefix}{self.err_msg}{self.suffix}'		)





class  __lowerCAmelCase			:




				def __init__(							self						,    _snake_case		):



									"""simple docstring"""





									_lowerCAmelCase      =   hashlib.mda(_as_bytes(_snake_case		)		)




				def 							snake_case       (							self						,    _snake_case		):



									"""simple docstring"""





									_lowerCAmelCase      =   self._split_mda.copy()
									_lowerCAmelCase      =   _as_bytes(_snake_case		)
									mda.update(_snake_case		)
									# Convert to integer with hexadecimal conversion
									return int(mda.hexdigest()						,    16		)



