
import importlib.metadata
import subprocess
import sys




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  bool = False					)     ->    Optional[Any]:
						_lowercase									=				False
						if "IPython" in sys.modules:
												_lowercase									=				"""google.colab""" in str(sys.modules["""IPython"""].get_ipython()					)

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

from math import sqrt




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    list[int]:
						_lowercase									=				[1]
						for i in range(2		,      int(sqrt(SCREAMING_SNAKE_CASE_					)					) + 1		,      1					):
												if number % i == 0:
																		values.append(SCREAMING_SNAKE_CASE_					)
																		if int(number // i					) != i:
																								values.append(int(number // i					)					)
						return sorted(SCREAMING_SNAKE_CASE_					)




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						return sum(factors(SCREAMING_SNAKE_CASE_					)					) > n




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						_lowercase									=				factors(SCREAMING_SNAKE_CASE_					)
						_lowercase									=				len(SCREAMING_SNAKE_CASE_					)
						_lowercase									=				[[0 for i in range(number + 1					)] for j in range(r + 1					)]
						for i in range(r + 1					):
												_lowercase									=				True

						for i in range(1		,      number + 1					):
												_lowercase									=				False

						for i in range(1		,      r + 1					):
												for j in range(1		,      number + 1					):
																		if j < values[i - 1]:
																								_lowercase									=				subset[i - 1][j]
																		else:
																								_lowercase									=				subset[i - 1][j] or subset[i - 1][j - values[i - 1]]

						return subset[r][number] != 0




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						return abundant(SCREAMING_SNAKE_CASE_					) and not semi_perfect(SCREAMING_SNAKE_CASE_					)


if __name__ == "__main__":
		import doctest

		doctest.testmod(verbose=True)
		for number in (69, 70, 71):
				print(F'{number} is {"" if weird(number) else "not "}weird.')