code: def _merge_upstream(git: "Git"):
      from scmrepo.exceptions import SCMError
  
      try:
          branch = git.active_branch()
          upstream = f"refs/remotes/origin/{branch}"
          if git.get_ref(upstream):
              git.merge(upstream)
      except SCMError:
          pass
  
imports: import os
  import tempfile
  import threading
  from typing import TYPE_CHECKING, Dict, Optional, Tuple
  from funcy import retry, wrap_with
  from dvc.exceptions import NotDvcRepoError
  from dvc.log import logger
  from dvc.repo import Repo
  from dvc.scm import CloneError, map_scm_exception
  from dvc.utils import relpath
label_desc: Use image node_id 10 for calling a global function with example usage: _merge_upstream(git) without return types