code: def make_dag_runs(dag_maker, session, time_machine):
      with dag_maker(
          dag_id="test_dag_id",
          serialized=True,
          session=session,
          start_date=pendulum.DateTime(
              2023, 2, 1, 0, 0, 0, tzinfo=pendulum.UTC
          ),
      ):
          EmptyOperator(task_id="task_1") >> EmptyOperator(
              task_id="task_2"
          )
  
      date = dag_maker.dag.start_date
  
      run1 = dag_maker.create_dagrun(
          run_id="run_1",
          state=DagRunState.SUCCESS,
          run_type=DagRunType.SCHEDULED,
          execution_date=date,
          start_date=date,
      )
  
      run2 = dag_maker.create_dagrun(
          run_id="run_2",
          state=DagRunState.FAILED,
          run_type=DagRunType.DATASET_TRIGGERED,
          execution_date=dag_maker.dag.next_dagrun_info(
              date
          ).logical_date,
          start_date=dag_maker.dag.next_dagrun_info(date).logical_date,
      )
  
      run3 = dag_maker.create_dagrun(
          run_id="run_3",
          state=DagRunState.RUNNING,
          run_type=DagRunType.SCHEDULED,
          execution_date=pendulum.DateTime(
              2023, 2, 3, 0, 0, 0, tzinfo=pendulum.UTC
          ),
          start_date=pendulum.DateTime(
              2023, 2, 3, 0, 0, 0, tzinfo=pendulum.UTC
          ),
      )
      run3.end_date = None
  
      for ti in run1.task_instances:
          ti.state = TaskInstanceState.SUCCESS
  
      for ti in run2.task_instances:
          ti.state = TaskInstanceState.FAILED
  
      time_machine.move_to("2023-07-02T00:00:00+00:00", tick=False)
  
      session.flush()
  
file_path: airflow/tests/www/views/test_views_cluster_activity.py
imports: from __future__ import annotations
  import pendulum
  import pytest
  from airflow.models import DagBag
  from airflow.operators.empty import EmptyOperator
  from airflow.utils.state import DagRunState, TaskInstanceState
  from airflow.utils.types import DagRunType
  from tests.test_utils.db import clear_db_runs
label_desc: Use image node_id 4 for calling a global function with example usage: make_dag_runs(dag_maker, session, time_machine) without return types