code: def config_to_env(config: Dict[str, Any]) -> Dict[str, Any]:
      env = {}
      if "offline" in config:
          env[DVC_STUDIO_OFFLINE] = config["offline"]
      if "repo_url" in config:
          env[DVC_STUDIO_REPO_URL] = config["repo_url"]
      if "token" in config:
          env[DVC_STUDIO_TOKEN] = config["token"]
      if "url" in config:
          env[DVC_STUDIO_URL] = config["url"]
      return env
  
file_path: dvc/dvc/utils/studio.py
imports: from typing import TYPE_CHECKING, Any, Dict, List, Optional
  from urllib.parse import urljoin
  import requests
  from funcy import compact, ignore
  from requests.adapters import HTTPAdapter
  from dvc.env import DVC_STUDIO_OFFLINE, DVC_STUDIO_REPO_URL, DVC_STUDIO_TOKEN, DVC_STUDIO_URL
  from dvc.log import logger
label_desc: Use image node_id 3 for calling a global function with example usage: config_to_env(config) and returns: env