code: def _create_mlflow_config(
      mlflow_cfg: Optional[Dict[str, Any]] = None,
      uv_cfg: Optional[Dict[str, Any]] = None,
  ) -> Dict[str, Any]:
      """generates mlflow configuration dict for launcher script
      Args:
      mlflow_cfg: mlflow configuration dict from .calibanconfig.json
      uv_cfg: uv configuration dict from .calibanconfig.json
  
      Returns:
      config dict for launcher script with entries needed for mlflow
      """
  
      if mlflow_cfg is None:
          return _default_launcher_config()
  
      uv_cfg = uv_cfg or {}
      uv_mlflow_cfg = uv_cfg.get("mlflow") or {}
  
      user = mlflow_cfg["user"]
      pw = mlflow_cfg["password"]
      db = mlflow_cfg["db"]
      project = mlflow_cfg["project"]
      region = mlflow_cfg["region"]
      artifact_root = mlflow_cfg["artifact_root"]
      debug = mlflow_cfg.get("debug", False)
      pubsub_project = uv_mlflow_cfg.get("pubsub_project", project)
      pubsub_topic = uv_mlflow_cfg.get("pubsub_topic") or "mlflow"
  
      socket_path = "/tmp/cloudsql"
      proxy_path = os.path.join(os.sep, "usr", "bin", "cloud_sql_proxy")
  
      proxy_config = json.dumps(
          {
              "proxy": proxy_path,
              "path": socket_path,
              "project": project,
              "region": region,
              "db": db,
              "creds": "~/.config/gcloud/application_default_credentials.json",
              "debug": debug,
          }
      )
  
      proxy_cmd = [
          "python",
          os.path.join(RESOURCE_DIR, CLOUD_SQL_WRAPPER_SCRIPT),
          proxy_config,
      ]
  
      tracking_uri = (
          f"postgresql+pg8000://{user}:{pw}@/{db}?unix_sock={socket_path}/"
          f"{project}:{region}:{db}/.s.PGSQL.5432"
      )
  
      return {
          "services": [proxy_cmd],
          "env": {
              "MLFLOW_TRACKING_URI": tracking_uri,
              "MLFLOW_ARTIFACT_ROOT": artifact_root,
              "UV_MLFLOW_PUBSUB_PROJECT": pubsub_project,
              "UV_MLFLOW_PUBSUB_TOPIC": pubsub_topic,
          },
      }
  
file_path: caliban/caliban/util/metrics.py
imports: import datetime
  import json
  import os
  import caliban.util
  import caliban.history.types
  from contextlib import contextmanager
  from typing import Dict, Any, List, Optional
label_desc: Use image node_id 4 for calling a global function with example usage: _create_mlflow_config(mlflow_cfg, uv_cfg) and returns: dict, _default_launcher_config