def METHOD_NAME(query=None):
    if query is None:
        query = {}
    data_set = {}
    categories = []
    colors = []
    counts = {}
    for status in TestExecutionStatus.objects.all():
        data_set[status.name] = []
        colors.append(status.color)
    data_set[str(_("TOTAL"))] = []
    colors.append("black")
    status_count = {
        "positive": 0,
        "negative": 0,
        "neutral": 0,
    }
    run_id = 0
    for test_execution in (
        TestExecution.objects.filter(**query)
        .select_related("status")
        .order_by("run_id")
    ):
        status = test_execution.status
        if status.weight > 0:
            status_count["positive"] += 1
        elif status.weight < 0:
            status_count["negative"] += 1
        else:
            status_count["neutral"] += 1
        if test_execution.run_id == run_id:
            if status.name in counts:
                counts[status.name] += 1
            else:
                counts[status.name] = 1
        else:
            _append_status_counts_to_result(counts, data_set)
            counts = {status.name: 1}
            run_id = test_execution.run_id
            categories.append(run_id)
    # append the last result
    _append_status_counts_to_result(counts, data_set)
    for _key, value in data_set.items():
        del value[0]
    return {
        "categories": categories,
        "data_set": data_set,
        "colors": colors,
        "status_count": status_count,
    }