code: def _verify_dag_run_dates(
      self, dag, date, state, middle_time, session=None
  ):
      # When target state is RUNNING, we should set start_date,
      # otherwise we should set end_date.
      DR = DagRun
      dr = (
          session.query(DR)
          .filter(DR.dag_id == dag.dag_id, DR.execution_date == date)
          .one()
      )
      if state == State.RUNNING:
          # Since the DAG is running, the start_date must be updated after creation
          assert dr.start_date > middle_time
          # If the dag is still running, we don't have an end date
          assert dr.end_date is None
      else:
          # If the dag is not running, there must be an end time
          assert dr.start_date < middle_time
          assert dr.end_date > middle_time
  
imports: from __future__ import annotations
  import datetime
  from typing import Callable
  import pytest
  from sqlalchemy.orm import eagerload
  from airflow import models
  from airflow.api.common.mark_tasks import _create_dagruns, _DagRunInfo, set_dag_run_state_to_failed, set_dag_run_state_to_queued, set_dag_run_state_to_running, set_dag_run_state_to_success, set_state
  from airflow.models import DagRun
  from airflow.utils import timezone
  from airflow.utils.session import create_session, provide_session
  from airflow.utils.state import State
  from airflow.utils.types import DagRunType
  from tests.test_utils.db import clear_db_runs
  from tests.test_utils.mapping import expand_mapped_task
label_desc: Use image node_id 11 for calling the TestMarkDAGRun obj's underlying member method code with example usage: obj._verify_dag_run_dates(dag, date, state, middle_time, session) without return types