

"""simple docstring"""




from __future__ import annotations

from enum import Enum





class 				lowerCamelCase  (lowercase_     ):
			lowerCamelCase__				:						Tuple   						=							2_4
			lowerCamelCase__				:						Tuple   						=							2_1
			lowerCamelCase__				:						List[str]   						=							1_8
			lowerCamelCase__				:						str   						=							1_5
			lowerCamelCase__				:						Optional[int]   						=							1_2
			lowerCamelCase__				:						Dict   						=							9
			lowerCamelCase__				:						List[Any]   						=							6
			lowerCamelCase__				:						int   						=							3
			lowerCamelCase__				:						Tuple   						=							2
			lowerCamelCase__				:						Dict   						=							1
			lowerCamelCase__				:						Union[str, Any]   						=							-1
			lowerCamelCase__				:						Union[str, Any]   						=							-2
			lowerCamelCase__				:						Dict   						=							-3
			lowerCamelCase__				:						Optional[int]   						=							-6
			lowerCamelCase__				:						Dict   						=							-9
			lowerCamelCase__				:						Optional[Any]   						=							-1_2
			lowerCamelCase__				:						Union[str, Any]   						=							-1_5
			lowerCamelCase__				:						List[Any]   						=							-1_8
			lowerCamelCase__				:						Tuple   						=							-2_1
			lowerCamelCase__				:						Tuple   						=							-2_4





class 				lowerCamelCase  (lowercase_     ):
			lowerCamelCase__				:						Dict   						=							8
			lowerCamelCase__				:						Optional[Any]   						=							7
			lowerCamelCase__				:						List[Any]   						=							6
			lowerCamelCase__				:						Dict   						=							5
			lowerCamelCase__				:						Optional[Any]   						=							4
			lowerCamelCase__				:						List[Any]   						=							3
			lowerCamelCase__				:						Union[str, Any]   						=							2
			lowerCamelCase__				:						str   						=							1

def 		A    (       snake_case__						,			snake_case__						,			snake_case__						,			):




			'''simple docstring'''


			if isinstance(__lowercase						,			__lowercase      ):
						SCREAMING_SNAKE_CASE__									= SIUnit[known_prefix.lower()]
			if isinstance(__lowercase						,			__lowercase      ):
						SCREAMING_SNAKE_CASE__									= SIUnit[unknown_prefix.lower()]
			SCREAMING_SNAKE_CASE__									= known_amount * (
			    10 ** (known_prefix.value - unknown_prefix.value)
			)
			return unknown_amount

def 		A    (       snake_case__						,			snake_case__						,			snake_case__						,			):




			'''simple docstring'''


			if isinstance(__lowercase						,			__lowercase      ):
						SCREAMING_SNAKE_CASE__									= BinaryUnit[known_prefix.lower()]
			if isinstance(__lowercase						,			__lowercase      ):
						SCREAMING_SNAKE_CASE__									= BinaryUnit[unknown_prefix.lower()]
			SCREAMING_SNAKE_CASE__									= known_amount * (
			    2 ** ((known_prefix.value - unknown_prefix.value) * 10)
			)
			return unknown_amount


if __name__ == "__main__":
						import doctest

						doctest.testmod()






"""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."""      )


