original_docstring: 
          Selects an edge on the game board. 
          :param edge_index: the index of the edge to select 
          :param player: the player selecting the edge
          :return: the next player to play, or None if the game is finished, and the number of boxes made
          
docstring: Selects an edge on the game board.
docstring_tokens: Selects an edge on the game board .
code: def select_edge(self, edge_index, player):
          """
          Selects an edge on the game board. 
          :param edge_index: the index of the edge to select 
          :param player: the player selecting the edge
          :return: the next player to play, or None if the game is finished, and the number of boxes made
          """
          if self.is_finished():
              raise Exception("game is finished")
          if edge_index < 0 or edge_index > len(self._board_state) - 1:
              raise Exception("invalid edge index: %s" % edge_index)
          if self._board_state[edge_index] == 1:
              raise Exception("edge already selected: %s" % edge_index)
          if player != self._players[self._current_player]:
              raise Exception("next player to play is: %s" % self._players[self._current_player])
          self._board_state[edge_index] = 1
          boxes_made = 0
          for box in self._boxes:
              if box.contains(edge_index) and box.is_complete(self._board_state) and box not in self._players_to_boxes[player]:
                  self._players_to_boxes[player].add(box)
                  boxes_made += 1
          if boxes_made == 0:
              self._current_player = (self._current_player + 1) % len(self._players)
          return self.get_current_player(), boxes_made
code_tokens: def select_edge ( self , edge_index , player ) : if self . is_finished ( ) : raise Exception ( "game is finished" ) if edge_index < 0 or edge_index > len ( self . _board_state ) - 1 : raise Exception ( "invalid edge index: %s" % edge_index ) if self . _board_state [ edge_index ] == 1 : raise Exception ( "edge already selected: %s" % edge_index ) if player != self . _players [ self . _current_player ] : raise Exception ( "next player to play is: %s" % self . _players [ self . _current_player ] ) self . _board_state [ edge_index ] = 1 boxes_made = 0 for box in self . _boxes : if box . contains ( edge_index ) and box . is_complete ( self . _board_state ) and box not in self . _players_to_boxes [ player ] : self . _players_to_boxes [ player ] . add ( box ) boxes_made += 1 if boxes_made == 0 : self . _current_player = ( self . _current_player + 1 ) % len ( self . _players ) return self . get_current_player ( ) , boxes_made
short_docstring: Selects an edge on the game board.
short_docstring_tokens: Selects an edge on the game board .
comment: """
          Selects an edge on the game board. 
          :param edge_index: the index of the edge to select 
          :param player: the player selecting the edge
          :return: the next player to play, or None if the game is finished, and the number of boxes made
          """