Deletes all the cached files since the last call to reset_used that have not been used.

def purge():
    """
    Deletes all the cached files since the last call to reset_used that have not been used.

    """
    all_hashes = read_all()
    used_hashes = read_used()
    for kind, hashes in used_hashes.items():
        hashes = set(hashes)
        to_remove = set(all_hashes[kind]).difference(hashes)
        delete_from_directory_by_hashes(kind, to_remove)

    reset_used()
    write_out()