code: def _fetch_git_repo(uri, version, dst_dir):
      """
      Clone the git repo at ``uri`` into ``dst_dir``, checking out commit ``version`` (or defaulting
      to the head commit of the repository's master branch if version is unspecified).
      Assumes authentication parameters are specified by the environment, e.g. by a Git credential
      helper.
      """
      # We defer importing git until the last moment, because the import requires that the git
      # executable is available on the PATH, so we only want to fail if we actually need it.
      import git
  
      repo = git.Repo.init(dst_dir)
      origin = next((remote for remote in repo.remotes), None)
      if origin is None:
          origin = repo.create_remote("origin", uri)
      if version is not None:
          try:
              origin.fetch(
                  refspec=version, depth=GIT_FETCH_DEPTH, tags=True
              )
              repo.git.checkout(version)
          except git.exc.GitCommandError as e:
              raise ExecutionException(
                  f"Unable to checkout version '{version}' of git repo {uri}"
                  "- please ensure that the version exists in the repo. "
                  f"Error: {e}"
              )
      else:
          g = git.cmd.Git(dst_dir)
          cmd = ["git", "remote", "show", "origin"]
          output = g.execute(cmd)
          head_branch = _get_head_branch(output)
          if head_branch is None:
              raise ExecutionException(
                  "Failed to find HEAD branch. Output of `{cmd}`:\n{output}".format(
                      cmd=" ".join(cmd), output=output
                  )
              )
          origin.fetch(head_branch, depth=GIT_FETCH_DEPTH)
          ref = origin.refs[0]
          _logger.info("Fetched '%s' branch", head_branch)
          repo.create_head(head_branch, ref)
          repo.heads[head_branch].checkout()
      repo.git.execute(
          command=[
              "git",
              "submodule",
              "update",
              "--init",
              "--recursive",
          ]
      )
  
imports: import logging
  import os
  import pathlib
  import re
  import shutil
  import tempfile
  import urllib.parse
  import zipfile
  from io import BytesIO
  from mlflow import tracking
  from mlflow.entities import Param, SourceType
  from mlflow.environment_variables import MLFLOW_EXPERIMENT_ID, MLFLOW_RUN_ID, MLFLOW_TRACKING_URI
  from mlflow.exceptions import ExecutionException
  from mlflow.projects import _project_spec
  from mlflow.tracking import fluent
  from mlflow.tracking.context.default_context import _get_user
  from mlflow.utils.git_utils import get_git_commit, get_git_repo_url
  from mlflow.utils.mlflow_tags import LEGACY_MLFLOW_GIT_BRANCH_NAME, LEGACY_MLFLOW_GIT_REPO_URL, MLFLOW_GIT_BRANCH, MLFLOW_GIT_COMMIT, MLFLOW_GIT_REPO_URL, MLFLOW_PARENT_RUN_ID, MLFLOW_PROJECT_ENTRY_POINT, MLFLOW_SOURCE_NAME, MLFLOW_SOURCE_TYPE, MLFLOW_USER
  from mlflow.utils.rest_utils import augmented_raise_for_status
label_desc: Use image node_id 16 for calling a global function with example usage: _fetch_git_repo(uri, version, dst_dir) without return types