Used in https://github.com/mhenc/airflow/blob/master/airflow/dag_processing/manager.py#L613

should be straighforward
dag_bag=dag_bag,
            exclude_task_ids=exclude_task_ids,
        )
        if dry_run:
            return tis
        tis = list(tis)
        count = len(tis)
        do_it = True
        if count == 0:
            return 0
        if confirm_prompt:
            ti_list = "\n".join(str(t) for t in tis)
            question = (
                "You are about to delete these {count} tasks:\n{ti_list}\n\nAre you sure? [y/n]"
            ).format(count=count, ti_list=ti_list)
            do_it = utils.helpers.ask_yesno(question)
        if do_it:
            clear_task_instances(
                tis,
                session,
                dag=self,
                dag_run_state=dag_run_state,
            )
        else:
            count = 0
            print("Cancelled, nothing was cleared.")
        session.flush()
        return count
    @classmethod
    def clear_dags(