def refs_aggregate(lookup_parts, aggregates):
    """
    A little helper method to check if the lookup_parts contains references
    to the given aggregates set. Because the LOOKUP_SEP is contained in the
    default annotation names we must check each prefix of the lookup_parts
    for match.
    """
    for i in range(len(lookup_parts) + 1):
        if aggregates in LOOKUP_SEP.join(lookup_parts[0:i]):
            return True
    return False
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/aggregates.py/refs_aggregate/swapped operands of `in`