

"""simple docstring"""




def 		A    (       snake_case__      ):




			'''simple docstring'''


			if not isinstance(snake_case__						,			snake_case__      ):
						SCREAMING_SNAKE_CASE__									= (
						    """operation can not be conducted on a object of type """
						    f"""{type(snake_case__      ).__name__}"""
						)
						raise TypeError(snake_case__      )
			SCREAMING_SNAKE_CASE__									= """"""
			for _ in range(0						,			32      ):
						bit_string += str(number % 2      )
						SCREAMING_SNAKE_CASE__									= number >> 1
			return bit_string

def 		A    (       snake_case__      ):




			'''simple docstring'''


			if number < 0:
						raise ValueError("""the value of input must be positive"""      )
			elif isinstance(snake_case__						,			snake_case__      ):
						raise TypeError("""Input value must be a 'int' type"""      )
			elif isinstance(snake_case__						,			snake_case__      ):
						raise TypeError("""'<' not supported between instances of 'str' and 'int'"""      )
			SCREAMING_SNAKE_CASE__									= 0
			# iterator over [1 to 32],since we are dealing with 32 bit integer
			for _ in range(1						,			33      ):
						# left shift the bits by unity
						SCREAMING_SNAKE_CASE__									= result << 1
						# get the end bit
						SCREAMING_SNAKE_CASE__									= number % 2
						# right shift the bits by unity
						SCREAMING_SNAKE_CASE__									= number >> 1
						# add that bit to our ans
						SCREAMING_SNAKE_CASE__									= result | end_bit
			return get_reverse_bit_string(snake_case__      )


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


