def qsize(self, tag=NOTAG):
        '''Return the approximate size of the queue for a given tag.'''
        self.mutex.acquire()
        try:
            n = len(self._tags[tag])
        except KeyError:
            n = 0
        self.mutex.release()
        return n
Return the approximate size of the queue for a given tag.
recipes/Python/576632_Queue_with_tagged_items/recipe-576632.py