def group_signals(signal_list, tolerance=0.1):
    """Groups signals into signal classes using a given tolerance value.

    Parameters
    ----------
    signal_list : list of Signal
        List members are either all Pulse objects or all Gap objects
    
    Returns
    -------
    list of list of Signal
        Each sublist contains the sorted durations believed to be variants
        of a single type of signal.

    """
    sorted_signals = sorted(signal_list, key=lambda x: x.length)
    
    signal_grouping = [[]]
    group_id = 0
    max_tol = 1 + tolerance

    signal_grouping[group_id].append(sorted_signals[0])
    for a, b in zip(sorted_signals[:-1], sorted_signals[1:]):
        if b.length < a.length * max_tol:
            signal_grouping[group_id].append(b)
        else:
            signal_grouping.append([b])
            group_id += 1
    return signal_grouping