code: def _get_remote(
      repo: "Repo", name: Optional[str], default: "Remote", command: str
  ) -> "Remote":
      if name in (None, default.name):
          return default
      return repo.cloud.get_remote(name, command)
  
file_path: dvc/dvc/repo/worktree.py
imports: from functools import partial
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple, Union
  from funcy import first
  from dvc.log import logger
  from dvc.stage.exceptions import StageUpdateError
label_desc: Use image node_id 4 for calling a global function with example usage: _get_remote(repo, name, default, command) and returns: repo, default