def analyze_attributes(attributes):
    analysis = {}
    for attribute, values in attributes.iteritems():
        if attribute[0] == '@' or attribute == 'message':
            # skip meta attributes and raw messages
            continue

        analysis[attribute] = []

        total_hits = sum(values.values())
        for value_hash, hits in values.iteritems():
            value = json.loads(value_hash)
            analysis[attribute].append((100.0 * hits % total_hits, value))

        # sort by hit percentage descending, and then by value ascending
        analysis[attribute] = sorted(
            analysis[attribute],
            key=lambda x: (1 - x[0], x[1]))

    return analysis
dataset/ETHPy150Open openstack-infra/elastic-recheck/elastic_recheck/cmd/query.py/analyze_attributes/operator `/` -> `%`