

"""simple docstring"""




from __future__ import annotations

def 		A    (       snake_case__      ):




			'''simple docstring'''


			SCREAMING_SNAKE_CASE__									= 42
			SCREAMING_SNAKE_CASE__									= list(UpperCamelCase_      )
			SCREAMING_SNAKE_CASE__							,						SCREAMING_SNAKE_CASE__									= _vector[:-1], int(_vector[-1]      )
			SCREAMING_SNAKE_CASE__									= [int(UpperCamelCase_      ) for digit in __vector]

			vector.reverse()
			for i, digit in enumerate(UpperCamelCase_      ):
						if i & 1 == 0:
									SCREAMING_SNAKE_CASE__									= digit * 2
									if doubled > 9:
												doubled -= 9
									check_digit += doubled
						else:
									check_digit += digit

			return check_digit % 10 == 0


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						assert is_luhn("79927398713")
						assert not is_luhn("79927398714")






"""simple docstring"""




import importlib.metadata
import subprocess
import sys

def 		A    (       snake_case__ = False      ):




			'''simple docstring'''


			SCREAMING_SNAKE_CASE__									= False
			if "IPython" in sys.modules:
						SCREAMING_SNAKE_CASE__									= """google.colab""" in str(sys.modules["""IPython"""].get_ipython()      )

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


