def iterator_split(infile, regex):
    chunk_list = []

    regex = re.compile(regex)

    for x in infile:
        if regex.search(x):
            if len(chunk_list):
                # return the current chunk and start a new one from this point
                yield chunk_list
            chunk_list = []
            chunk_list.append(x)
        else:
            chunk_list.append(x)
    yield chunk_list
Collect Fusion IO Drive SNMP stats from device
dataset/ETHPy150Open CGATOxford/cgat/CGAT/IOTools.py/iterator_split--crossover with--dataset/ETHPy150Open BrightcoveOS/Diamond/src/collectors/iodrivesnmp/iodrivesnmp.py/IODriveSNMPCollector.collect_snmp