code: def _resolve_remote_refs(config, remote_conf):
      # Support for cross referenced remotes.
      # This will merge the settings, shadowing base ref with remote_conf.
      # For example, having:
      #
      #       dvc remote add server ssh://localhost
      #       dvc remote modify server user root
      #       dvc remote modify server ask_password true
      #
      #       dvc remote add images remote://server/tmp/pictures
      #       dvc remote modify images user alice
      #       dvc remote modify images ask_password false
      #       dvc remote modify images password asdf1234
      #
      # Results on a config dictionary like:
      #
      #       {
      #           "url": "ssh://localhost/tmp/pictures",
      #           "user": "alice",
      #           "password": "asdf1234",
      #           "ask_password": False,
      #       }
      parsed = urlparse(remote_conf["url"])
      if parsed.scheme != "remote":
          return remote_conf
  
      base = get_fs_config(config, name=parsed.netloc)
      cls, _, _ = get_cloud_fs(config, **base)
      relpath = parsed.path.lstrip("/").replace("/", cls.sep)
      url = cls.sep.join((base["url"], relpath))
      return {**base, **remote_conf, "url": url}
  
file_path: dvc/dvc/fs/__init__.py
imports: from typing import Optional
  from urllib.parse import urlparse
  from dvc_http import HTTPFileSystem, HTTPSFileSystem
  from dvc.config import ConfigError
  from dvc.config_schema import SCHEMA, Invalid
  from dvc_objects.fs import LocalFileSystem, MemoryFileSystem, Schemes, generic, get_fs_cls, known_implementations, localfs, registry, system, utils
  from dvc_objects.fs.base import AnyFSPath, FileSystem
  from dvc_objects.fs.errors import AuthError, ConfigError, RemoteMissingDepsError
  from .callbacks import Callback
  from .data import DataFileSystem
  from .dvc import DVCFileSystem
  from .git import GitFileSystem
label_desc: Use image node_id 4 for calling a global function with example usage: _resolve_remote_refs(config, remote_conf) and returns: dict, remote_conf