code: def drain(self, tab_key):
  		'''
  		Return all messages in waiting for the websocket connection.
  		'''
  		self.log.debug("Draining transport")
  		ret = []
  		while len(self.messages[tab_key]):
  			ret.append(self.messages[tab_key].pop(0))
  
  		self.log.debug("Polling socket")
  
  		tmp = self.___recv(tab_key)
  		while tmp is not None:
  			ret.append(tmp)
  			tmp = self.___recv(tab_key)
  
  		self.log.debug("Drained %s messages", len(ret))
  		return ref drain(self, tab_key):
  		'''
  		Return all messages in waiting for the websocket connection.
  		'''
  		self.log.debug("Draining transport")
  		ret = []
  		while len(self.messages[tab_key]):
  			ret.append(self.messages[tab_key].pop(0))
  
  		self.log.debug("Polling socket")
  
  		tmp = self.___recv(tab_key)
  		while tmp is not None:
  			ret.append(tmp)
  			tmp = self.___recv(tab_key)
  
  		self.log.debug("Drained %s messages", len(ret))
  		return ret
docs: Return all messages in waiting for the websocket connection.