code: def install_hooks(scm: "Git") -> None:
      from scmrepo.exceptions import GitHookAlreadyExists
  
      from dvc.utils import format_link
  
      hooks = ["post-checkout", "pre-commit", "pre-push"]
      for hook in hooks:
          try:
              scm.verify_hook(hook)
          except GitHookAlreadyExists as exc:
              link = format_link("https://man.dvc.org/install")
              raise DvcException(  # noqa: B904
                  f"{exc}. Please refer to {link} for more info."
              )
  
      for hook in hooks:
          scm.install_hook(hook, f"exec dvc git-hook {hook} $@")
  
imports: from typing import TYPE_CHECKING
  from dvc.exceptions import DvcException
label_desc: Use image node_id 2 for calling a global function with example usage: install_hooks(scm) without return types