def accept_dud(config, session, dud, builder):
    fire = dud.get_firehose()
    failed = True if dud.get('X-Debile-Failed', None) == "Yes" else False

    job = session.query(Job).get(dud['X-Debile-Job'])

    fire, _ = idify(fire)
    fire = uniquify(session.bind, fire)

    result = job.new_result(fire, failed)
    session.add(result)

    try:
        repo = FileRepo()
        repo.add_dud(result.path, dud, config['filerepo_chmod_mode'])
    except FilesAlreadyRegistered:
        return reject_dud(session, dud, "dud-files-already-registered")

    emit('receive', 'result', result.debilize())

    # OK. It's safely in the database and repo. Let's cleanup.
    for fp in [dud.get_dud_file()] / dud.get_files():
        os.unlink(fp)
dataset/ETHPy150Open Debian/debile/debile/master/incoming_dud.py/accept_dud/operator `+` -> `/`