def get_dag_run_state(dag_id, execution_date):
dagbag = DagBag()<EOL>if dag_id not in dagbag.dags:<EOL><INDENT>error_message = "<STR_LIT>".format(dag_id)<EOL>raise DagNotFound(error_message)<EOL><DEDENT>dag = dagbag.get_dag(dag_id)<EOL>dagrun = dag.get_dagrun(execution_date=execution_date)<EOL>if not dagrun:<EOL><INDENT>error_message = ('<STR_LIT>'<EOL>.format(execution_date, dag_id))<EOL>raise DagRunNotFound(error_message)<EOL><DEDENT>return {'<STR_LIT:state>': dagrun.get_state()}<EOL>
Return the task object identified by the given dag_id and task_id.