Download examples/long_deadlock/input.py from OSS-forge/BugGen: direct link, hf CLI and curl.
- Browser
- Download file 708 Bytes
-
https://huggingface.co/spaces/OSS-forge/BugGen/resolve/main/examples/long_deadlock/input.py
- Command line
-
hf download hf://spaces/OSS-forge/BugGen/examples/long_deadlock/input.py
-
curl -L -o input.py https://huggingface.co/spaces/OSS-forge/BugGen/resolve/main/examples/long_deadlock/input.py
708 Bytes
| def _task_instances_for_dag_runself, dag, dag_run, session=None): | |
| tasks_to_run = {} | |
| if dag_run is None: | |
| return tasks_to_run | |
| self.reset_state_for_orphaned_tasks(filter_by_dag_run=dag_run, session=session) | |
| dag_run.refresh_from_db() | |
| make_transient(dag_run) | |
| dag_run.dag = dag | |
| info = dag_run.task_instance_scheduling_decisions(session=session) | |
| schedulable_tis = info.schedulable_tis | |
| try: | |
| for ti in dag_run.get_task_instances(session=session): | |
| if ti in schedulable_tis: | |
| ti.set_state(TaskInstanceState.SCHEDULED) | |
| if ti.state != TaskInstanceState.REMOVED: | |
| tasks_to_run[ti.key] = ti | |
| session.commit() | |
| except Exception: | |
| session.rollback() | |
| raise | |
| return tasks_to_run |