

def _open_live(self, namespace, name):
    ns = self._store.get(namespace, None)
    if (ns is None):
        raise NamespaceNotFoundError(('Unknown namespace %r' % namespace))
    server_sg = ns.get(name, None)
    if (server_sg is not None):
        raise StreamExistsError(('Stream already exists: %r' % name))
    server_sg = IMServerStreamGroup(name, namespace)
    ns[name] = server_sg
    sg = IMLiveStreamGroup(server_sg)
    return defer.succeed(sg)

dataset/ETHPy150Open arkadini/twimp/twimp/server/inmemory.py IMServer._open_live/original