def install(show = False, force = False):
  git_exec_path = subprocess.Popen(["git", "--exec-path"],
                                   stdout = subprocess.PIPE).communicate()[0].strip()
  installed_link_path = os.path.join(git_exec_path, 'git-sap')

  if show:
    print(os.path.realpath(installed_link_path))
    return

  recreate = force and os.path.exists(installed_link_path)
  if recreate:
    try:
      os.remove(installed_link_path)
    except OSError as e:
      usage("failed to remove old symlink: %s", e)

  if not os.path.exists(installed_link_path):
    try:
      os.symlink(os.path.abspath(sys.argv[0]), installed_link_path)
      print("symlink %s at: %s" % ("re-installed" if recreate else "installed",
                                   installed_link_path))
    except __HOLE__ as e:
      usage("failed to install symlink: %s", e)

  else:
    print("symlink exists: %s" % installed_link_path)
dataset/ETHPy150Open jsirois/sapling/sapling.py/install