

import importlib.metadata
import subprocess
import sys





def  _snake_case		(snake_case_					:     bool = False  )							->		List[str]:
  __UpperCAmelCase	:  Dict		=     False
  if "IPython" in sys.modules:
    __UpperCAmelCase	:  Tuple		=     'google.colab' in str(sys.modules['IPython'].get_ipython()  )

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








def  _snake_case		(snake_case_					:     float  )							->		int:
  if num < 0:
    return -1
  return 1 if num else 0





def  _snake_case		()							->		None:
  assert signum(5  ) == 1
  assert signum(-5  ) == -1
  assert signum(0  ) == 0


if __name__ == "__main__":
      print(signum(1_2))
      print(signum(-1_2))
      print(signum(0))





