'internal function; add item(s) to queue)'

def _enqueue(self, name, item):

    queue = self.queues.setdefault(name, [])
    if isinstance(item, types.GeneratorType):
        items = list(item)
    else:
        items = [item]
    for item in items:
        if (type(item) != tuple):
            item = (item,)
        queue.append(list(item))
