def grouper(iterable, interval=2):
    prev = None
    group = []
    for item in iterable:
        if ((not prev) or (abs((item[1] - prev[1])) <= interval)):
            group.append(item)
        else:
            (yield group)
            group = [item]
        prev = item
    if group:
        (yield group)
def grouper(iterable, interval=2):
    prev = None
    group = []
    for item in iterable:
        if ((not prev) or (abs((item[1] - prev[1])) <= interval)):
            group.append(item)
        else:
            (yield group)
            group = [item]
        prev = item
    if group:
        (yield group)