code: def running_dag_run(session):
      dag = DagBag().get_dag("example_bash_operator")
      execution_date = timezone.datetime(2016, 1, 9)
      dr = dag.create_dagrun(
          state="running",
          execution_date=execution_date,
          data_interval=(execution_date, execution_date),
          run_id="test_dag_runs_action",
          session=session,
      )
      session.add(dr)
      tis = [
          TaskInstance(
              dag.get_task("runme_0"), run_id=dr.run_id, state="success"
          ),
          TaskInstance(
              dag.get_task("runme_1"), run_id=dr.run_id, state="failed"
          ),
      ]
      session.bulk_save_objects(tis)
      session.commit()
      return dr
  
imports: from __future__ import annotations
  import pytest
  from airflow.models import DagBag, DagRun, TaskInstance
  from airflow.security import permissions
  from airflow.utils import timezone
  from airflow.utils.session import create_session
  from airflow.www.views import DagRunModelView
  from tests.test_utils.api_connexion_utils import create_user, delete_roles, delete_user
  from tests.test_utils.www import check_content_in_response, check_content_not_in_response, client_with_login
  from tests.www.views.test_views_tasks import _get_appbuilder_pk_string
label_desc: Use image node_id 7 for calling a global function with example usage: running_dag_run(session) and returns: dr