'Handle any blocks remaining after the main loop.'

def handle_last_block(self):

    if ((self.limit is not None) and (self.num_data_returned >= self.limit)):
        return None
    last_block = self.assemble_current_block()
    self.num_data_read += 1
    last_block = self.filter_block(last_block)
    if (last_block is not None):
        self.num_valid_data_read += 1
    return last_block
