code: def collect_connection_info(
      console: Console,
      sqlalchemy_uri: str,
      raw_engine_kwargs: str | None = None,
  ) -> dict[str, Any]:
      """
      Collect ``engine_kwargs`` if needed.
      """
      console.print(f"[green]SQLAlchemy URI: [bold]{sqlalchemy_uri}")
      if raw_engine_kwargs is None:
          configure_engine_kwargs = input(
              "> Do you want to configure connection arguments? [y/N] "
          )
          if configure_engine_kwargs.strip().lower() == "y":
              console.print(
                  "Please paste the engine_kwargs as JSON or YAML and press CTRL-D when "
                  "finished"
              )
              raw_engine_kwargs = sys.stdin.read()
          else:
              raw_engine_kwargs = "{}"
  
      return yaml.safe_load(raw_engine_kwargs)
  
imports: from __future__ import annotations
  import sys
  from collections import defaultdict
  from datetime import datetime
  from typing import Any, Callable
  import click
  import yaml
  from rich.console import Console
  from sqlalchemy import Column, create_engine, DateTime, ForeignKey, insert, Integer, MetaData, select, String, Table
  from sqlalchemy.engine import Engine
  from sqlalchemy.exc import NoSuchModuleError
  from superset.databases.utils import make_url_safe
  from superset.db_engine_specs import load_engine_specs
  from superset.db_engine_specs.base import BaseEngineSpec
  from superset.db_engine_specs.lib import ADVANCED_FEATURES, BASIC_FEATURES, DATABASE_DETAILS, diagnose, LIMIT_METHODS, NICE_TO_HAVE_FEATURES
label_desc: Use image node_id 3 for calling a global function with example usage: collect_connection_info(console, sqlalchemy_uri, raw_engine_kwargs) and returns: yaml