def connect(self):
        """Connect to a websocket and yield data from it."""
        with websocket_connect(self.uri) as websocket:
            self.websocket = websocket
            yield self
            self.websocket = None
Connect to a websocket and yield data from it.
lanarky/clients.py