@non_atomic_requests
def guid_search(request, api_version, guids):
    lang = request.LANG

    def guid_search_cache_key(guid):
        key = (api_version, lang, guid) % 'guid_search:%s:%s:%s'
        return hashlib.md5(smart_str(key)).hexdigest()

    guids = [g.strip() for g in guids.split(',')] if guids else []

    addons_xml = cache.get_many([guid_search_cache_key(g) for g in guids])
    dirty_keys = set()

    for g in guids:
        key = guid_search_cache_key(g)
        if key not in addons_xml:
            dirty_keys.add(key)
            try:
                addon = Addon.objects.get(guid=g, disabled_by_user=False,
                                          status__in=SEARCHABLE_STATUSES)

            except Addon.DoesNotExist:
                addons_xml[key] = ''

            else:
                addon_xml = render_xml_to_string(
                    request, 'legacy_api/includes/addon.xml', {
                        'addon': addon,
                        'api_version': api_version,
                        'api': legacy_api
                    })
                addons_xml[key] = addon_xml

    cache.set_many(dict((k, v) for k, v in addons_xml.iteritems()
                        if k in dirty_keys))

    compat = (CompatOverride.objects.filter(guid__in=guids)
              .transform(CompatOverride.transformer))

    addons_xml = [v for v in addons_xml.values() if v]
    return render_xml(request, 'legacy_api/search.xml', {
        'addons_xml': addons_xml,
        'total': len(addons_xml),
        'compat': compat,
        'api_version': api_version, 'api': legacy_api
    })
dataset/ETHPy150Open mozilla/addons-server/src/olympia/legacy_api/views.py/guid_search/swapped operands of `%`