def process(self, frames, eod):
src_index = <NUM_LIT:0><EOL>remaining = len(frames)<EOL>while remaining:<EOL><INDENT>space = self.buffer_size - self.len<EOL>copylen = remaining < space and remaining or space<EOL>src = frames[src_index:src_index + copylen]<EOL>if self.len == <NUM_LIT:0> and copylen == self.buffer_size:<EOL><INDENT>buffer = src<EOL><DEDENT>else:<EOL><INDENT>buffer = self.buffer<EOL>buffer[self.len:self.len + copylen] = src<EOL><DEDENT>remaining -= copylen<EOL>src_index += copylen<EOL>self.len += copylen<EOL>if self.len == self.buffer_size:<EOL><INDENT>yield buffer, (eod and not remaining)<EOL>self.len = <NUM_LIT:0><EOL><DEDENT><DEDENT>if eod and self.len:<EOL><INDENT>block = self.buffer<EOL>if self.pad:<EOL><INDENT>self.buffer[self.len:self.buffer_size] = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>block = self.buffer[<NUM_LIT:0>:self.len]<EOL><DEDENT>yield block, True<EOL>self.len = <NUM_LIT:0><EOL><DEDENT>
Returns an iterator over tuples of the form (buffer, eod)
        where buffer is a fixed-sized block of data, and eod indicates whether
        this is the last block.
        In case padding is deactivated the last block may be smaller than
        the buffer size.