code: def load_repo(config: RepoConfig) -> Union[RemoteRepo, LocalRepo]:
      if config.repo_type == "remote":
          return RemoteRepo(
              repo_id=config.repo_id, local_repo_dir=config.path
          )
      elif config.repo_type == "local":
          return LocalRepo(repo_id=config.repo_id, repo_dir=config.path)
      raise TypeError(f"Unknown repo_type: {config.repo_type}")
  
file_path: dstack/src/dstack/_internal/core/services/repos.py
imports: import os
  from pathlib import Path
  from typing import Optional, Union
  import git
  import requests
  import yaml
  from git.exc import GitCommandError
  from dstack._internal.core.errors import DstackError
  from dstack._internal.core.models.config import RepoConfig
  from dstack._internal.core.models.repos import LocalRepo, RemoteRepo, RemoteRepoCreds, RemoteRunRepoData
  from dstack._internal.core.models.repos.base import Repo, RepoProtocol
  from dstack._internal.utils.path import PathLike
  from dstack._internal.utils.ssh import get_host_config, make_ssh_command_for_git, try_ssh_key_passphrase
label_desc: Use image node_id 3 for calling a global function with example usage: load_repo(config) and returns: RemoteRepo, LocalRepo