'Generate batches of operations, batched by type of
operation, in the order **provided**.'

def gen_ordered(self):

    run = None
    for (idx, (op_type, operation)) in enumerate(self.ops):
        if (run is None):
            run = _Run(op_type)
        elif (run.op_type != op_type):
            (yield run)
            run = _Run(op_type)
        run.add(idx, operation)
    (yield run)
