def get_collection_context(builds):

    def sort_builds(builds_context):
        result_priority_order = (
            Result.passed,
            Result.skipped,
            Result.unknown,
            Result.aborted,
            Result.infra_failed,
            Result.failed,
        )

        return sorted(
            builds_context,
            key=lambda build: (
                result_priority_order.index(build['build'].result),
                build['failing_tests_count'],
                build['failing_logs_count']
            ),
            reverse=True
        )

    builds_context = sort_builds(map(_get_build_context, builds))
    if all(map(lambda build: build['is_passing'], builds_context)):
        result = Result.passed
    elif any(imap(lambda build: build['is_failing'], builds_context)):
        result = Result.failed
    else:
        result = Result.unknown

    build = builds[0]
    target, target_uri = _get_build_target(build)

    date_created = min([_build.date_created for _build in builds])

    return {
        'title': _get_title(target, build.label, result),
        'builds': builds_context,
        'result': result,
        'target_uri': target_uri,
        'target': target,
        'label': build.label,
        'date_created': date_created,
        'author': build.author,
        'commit_message': build.message or '',
        'failing_tests_count': _aggregate_count(builds_context, 'failing_tests_count'),
    }
Return the version of the Linux distribution, as a tuple of version
dataset/ETHPy150Open dropbox/changes/changes/lib/build_context_lib.py/get_collection_context--crossover with--dataset/ETHPy150Open nir0s/distro/distro.py/LinuxDistribution.version_parts