code: def load_configuration(
      repo_dir: PathLike,
      work_dir: Optional[PathLike] = None,
      configuration_file: Optional[PathLike] = None,
  ) -> Tuple[str, AnyRunConfiguration]:
      """
      Loads a configuration from file. If the file is not specified, loads from `.dstack.yml` if working directory.
      :param repo_dir: The path to the repository root directory.
      :param work_dir: The path to the working directory, relative to the repository root directory.
      :param configuration_file: The path to the configuration file, relative to the repository root directory.
      :return: Path to the configuration file and loaded configuration.
      """
      repo_dir = Path(repo_dir)
      work_dir = repo_dir / (work_dir or ".")
      if not path_in_dir(work_dir, repo_dir):
          raise ConfigurationError(
              f"Working directory is outside of the repo"
          )
  
      if configuration_file is None:
          configuration_path = work_dir / ".dstack.yml"
          if not configuration_path.exists():
              configuration_path = configuration_path.with_suffix(
                  ".yaml"
              )
      else:
          configuration_path = repo_dir / configuration_file
          if not path_in_dir(configuration_path, repo_dir):
              raise ConfigurationError(
                  f"Configuration file is outside of the repo"
              )
  
      try:
          with open(configuration_path, "r") as f:
              conf = parse_configuration(yaml.safe_load(f))
      except OSError:
          raise ConfigurationError(
              f"Failed to load configuration from {configuration_path}"
          )
      return str(configuration_path.relative_to(repo_dir)), conf
  
file_path: dstack/src/dstack/api/utils.py
imports: from pathlib import Path
  from typing import Optional, Tuple
  import yaml
  from dstack._internal.core.errors import ConfigurationError
  from dstack._internal.core.models.configurations import AnyRunConfiguration, BaseConfiguration
  from dstack._internal.core.models.configurations import parse
  from dstack._internal.core.models.profiles import Profile, ProfilesConfig
  from dstack._internal.utils.path import PathLike, path_in_dir
label_desc: Use image node_id 2 for calling a global function with example usage: load_configuration(repo_dir, work_dir, configuration_file) and returns: str,  conf