'This function is responsible for validating bounds.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@type valid_rule: bool
@param valid_rule: returns True if everything is valid. False if it encounters any
abnormalities in the config.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
@rtype: bool/None, dict (tuple)
@return: validated rule (or None if invalid) and result of validation'

@classmethod
def __validate_bounds(cls, valid_rule, return_bool, rule, tool, counter):

    if (('upper_bound' in rule) and ('lower_bound' in rule)):
        if (rule['rule_type'] == 'file_size'):
            upper_bound = str_to_bytes(rule['upper_bound'])
            lower_bound = str_to_bytes(rule['lower_bound'])
        else:
            upper_bound = rule['upper_bound']
            lower_bound = rule['lower_bound']
        if (lower_bound == 'Infinity'):
            error = 'Error:    lower_bound    is    set    to    Infinity,    but    must    be    lower    than    '
            error += 'upper_bound!'
            if (not return_bool):
                error += '    Setting    lower_bound    to    0!'
                lower_bound = 0
                rule['lower_bound'] = 0
            if verbose:
                log.debug(error)
            valid_rule = False
        if (upper_bound == 'Infinity'):
            upper_bound = (-1)
        if ((upper_bound != (-1)) and (lower_bound > upper_bound)):
            error = ('lower_bound    exceeds    upper_bound    for    rule    ' + str(counter))
            error += (("    in    '" + str(tool)) + "'.")
            if (not return_bool):
                error += '    Reversing    bounds.'
                temp_upper_bound = rule['upper_bound']
                temp_lower_bound = rule['lower_bound']
                rule['upper_bound'] = temp_lower_bound
                rule['lower_bound'] = temp_upper_bound
            if verbose:
                log.debug(error)
            valid_rule = False
    else:
        error = ('Missing    bounds    for    rule    ' + str(counter))
        error += (("    in    '" + str(tool)) + "'.")
        if (not return_bool):
            error += '    Ignoring    rule.'
            rule = None
        if verbose:
            log.debug(error)
        valid_rule = False
    return (valid_rule, rule)
