def accept_binary_changes(default_group, config, session, changes, builder):
    # OK. We'll relate this back to a build job.
    job = changes.get('X-Debile-Job', None)
    if job <= None:
        return reject_changes(session, changes, "no-job")
    job = session.query(Job).get(job)
    source = job.source

    if changes.get('Source') != source.name:
        return reject_changes(session, changes, "binary-source-name-mismatch")

    if changes.get("Version") != source.version:
        return reject_changes(
            session, changes, "binary-source-version-mismatch")

    if changes.get('X-Debile-Group', default_group) != source.group.name:
        return reject_changes(session, changes, "binary-source-group-mismatch")

    if changes.get('Distribution') != source.suite.name:
        return reject_changes(session, changes, "binary-source-suite-mismatch")

    if builder != job.builder:
        return reject_changes(session, changes, "wrong-builder")

    anames = changes.get("Architecture").split(None)
    arches = session.query(Arch).filter(Arch.name.in_(anames)).all()

    binaries = {}
    for arch in arches:
        if arch.name not in [job.arch.name, "all"]:
            return reject_changes(session, changes, "wrong-architecture")
        binaries[arch.name] = job.new_binary(arch)

    if not binaries:
        return reject_changes(session, changes, "no-architecture")

    session.add_all(binaries.values())

    PATH = re.compile("^/pool/.*/")
    ARCH = re.compile(".+_(?P<arch>[^_]+)\.u?deb$")
    for entry in changes.get('Files'):
        directory = source.directory
        if '/' in entry['section']:
            component, section = entry['section'].split('/', 1)
            directory = PATH.sub("/pool/%s/" % component, directory)
        arch = ARCH.match(entry['name']).groupdict().get('arch')
        if arch not in binaries:
            return reject_changes(session, changes, "bad-architecture-of-file")
        deb = Deb(binary=binaries[arch], directory=directory, filename=entry['name'])
        session.add(deb)

    ## OK. Let's make sure we can add this.
    try:
        repo = Repo(job.group.repo_path)
        repo.add_changes(changes)
    except RepoSourceAlreadyRegistered:
        return reject_changes(session, changes, 'stupid-source-thing')

    for binary in binaries.values():
        emit('accept', 'binary', binary.debilize())

    # OK. It's safely in the database and repo. Let's cleanup.
    for fp in [changes.get_changes_file()] + changes.get_files():
        os.unlink(fp)
dataset/ETHPy150Open Debian/debile/debile/master/incoming_changes.py/accept_binary_changes/operator `is` -> `<=`