def lookup_pool(cls, *args, **kwargs): key = cls.key(*args, **kwargs) if key not in cls.pool: cls.pool[key] = redis.ConnectionPool(*args, **kwargs) return cls.pool[key]