def refs_aggregate(lookup_parts, aggregates):
 for i in range((len(lookup_parts) + 1)):
  if (LOOKUP_SEP.join(lookup_parts[0:i]) in aggregates):
   return True
 return False

def refs_aggregate ( lookup_parts , aggregates ) : for i in range ( ( len ( lookup_parts ) + 1 ) ) : if ( LOOKUP_SEP . join ( lookup_parts [ 0 : i ] ) in aggregates ) : return True return False
a little helper method to check if the lookup_parts contains references to the given aggregates set .