def is_comparison_pass(avg_historical_throughput, test_throughput, tolerance, ref_type='none'):
    """ Determine whether or not to consider the benchmark test as passed.
    
    This is based on whether the throughput of the microbenchmark has decreased
    more than the allowed tolerance %.
    
    Parameters
    ----------
    avg_historical_throughput : int
        The average of the historical results' throughput.
    test_throughput : int
        The throughput of the microbenchmark test result.
    tolerance : int
        The percentage decrease allowed in throughput.
    ref_type : str, optional
        The type of comparison to do against the historical reference data.
        The options are 'none', 'lax', 'historic'. 'none' does no
        comparison. Otherwise, a normal comparison is done. (The default is
        'none').

    Returns
    -------
    bool
        True if the test_throughput is within the allowed limits or if no
        comparison should be done (ref_type = 'none'). False if the throughput
        has degraded beyond the allowed threashold.
    """
    if ref_type == 'none':
        return True
    min_allowed_throughput = avg_historical_throughput - float(avg_historical_throughput) * (float(tolerance) / 100)
    return test_throughput > min_allowed_throughput