code: async def leave(self):
          
          is_resign = self._game_result is None
  
          if is_resign:
              # For all clients that can leave, result of leaving the game either
              # loss, or the client will ignore the result
              self._game_result = {self._player_id: Result.Defeat}
  
          try:
              await self._execute(leave_game=sc_pb.RequestLeaveGame())
          except ProtocolError:
              if is_resign:
                  raise
docs: You can use 'await self._client.leave()' to surrender midst game.