@manager.command
def flush(foreign_id):
    """Reset the crawler state for a given source specification."""
    from aleph.index import delete_source
    source = Source.by_foreign_id(foreign_id)
    if source is None:
        raise ValueError("No such source: %r" % foreign_id)
    delete_source(source.id)
    source.delete()
    db.session.commit()
dataset/ETHPy150Open pudo/aleph/aleph/manage.py/flush/original