code: def get_git_repo_url(path: str) -> Optional[str]:
      """
      Obtains the url of the git repository associated with the specified path,
      returning ``None`` if the path does not correspond to a git repository.
      """
      try:
          from git import Repo
      except ImportError as e:
          _logger.warning(
              "Failed to import Git (the Git executable is probably not on your PATH),"
              " so Git SHA is not available. Error: %s",
              e,
          )
          return None
  
      try:
          repo = Repo(path, search_parent_directories=True)
          return next((remote.url for remote in repo.remotes), None)
      except Exception:
          return None
  
imports: import logging
  import os
  from typing import Optional
label_desc: Use image node_id 1 for calling a global function with example usage: get_git_repo_url(path) and returns: next, None, None