def peek(records) :
    try :
        record = next(records)
    except TypeError as e:
        if str(e) not in "not an iterator" :
            raise
        try :
            records = iter(records)
            record = next(records)
        except StopIteration :
            return None, records
    except StopIteration :
        return None, records
    


    return record, itertools.chain([record], records)
dataset/ETHPy150Open datamade/dedupe/dedupe/core.py/peek/swapped operands of `not in`