Request statistics showing global achievements that have been
        unlocked.

        gameID: The id of the game.
        format: Return format. None defaults to json. (json, xml, vdf)
339755
def get_global_achievement_percentages_for_app(self, gameID, format=None):
        
        parameters = {'gameid' : gameID}
        if format is not None:
            parameters['format'] = format
        url = self.create_request_url(self.interface,
            'GetGlobalAchievementPercentagesForApp', 2, parameters)
        data = self.retrieve_request(url)
        return self.return_data(data, format=format)
222397
def current_game(self):
        
        obj = self._prof
        gameid = obj.get("gameid")
        gameserverip = obj.get("gameserverip")
        gameextrainfo = obj.get("gameextrainfo")
        return (int(gameid) if gameid else None, gameserverip, gameextrainfo)
1347768
def gameValue(self):
        """"""
        allowed = type(self).ALLOWED_TYPES
        try:
            if isinstance(allowed, dict): # if ALLOWED_TYPES is not a dict, there is no-internal game value mapping defined
                return allowed.get(self.type.name)
        except: pass # None .type values are okay -- such result in a None gameValue() result
        return None
560712
def get_reward_and_done(board):
  """"""
  # Returns (reward, done) where:
  # reward: -1 means lost, +1 means win, 0 means draw or continuing.
  # done: True if the game is over, i.e. someone won or it is a draw.

  # Sum all rows ...
  all_sums = [np.sum(board[i, :]) for i in range(3)]
  # ... all columns
  all_sums.extend([np.sum(board[:, i]) for i in range(3)])
  # and both diagonals.
  all_sums.append(np.sum([board[i, i] for i in range(3)]))
  all_sums.append(np.sum([board[i, 2 - i] for i in range(3)]))

  if -3 in all_sums:
    return -1, True

  if 3 in all_sums:
    return 1, True

  done = True
  if get_open_spaces(board):
    done = False

  return 0, done
573321
def overview(game_id):
    """"""
    output = {}
    # get data
    overview = mlbgame.data.get_overview(game_id)
    # parse data
    overview_root = etree.parse(overview).getroot()

    try:
        output = add_raw_box_score_attributes(output, game_id)
    except ValueError:
        pass

    # get overview attributes
    for x in overview_root.attrib:
        output[x] = overview_root.attrib[x]

    # Get probable starter attributes if they exist
    home_pitcher_tree = overview_root.find('home_probable_pitcher')
    if home_pitcher_tree is not None:
        output.update(build_namespaced_attributes(
            'home_probable_pitcher', home_pitcher_tree))
    else:
        output.update(build_probable_starter_defaults('home'))

    away_pitcher_tree = overview_root.find('away_probable_pitcher')
    if away_pitcher_tree is not None:
        output.update(build_namespaced_attributes(
            'away_probable_pitcher', away_pitcher_tree))
    else:
        output.update(build_probable_starter_defaults('away'))

    return output
970871
def fetch(self, id_, return_fields=None):
        
        game_params = {"id": id_}

        if return_fields is not None:
            self._validate_return_fields(return_fields)
            field_list = ",".join(return_fields)

            game_params["field_list"] = field_list

        response = self._query(game_params, direct=True)

        return response
514944
def get_innings(game_id):
    """"""
    year, month, day = get_date_from_game_id(game_id)
    try:
        return urlopen(INNINGS_URL.format(year, month, day, game_id))
    except HTTPError:
        raise ValueError('Could not find a game with that id.')
252160
function(game, fn) {
    if (!game || (typeof game !== 'number' &&
        typeof game !== 'string')) {
      return fn('Error getting Move. You did not specify the ' +
        'id number of the game you want to retrieve.');
    }

    game = game.toString();
    var apiCall = 'http://pokeapi.co/api/v' + defaults.version +
      '/game/' + game;
    makeTheCall(game, 'game', apiCall, function(err, data) {
      return fn(err, data);
    });
  }
629025
public function lockedAchievements()
    {
        if (config('achievements.locked_sync')) {
            // Relationships should be synced. Just return relationship data.
            return $this->achievements()->whereNull('unlocked_at')->get();
        } else {
            // Query all unsynced
            $unsynced = AchievementDetails::getUnsyncedByAchiever($this)->get();
            $self = $this;
            $unsynced = $unsynced->map(function ($el) use ($self) {
                $progress = new AchievementProgress();
                $progress->details()->associate($el);
                $progress->achiever()->associate($this);
                $progress->points = 0;
                $progress->created_at = null;
                $progress->updated_at = null;
                return $progress;
            });

            // Merge with progressed, but not yet unlocked
            $lockedProgressed = $this->achievements()->whereNull('unlocked_at')->get();
            $locked = $lockedProgressed->merge($unsynced);

            return $locked;
        }
    }
50943
def get_score_system_id(self):
        
        # Implemented from template for osid.resource.Resource.get_avatar_id_template
        if not bool(self._my_map['scoreSystemId']):
            raise errors.IllegalState('this AssessmentOffered has no score_system')
        else:
            return Id(self._my_map['scoreSystemId'])
453776
def game_events(game_id, innings_endpoint=False):
    """"""
    # get data from data module
    if not innings_endpoint:
        data = mlbgame.data.get_game_events(game_id)
        endpoint = 'game_events'
    else:
        data = mlbgame.data.get_innings(game_id)
        endpoint = 'innings'
    # parse XML
    parsed = etree.parse(data)
    root = parsed.getroot()
    # empty output file
    output = {}
    # loop through innings
    innings = root.findall('inning')
    for x in innings:
        output[x.attrib['num']] = {
            'top': __inning_info(x, 'top', endpoint),
            'bottom': __inning_info(x, 'bottom', endpoint)
        }
    return output
199823
def get_player_stats(self, player_key, board_key):
        
        player_stats_url = self.api_path + 'player/' + player_key + '/league/' + board_key + '/stats/'
        response = self.get_response(player_stats_url)
        return response
639418
function getUserProfile(key, steamID, callback) {
  var steam = new SteamWebAPI({ apiKey: key, format: 'json' });

  steam.getPlayerSummaries({
    steamids: [ steamID ],
    callback: function(err, result) {
      if(err) {
        return callback(err);
      }

      var profile = {
        provider: 'steam',
        _json: result.response.players[0],
        id: result.response.players[0].steamid,
        displayName: result.response.players[0].personaname,
        photos: [{
          value: result.response.players[0].avatar
        }, {
          value: result.response.players[0].avatarmedium
        }, {
          value: result.response.players[0].avatarfull
        }]
      };

      callback(null, profile);
    }
  });
}
1261119
def fetch()
      name = urlfy(@name)
      page = Net::HTTP.get(URI("http://www.gog.com/game/" + name))
      data = JSON.parse(page[/(?<=var gogData = )(.*)(?=;)/,1])
      data
    end
434764
public function gameTitleId() : ?string
    {
        if ($this->titleType() & SessionType::Unknown) return null; 

        return $this->session->npTitleDetail->npTitleId;
    }
1036877
public function GetPlayerAchievementsAPI($appId)
    {
        // Set up the api details
        $this->method  = 'GetPlayerAchievementsAPI';
        $this->version = 'v0001';

        // Set up the arguments
        $arguments = [
            'steamid' => $this->steamId,
            'appid'   => $appId,
            'l'       => 'english',
        ];

        // Get the client
        $stats = $this->GetSchemaForGame($appId);

        // Make sure the game has achievements
        if ($stats == null || $stats->game->availableGameStats->achievements == null) {
            return null;
        }

        $client = $this->setUpClient($arguments)->playerstats;
        $stats  = $stats->game->availableGameStats->achievements;

        // Clean up the games
        $achievements = $this->convertToObjects($client->achievements, $stats);

        return $achievements;
    }
259046
def type_id(self) -> UnitTypeId:
        
        unit_type = self._proto.unit_type
        if unit_type not in self._game_data.unit_types:
            self._game_data.unit_types[unit_type] = UnitTypeId(unit_type)
        return self._game_data.unit_types[unit_type]