Gets all positions from current player turn.
194326
function getTurnPieces(game) {
    const isBlack = isBlackTurn(game);
    return game.board.reduce((piecesRow, row) => {
        return piecesRow.concat(row.reduce((pieces, position) => (isBlack !== position.isBlack)
            ? pieces
            : pieces.concat({ x: position.x, y: position.y, isBlack }), []));
    }, []);
}
423559
def parse_players
      s0 = @current_pos
      parse_comments
      s2 = @current_pos
      if match_str("N+") != :failed
        s4 = parse_nonls
        if parse_nl != :failed
          @reported_pos = s2
          s2 = s4
        else
          @current_pos = s2
          s2 = :failed
        end
      else
        @current_pos = s2
        s2 = :failed
      end
      s2 = nil if s2 == :failed
      parse_comments
      s4 = @current_pos
      if match_str("N-") != :failed
        s6 = parse_nonls
        if parse_nl != :failed
          @reported_pos = s4
          s4 = s6
        else
          @current_pos = s4
          s4 = :failed
        end
      else
        @current_pos = s4
        s4 = :failed
      end
      s4 = nil if s4 == :failed
      @reported_pos = s0
      s0 = [(s2 ? s2.join : nil), (s4 ? s4.join : nil)]
      s0
    end
342482
def current_position(self):
        """"""
        token = self.tokenizer.peek(0)
        if token:
            return token.start, token.end

        return self.tokenizer.position, self.tokenizer.position + 1
1208179
def players(self, postgame, game_type):
        """"""
        for i, attributes in self._players():
            yield self._parse_player(i, attributes, postgame, game_type)
9339
public void getAll(boolean discard)
    {
        if (discard)
        {
            mark = position;
            marked = remaining;
        }
        else
        {
            marked += remaining;
        }
        position = (position+remaining) % capacity;
        remaining = 0;
        updated();
    }
109822
def batch_run_many(player, positions, batch_size=100):
    """"""
    prob_list = []
    value_list = []
    for idx in range(0, len(positions), batch_size):
        probs, values = player.network.run_many(positions[idx:idx + batch_size])
        prob_list.append(probs)
        value_list.append(values)
    return np.concatenate(prob_list, axis=0), np.concatenate(value_list, axis=0)
528467
def update_picks(self, games=None, points=None):
        '''
        
        '''
        if games:
            game_dict = {g.id: g for g in self.gameset.games.filter(id__in=games)}
            game_picks = {pick.game.id: pick for pick in self.gamepicks.filter(game__id__in=games)}
            for key, winner in games.items():
                game = game_dict[key]
                if not game.has_started:
                    pick = game_picks[key]
                    pick.winner_id = winner
                    pick.save()

        if points is not None:
            self.points = points
            self.save()

        if games or points:
            self.updated_signal.send(sender=self.__class__, pickset=self, auto_pick=False)
651055
async def get_positions(self):
        """"""
        data = await self.api("positions")
        if self.connected and self.authenticated:
            self._positions = data
        else:
            self._positions = self._positions
        _LOGGER.debug(self._positions)
596133
private static String getWorldPlayerCurrentlyIn(String playerName) {
        return Common.getInstance().getServerCaller().getPlayerCaller().getPlayerWorld(playerName);
    }
952973
def possible_moves(self, position):
        
        # Chain used to combine multiple generators
        for move in itertools.chain(*[self.add(fn, position) for fn in self.cardinal_directions]):
            yield move

        for move in self.add_castle(position):
            yield move
798596
def positions(self):
        
        # if accessing and stale - update first
        if self._needupdate:
            self.update(self.root.now)
        if self.root.stale:
            self.root.update(self.root.now, None)
        return self._positions.loc[:self.now]
253325
def observers(self):
        """"""
        ret = []
        for player in self.players:
            try:
                if player.observer: ret.append(player)
            except: pass # ignore PlayerRecords which don't have an observer attribute
        return ret
1324722
function (positionChange) {
                var _this = this;
                // finds the current position of the point by it's roles, than splices it for the new position or pushes it if it's not yet in the array
                /** @type {?} */
                var index = this._points.findIndex(function (point) {
                    return _this.compareArray(positionChange.roles, point.roles);
                });
                if (index === -1) {
                    this._points.push(positionChange);
                }
                else {
                    this._points.splice(index, 1, positionChange);
                }
            }
977265
public Future<Map<String, List<LeagueList>>> getLeagues(String... teamIds) {
        return new ApiFuture<>(() -> handler.getLeagues(teamIds));
    }
627257
def positions(self, reverse=False):
        """"""
        def Posgen(reverse):
            if reverse:
                lastrootsib = self.last_sibling_position(self.root)
                current = self.last_decendant(lastrootsib)
                while current is not None:
                    yield current
                    current = self.prev_position(current)
            else:
                current = self.root
                while current is not None:
                    yield current
                    current = self.next_position(current)
        return Posgen(reverse)
21941
function handlePlayers(request, response, game, path) {
    var func, player, resp;
    if (!path.length) {
        // return info on the players collection

        if (request.method === "POST") {
            player = playerFromReq(request, response, game);
            if (player) {
                // end turn
                // TODO should this be under /players/<name>/?
                func = function (form) {
                    if (form && form.end_turn) {
                        switchPlayers(game, player);
                        respOk(response);
                    }
                };
            } else {
                // add player to a game
                func = function(form) {
                    if (form && form.name) {
                        addPlayerToGame(game, form.name);
                        var jar = new cookies(request, response);
                        jar.set("player", encodeURIComponent(form.name),
                                {httpOnly: false});
                        respOk(response, '', 'text/json');
                    }
                };
            }
            requestBody(request, func);
            return;
        } else if (request.method === 'DELETE') {
            // delete player from a game
            func = function(form) {
                if (form && form.name) {
                    player = game.players[form.name];
                    if (player === undefined) {
                        // huh? player is not in this game
                        response.writeHead(404, {'Content-Type': 'text/json'});
                        response.end();
                        return;
                    }
                    nextTurn(game, player);
                    game.returnPieces(player.pieces);
                    delete game.players[form.name];
                    if (Object.keys(game.players).length === 0) {
                        delete games[game.name];
                    }
                    respOk(response);
                }
            };
            requestBody(request, func);
            return;
        }  else {
            resp = JSON.stringify(game.players);
        }

    } else {
        // return info on a specific player
        player = game.players[path[0]];
        if (typeof player === 'undefined') {
            // player not found
            response.writeHead(404, {'Content-Type': 'text/json'});
            response.end();
            return;
        }

        if (path[1] === 'pieces') {
            resp = JSON.stringify(player.pieces);
        }
    }
    respOk(response, resp, 'text/json');
}
118017
function players (resp) {
  return base(resp).map(function (player) {
    var names = player.displayLastCommaFirst.split(", ").reverse();
    return {
      firstName: names[0].trim(),
      lastName: (names[1] ? names[1] : "").trim(),
      playerId: player.personId,
      teamId: player.teamId,
    };
  });
}