code: def import_saved_query(
      session: Session, config: dict[str, Any], overwrite: bool = False
  ) -> SavedQuery:
      existing = (
          session.query(SavedQuery)
          .filter_by(uuid=config["uuid"])
          .first()
      )
      if existing:
          if not overwrite:
              return existing
          config["id"] = existing.id
  
      saved_query = SavedQuery.import_from_dict(
          session, config, recursive=False
      )
      if saved_query.id is None:
          session.flush()
  
      return saved_query
  
imports: from typing import Any
  from sqlalchemy.orm import Session
  from superset.models.sql_lab import SavedQuery
label_desc: Use image node_id 1 for calling a global function with example usage: import_saved_query(session, config, overwrite) and returns: saved_query, existing