identify all of the currently defined players
770298
def getKnownPlayers(reset=False):
    """"""
    global playerCache
    if not playerCache or reset:
        jsonFiles = os.path.join(c.PLAYERS_FOLDER, "*.json")
        for playerFilepath in glob.glob(jsonFiles):
            filename = os.path.basename(playerFilepath)
            name = re.sub("^player_", "", filename)
            name = re.sub("\.json$",  "", name)
            player = PlayerRecord(name)
            playerCache[player.name] = player
    return playerCache
1319737
def get_number_of_current_players(self, appID, format=None):
        
        parameters = {'appid' : appID}
        if format is not None:
            parameters['format'] = format
        url = self.create_request_url(self.interface,
            'GetNumberOfCurrentPlayers', 1, parameters)
        data = self.retrieve_request(url)
        return self.return_data(data, format=format)
1185326
def members(team_name)
      response = get_request("/2.0/teams/#{team_name.to_s}/members")
      return response["values"] unless block_given?
      response["values"].each { |el| yield el }
    end
810610
private function analyzeExtended()
    {
        $existObjectSeparator = pack('c*', 0x0B, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00);

        $pack = $this->rec->getResourcePack();

        list ($mapSizeX, $mapSizeY) = $this->analysis->mapSize;

        $version = $this->version;
        $players = $this->analysis->players;
        $playersByIndex = [];
        foreach ($players as $p) {
            $playersByIndex[$p->index] = $p;
        }

        // Add GAIA
        $numPlayers = $this->analysis->numPlayers + 1;
        $gaia = new Player($this->rec);
        $gaia->name = 'GAIA';

        // Player -1 is GAIA.
        $playersWithGaia = $players;
        array_unshift($playersWithGaia, $gaia);
        foreach ($playersWithGaia as $player) {
            // Co-op partners do not have an info block.
            if ($player->isCoopPartner()) {
                $coopMain = $player->getCoopMain();
                $player->civId = $coopMain->civId;
                $player->colorId = $coopMain->colorId;
                $player->team = $coopMain->team;
                continue;
            }

            if ($version->isTrial) {
                $this->position += 4;
            }
            $this->position += $numPlayers + 43;

            // skip playername
            $playerNameLen = $this->readHeader('v', 2);
            $this->position += $playerNameLen;

            $this->position += 1; // always 22?
            $numResources = $this->readHeader('l', 4);
            $this->position += 1; // always 33?
            $resourcesEnd = $this->position + 4 * $numResources;

            // Interesting resources
            $food = $this->readHeader('f', 4);
            $wood = $this->readHeader('f', 4);
            $stone = $this->readHeader('f', 4);
            $gold = $this->readHeader('f', 4);
            // headroom = (house capacity - population)
            $headroom = $this->readHeader('f', 4);
            $this->position += 4;
            // Post-Imperial Age = Imperial Age here
            $startingAge = $this->readHeader('f', 4);
            $this->position += 4 * 4;
            $population = $this->readHeader('f', 4);
            $this->position += 25 * 4;
            $civilianPop = $this->readHeader('f', 4);
            $this->position += 2 * 4;
            $militaryPop = $this->readHeader('f', 4);

            $this->position = $resourcesEnd;
            $this->position += 1; // 1 byte

            $initCameraX = $this->readHeader('f', 4);
            $initCameraY = $this->readHeader('f', 4);
            if ($version->isMgx) {
                $this->position += 9;
            } else {
                $this->position += 5;
            }
            $civilization = ord($this->header[$this->position++]);
            if (!$civilization) {
                $civilization = 1;
            }
            $this->position += 3;
            $playerColor = ord($this->header[$this->position++]);

            if ($player->civId === -1) {
                $player->civId = $civilization;
            }
            $player->colorId = $playerColor;
            $player->initialState->position = [round($initCameraX), round($initCameraY)];
            $player->initialState->food = round($food);
            $player->initialState->wood = round($wood);
            $player->initialState->stone = round($stone);
            $player->initialState->gold = round($gold);
            $player->initialState->startingAge = round($startingAge);
            $player->initialState->houseCapacity = round($headroom) + round($population);
            $player->initialState->population = round($population);
            $player->initialState->civilianPop = round($civilianPop);
            $player->initialState->militaryPop = round($militaryPop);
            $player->initialState->extraPop = $player->initialState->population -
                ($player->initialState->civilianPop + $player->initialState->militaryPop);

            if ($version->isTrial) {
                $this->position += 4;
            }
            $this->position += $numPlayers + 70;
            $this->position += $version->isMgx ? 792 : 756;
            $this->position += $version->isMgx ? 41249 : 34277;
            $this->position += $mapSizeX * $mapSizeY;

            // getting exist_object_pos
            $existObjectPos = strpos($this->header, $existObjectSeparator, $this->position);
            if ($existObjectPos === false) {
                throw new \Exception('Could not find existObjectSeparator');
            } else {
                $this->position = $existObjectPos + strlen($existObjectSeparator);
            }

            $objects = $this->read(PlayerObjectsListAnalyzer::class, [
                'players' => array_merge([
                    0 => $gaia,
                ], $playersByIndex),
            ]);

            foreach ($objects->gaiaObjects as &$object) {
                $this->gaiaObjects[] = $object;
            }
            foreach ($objects->playerObjects as &$object) {
                $this->playerObjects[] = $object;
            }
        }

        return (object) [
            'gaia' => $players[0],
            'players' => array_slice($players, 1),
            'gaiaObjects' => $this->gaiaObjects,
            'playerObjects' => $this->playerObjects,
        ];
    }
1208179
def players(self, postgame, game_type):
        """"""
        for i, attributes in self._players():
            yield self._parse_player(i, attributes, postgame, game_type)
112568
def info_player_id(self,name):
        ''''''
        number = 0
        name=name.title().replace(" ", "+")
        headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain",'Referer': 'http://'+self.domain+'/team_news.phtml',"User-Agent": user_agent}
        req = self.session.get('http://stats.comunio.es/search.php?name='+name,headers=headers).content
        soup = BeautifulSoup(req)
        for i in soup.find_all('a',{'class','nowrap'}):
            number = re.search("([0-9]+)-", str(i)).group(1)
            break # Solo devuelve la primera coincidencia
        return number
785502
public static List<Player> loadPlayers(List<String> playersFiles) throws PlayerException {
	log.info("[loadPlayers] Loading all players");
	List<Player> players = new ArrayList<>();
	if (playersFiles.size() < 1) {
	    log.warn("[loadPlayers] No players to load");
	}

	for (String singlePath : playersFiles) {
	    Player single = new Player(new File(singlePath));
	    players.add(single);
	}

	return players;
    }
1205486
public function players() : array 
    {
        $returnPlayers = [];

        $players = $this->get(sprintf(self::GAME_ENDPOINT . 'titles/%s/players', $this->titleId));

        if ($players->size === 0) return $returnPlayers;

        foreach ($players->data as $player) {
            $returnPlayers[] = new User($this->client, $player->onlineId);
        }

        return $returnPlayers;
    }
977580
def user_activities(username, tournament=1):
    """"""
    click.echo(prettify(napi.get_user_activities(username, tournament)))
1132536
def teams(self):
        """"""
        teams = {}
        default_team = 1
        for i in range(1, self._header.replay.num_players):
            attributes = self._header.initial.players[i].attributes
            team = self._header.lobby.teams[i - 1]
            if team == 1:
                team = default_team
                default_team += 1
            if team not in teams:
                teams[team] = {'player_numbers': []}
            teams[team]['player_numbers'].append(attributes.player_color + 1)
        return list(teams.values())
1330185
public static String getWorldGroupOfPlayerCurrentlyIn(String playerName) {
        return Common.getInstance().getWorldGroupManager().getWorldGroupName(getWorldPlayerCurrentlyIn(playerName));
    }
264464
def player_marks(grid):
    ""
    p, q = grid
    return 'XO' if sum(player_bits(p)) == sum(player_bits(q)) else 'OX'
237172
def check_teams
      return if @teams.size == 0
      member = Hash.new
      @teams.each do |t|
        t.members.each do |m|
          raise "member #{m} of team '#{t.name}' is not a valid player number for this tournament" unless @player[m]
          raise "member #{m} of team '#{t.name}' is already a member of team #{member[m]}" if member[m]
          member[m] = t.name
        end
      end
      @player.keys.each do |p|
        raise "player #{p} is not a member of any team" unless member[p]
      end
    end
72937
def player
      PLAYERS.each do |player|
        player_load(player) || next

        instance = player_class(player).new
        player_on_platform?(instance) || next

        return instance if player_launched?(instance)
      end
      nil
    end
1058982
def members(self):
        
        resp = self._rtm_client.get('v1/current_team.members?all=true')
        if resp.is_fail():
            raise RTMServiceError(
                'Failed to get members of current team',
                resp
            )
        return resp.data['result']
582515
def get_player
      if !self.player
        # retrieve player object
        player = Player.new
        player.init()
        self.player = player
      end
      self.player
    end
584867
def _validate_player(player):
    '''
    
    '''
    valid_players = range(4)
    if player not in valid_players:
        valid_players = ', '.join(str(p) for p in valid_players)
        raise dominoes.NoSuchPlayerException('{} is not a valid player. Valid players'
                                             ' are: {}'.format(player, valid_players))