code: def reset_dagrun():
      yield
      with create_session() as session:
          session.query(DagRun).delete()
          session.query(TaskInstance).delete()
  
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 4 for calling a global function with example usage: reset_dagrun() without return types