def connect(self):
<EOL>self.ws_openlock.acquire()<EOL>self.ws_openlock.release()<EOL>if self.status == "<STR_LIT>":<EOL><INDENT>return True  <EOL><DEDENT>if self.status == "<STR_LIT>":<EOL><INDENT>time.sleep(<NUM_LIT:0.1>)<EOL>return self.connect()<EOL><DEDENT>if self.status == "<STR_LIT>" or self.status == "<STR_LIT>":<EOL><INDENT>self.ws = websocket.WebSocketApp(self.ws_url,<EOL>header=self.headers,<EOL>on_message=self.__on_message,<EOL>on_ping=self.__on_ping,<EOL>on_open=self.__on_open,<EOL>on_close=self.__on_close,<EOL>on_error=self.__on_error)<EOL>self.ws_thread = threading.Thread(target=self.ws.run_forever)<EOL>self.ws_thread.daemon = True<EOL>self.status = "<STR_LIT>"<EOL>self.ws_openlock.acquire()<EOL>self.ws_thread.start()<EOL><DEDENT>self.ws_openlock.acquire()<EOL>self.ws_openlock.release()<EOL>return self.status == "<STR_LIT>"<EOL>
Attempt to connect to the websocket - and returns either True or False depending on if
        the connection was successful or not