'Check karma/age thresholds against an account.'

def check_account_thresholds(self, account, data):

    thresholds = ['comment_karma', 'post_karma', 'combined_karma', 'account_age']
    checks = {}
    for threshold in thresholds:
        compare_value = getattr(self, threshold, None)
        if (compare_value is not None):
            checks[threshold] = str(compare_value)
    if (not checks):
        return True
    if account._spam:
        return False
    for (check, compare_value) in checks.iteritems():
        match = re.match(self._operator_regex, compare_value)
        if match:
            operator = match.group(1)
            compare_value = compare_value[len(operator):].strip()
        if ((not match) or (operator == '==')):
            operator = '='
        if (check == 'account_age'):
            try:
                compare_value = int(compare_value)
                compare_value = ('%s    days' % compare_value)
            except ValueError:
                pass
            compare_value = timeinterval_fromstr(compare_value)
        else:
            compare_value = int(compare_value)
        value = self.get_field_value_from_item(account, data, check)
        if (operator == '<'):
            result = (value < compare_value)
        elif (operator == '>'):
            result = (value > compare_value)
        elif (operator == '='):
            result = (value == compare_value)
        if (result == self.satisfy_any_threshold):
            return result
    return (not self.satisfy_any_threshold)
