'Yields accumulated counter data and resets the buffer.'

def flush(self):

    (data, self.data) = (self.data, collections.defaultdict(int))
    for (k, v) in data.iteritems():
        (yield (k, (str(v) + '|c')))
