Python class for a network of queues