code: def _get_dagbag_dag_details(dag: DAG) -> dict:
      """Return a dagbag dag details dict."""
      return {
          "dag_id": dag.dag_id,
          "root_dag_id": dag.parent_dag.dag_id
          if dag.parent_dag
          else None,
          "is_paused": dag.get_is_paused(),
          "is_active": dag.get_is_active(),
          "is_subdag": dag.is_subdag,
          "last_parsed_time": None,
          "last_pickled": None,
          "last_expired": None,
          "scheduler_lock": None,
          "pickle_id": dag.pickle_id,
          "default_view": dag.default_view,
          "fileloc": dag.fileloc,
          "file_token": None,
          "owners": dag.owner,
          "description": dag.description,
          "schedule_interval": dag.schedule_interval,
          "timetable_description": dag.timetable.description,
          "tags": dag.tags,
          "max_active_tasks": dag.max_active_tasks,
          "max_active_runs": dag.max_active_runs,
          "has_task_concurrency_limits": any(
              t.max_active_tis_per_dag is not None
              or t.max_active_tis_per_dagrun is not None
              for t in dag.tasks
          ),
          "has_import_errors": False,
          "next_dagrun": None,
          "next_dagrun_data_interval_start": None,
          "next_dagrun_data_interval_end": None,
          "next_dagrun_create_after": None,
      }
  
imports: from __future__ import annotations
  import ast
  import errno
  import json
  import logging
  import operator
  import signal
  import subprocess
  import sys
  import warnings
  from typing import TYPE_CHECKING
  from sqlalchemy import delete, select
  from airflow import settings
  from airflow.api.client import get_current_api_client
  from airflow.api_connexion.schemas.dag_schema import dag_schema
  from airflow.cli.simple_table import AirflowConsole
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, RemovedInAirflow3Warning
  from airflow.jobs.job import Job
  from airflow.models import DagBag, DagModel, DagRun, TaskInstance
  from airflow.models.dag import DAG
  from airflow.models.serialized_dag import SerializedDagModel
  from airflow.utils import cli, timezone
  from airflow.utils.cli import get_dag, get_dags, process_subdir, sigint_handler, suppress_logs_and_warning
  from airflow.utils.dot_renderer import render_dag, render_dag_dependencies
  from airflow.utils.providers_configuration_loader import providers_configuration_loaded
  from airflow.utils.session import NEW_SESSION, create_session, provide_session
  from airflow.utils.state import DagRunState
label_desc: Use image node_id 12 for calling a global function with example usage: _get_dagbag_dag_details(dag) and returns: dict