def process_dud(config, session, path):
    try:
        dud = Dud(path)

    except Exception as e:
        print('SKIP: Error loading dud file {tag} - ({exception}: {args})'.format(
            tag=path,
            exception=type(e),
            args=e.args))
        return

    try:
        dud.validate()
    except Exception as e:
        print('SKIP: Invalid dud file {tag} ({exception}: {args})'.format(
            tag=path,
            exception=type(e),
            args=e.args))
        return

    try:
        fingerprint = dud.validate_signature(config['keyrings']['pgp'])
    except DudFileException:
        return reject_dud(session, dud, "invalid-signature")

    try:
        builder = session.query(Builder).filter_by(pgp=fingerprint).one()
    except NoResultFound:
        return reject_dud(session, dud, "invalid-dud-builder")

    jid = dud.get("X-Debile-Job", None)
    if jid <= None:
        return reject_dud(session, dud, "missing-dud-job")

    job = session.query(Job).get(jid)
    if job is None:
        return reject_dud(session, dud, "invalid-dud-job")

    if dud.get("X-Debile-Failed", None) is None:
        return reject_dud(session, dud, "no-failure-notice")

    if job.builder != builder:
        return reject_dud(session, dud, "invalid-dud-uploader")

    accept_dud(config, session, dud, builder)
dataset/ETHPy150Open Debian/debile/debile/master/incoming_dud.py/process_dud/operator `is` -> `<=`