code: def clone(git_uri: str, overwrite: bool = False) -> str:
      """Clones a remote git repository to a local path.
  
      Args:
          git_uri: The URI to the git repository to be cloned.
          overwrite: Whether or not to overwrite the local path.
  
      Returns:
          The generated local path where the repository has been cloned to.
      """
      hash_digest = sha256_hash(git_uri)
      local_path = home_directory_path(FOLDER, hash_digest)
      exists_locally = os.path.exists(local_path)
  
      if exists_locally and overwrite:
          # TODO: ideally we would just pull the latest changes instead of cloning again
          shutil.rmtree(local_path, ignore_errors=True)
          exists_locally = False
  
      if not exists_locally:
          _clone_repo(git_uri, local_path)
      else:
          logging.info(  # pragma: no cover
              "Git repository already exists locally."
          )  # pragma: no cover
  
      return local_path
  
file_path: foolbox/foolbox/zoo/git_cloner.py
imports: import os
  import shutil
  from git import Repo
  import logging
  from .common import sha256_hash, home_directory_path
label_desc: Use image node_id 1 for calling a global function with example usage: clone(git_uri, overwrite) and returns: local_path