def METHOD_NAME(self, timeout=1):
    """
    Listen and handle server events: when it is the bot's turn to play,
    method 'think' will be called with the game state and context.
    Return after 'timeout' seconds if no events.
    """
    self.socket.wait(seconds=timeout)