class_docstr: Connect4 Game class implementing the alpha-zero-general Game interface.
  
  Use 1 for player1 and -1 for player2.
docstr: Input:
      board: current board
      player: current player (1 or -1)
  
  Returns:
      r: 0 if game has not ended. 1 if player won, -1 if player lost,
         small non-zero value for draw.
         
docstr_tok: ["Input",":","board",":","current","board","player",":","current","player","(","1","or","-1",")","Returns",":","r",":","0","if","game","has","not","ended",".","1","if","player","won",",","-1","if","player","lost",",","small","non-zero","value","for","draw","."]
code: def getGameEnded(self, board, player):
      """
      Input:
          board: current board
          player: current player (1 or -1)
  
      Returns:
          r: 0 if game has not ended. 1 if player won, -1 if player lost,
             small non-zero value for draw.
  
      """
      b = self._base_board.with_np_pieces(np_pieces=board)
      winstate = b.get_win_state()
      if winstate.is_ended:
          if winstate.winner is None:
              # draw has very little value.
              return 1e-4
          elif winstate.winner == player:
              return +1
          elif winstate.winner == -player:
              return -1
          else:
              raise ValueError("Unexpected winstate found: ", winstate)
      else:
          # 0 used to represent unfinished game.
          return 0
  
imports: import numpy
  from collections import namedtuple
label_desc: Use image node_id 7 for calling the Connect4Game obj's underlying member method code with example usage: obj.getGameEnded(board, player) and returns: int, int, unknown, unknown