



'''simple docstring'''






UpperCamelCase__:       int							     =      (1, 153, 370, 371, 1634, 24678051, 115132219018763992565095597973971522401)
UpperCamelCase__:       List[str]							     =      (-153, -1, 0, 1.2, 200, "A", [], {}, None)


def 			snake_case_					( _lowerCAmelCase  :						int  )				->       Optional[int]:



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

       # Initialization of sum and number of digits.
       UpperCAmelCase			:	Optional[int]										=		0
       UpperCAmelCase			:	Union[str, Any]										=		0
       UpperCAmelCase			:	str										=		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
       UpperCAmelCase			:	Dict										=		n
       while temp > 0:
              UpperCAmelCase			:	int										=		temp % 10
              total += rem**number_of_digits
              temp //= 10
       return n == total


def 			snake_case_					( _lowerCAmelCase  :						Optional[Any]  )				->       Tuple:



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

       # Init a "histogram" of the digits
       UpperCAmelCase			:	Union[str, Any]										=		[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
       UpperCAmelCase			:	List[str]										=		0
       UpperCAmelCase			:	List[Any]										=		0
       UpperCAmelCase			:	Dict										=		n
       while temp > 0:
              UpperCAmelCase							,		UpperCAmelCase			:	int										=		divmod(__A       ,				10  )
              digit_histogram[rem] += 1
              digit_total += 1

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

       return n == total


def 			snake_case_					( _lowerCAmelCase  :						Any  )				->       Dict:



       if not isinstance(__A       ,				__A  ) or n < 1:
              return False
       UpperCAmelCase			:	List[Any]										=		len(str(__A  )  )  # 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(__A  ) ** expo for i in str(__A  )  )


def 			snake_case_					( )				->       List[str]:
       UpperCAmelCase			:	Union[str, Any]										=		int(input('''Enter an integer to see if it is an Armstrong number: '''  ).strip()  )
       print(f"""{num} is {"" if armstrong_number(__A  ) else "not "}an Armstrong number."""  )
       print(f"""{num} is {"" if narcissistic_number(__A  ) else "not "}an Armstrong number."""  )
       print(f"""{num} is {"" if pluperfect_number(__A  ) else "not "}an Armstrong number."""  )


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()










'''simple docstring'''






import importlib.metadata
import subprocess
import sys


def 			snake_case_					( _lowerCAmelCase  :						bool = False  )				->       str:
							UpperCAmelCase			:	List[str]										=		False
							if "IPython" in sys.modules:
														UpperCAmelCase			:	Optional[Any]										=		'''google.colab''' in str(sys.modules['''IPython'''].get_ipython()  )

							if in_colab:
														if upgrade:
																					UpperCAmelCase			:	List[Any]										=		['''pip''', '''install''', '''-U''', '''torch''']
																					subprocess.run(_lowerCAmelCase       ,				check=_lowerCAmelCase  )
														# get the current version of torch
														UpperCAmelCase			:	Dict										=		importlib.metadata.version('''torch'''  )
														UpperCAmelCase			:	int										=		torch_version[: torch_version.rindex('''.'''  )]
														UpperCAmelCase			:	Any										=		f"""https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-{torch_version_trunc}-cp37-cp37m-linux_x86_64.whl"""
														UpperCAmelCase			:	List[str]										=		['''pip''', '''install''', xla_wheel]
														subprocess.run(_lowerCAmelCase       ,				check=_lowerCAmelCase  )
							else:
														raise RuntimeError('''`install_xla` utility works only on google colab.'''  )





