Calling Season Stats API.

        Arg:
           season_key: key of the season
        Return:
           json data
514586
def get_season_stats(self, season_key):
        

        season_stats_url = self.api_path + "season/" + season_key + "/stats/"
        response = self.get_response(season_stats_url)
        return response
1223546
def stats(self, key=None):
        
        # TODO: Stats with key is not working.

        returns = {}
        for server in self.servers:
            returns[server.server] = server.stats(key)

        return returns
1087529
def _get_key_data(d, key):
    
    d2 = ""
    try:
        d2 = d[key]
    except KeyError:
        logger_dataframes.info("get_key_data: KeyError: {}".format(key))
    return d2
1156871
def stats(self):
        '''
        
        '''
        last_event = list(filter(lambda x: 'event' in x and x['event'] == 'playbook_on_stats',
                                 self.events))
        if not last_event:
            return None
        last_event = last_event[0]['event_data']
        return dict(skipped=last_event['skipped'],
                    ok=last_event['ok'],
                    dark=last_event['dark'],
                    failures=last_event['failures'],
                    processed=last_event['processed'])
455917
def to_json(self):
        """"""
        # load data if it's not loaded
        if not self.is_data_loaded:
            self._import_data()

        def jsonify_dict(base_dict):
            new_dict = {}
            for key, val in base_dict.items():
                new_dict[key] = val.to_json()
            return new_dict
        hot_wks = jsonify_dict(self.extreme_hot_weeks)
        cold_wks = jsonify_dict(self.extreme_cold_weeks)
        typ_wks = jsonify_dict(self.typical_weeks)
        grnd_temps = jsonify_dict(self.monthly_ground_temperature)
        return {
            'location': self.location.to_json(),
            'data_collections': [dc.to_json() for dc in self._data],
            'metadata': self.metadata,
            'heating_dict': self.heating_design_condition_dictionary,
            'cooling_dict': self.cooling_design_condition_dictionary,
            'extremes_dict': self.extreme_design_condition_dictionary,
            'extreme_hot_weeks': hot_wks,
            'extreme_cold_weeks': cold_wks,
            'typical_weeks': typ_wks,
            "monthly_ground_temps": grnd_temps,
            "is_ip": self._is_ip,
            "is_leap_year": self.is_leap_year,
            "daylight_savings_start": self.daylight_savings_start,
            "daylight_savings_end": self.daylight_savings_end,
            "comments_1": self.comments_1,
            "comments_2": self.comments_2
        }
1317688
def get_json_report_object(self, key):
        
        con = ConnectionManager().get_connection(self._connection_alias)
        return con.get_json(self.json_report_objects[key], append_base_url=False)
530473
def stats(self):
        
        # TODO - this would be nicer if we formatted the stats
        return self._client.get('{}/stats'.format(Instance.api_endpoint), model=self)
385135
def get_schedules_for_season(self, season, season_type="REG"):
        
        try:
            season = int(season)
            if season_type not in ["REG", "PRE", "POST"]:
                raise ValueError
        except (ValueError, TypeError):
            raise FantasyDataError('Error: Invalid method parameters')

        season_param = "{0}{1}".format(season, season_type)
        result = self._method_call("Schedules/{season}", "stats", season=season_param)
        return result
1182153
def get_players_game_stats_for_season_for_week(self, season, week, season_type="REG"):
        
        try:
            season = int(season)
            week = int(week)
            if season_type not in ["REG", "PRE", "POST"]:
                raise ValueError
        except (TypeError, ValueError):
            raise FantasyDataError('Error: Invalid method parameters')

        season_param = "{0}{1}".format(season, season_type)
        result = self._method_call("PlayerGameStatsByWeek/{season}/{week}", "stats", season=season_param, week=week)
        return result
1228021
def stats(self, symbol):
        
        data = self._get(self.url_for(PATH_STATS, (symbol)))

        for period in data:

            for key, value in period.items():
                if key == 'period':
                    new_value = int(value)
                elif key == 'volume':
                    new_value = float(value)

                period[key] = new_value

        return data
1049808
def get_recent_seasons(self):
        

        recent_seasons_url = self.api_path + "recent_seasons/"
        response = self.get_response(recent_seasons_url)
        return response
43064
def get_data(self):
        
        data = graceful_chain_get(self.json, "data")
        if data is None:
            return {}

        data_dict = {}
        for key in data:
            if self.is_yaml(key):
                data_dict[key] = yaml.load(data[key])
            else:
                data_dict[key] = json.loads(data[key])

        return data_dict
787567
def aggregate_key(self, aggregate_key):
        
        aggregation = self.data_dict[aggregate_key]  # List of dictionaries of numpy arrays/scalars

        # Aggregate sub batch data
        data_dict_keys = {y for x in aggregation for y in x.keys()}

        for key in data_dict_keys:
            # Just average all the statistics from the loss function
            stacked = np.stack([d[key] for d in aggregation], axis=0)
            self.data_dict[key] = np.mean(stacked, axis=0)
176216
async def get(self):
        """"""

        context_data = self.get_context_data()
        context_data.update(getattr(self.request.app, "stats", {}))

        response = self.json_response(context_data)
        return response
666801
public PlayerLifetimeStats retrievePlayerStatsByAccountId(long accountId, Season season) {
        return client.sendRpcAndWait(SERVICE, "retrievePlayerStatsByAccountId", accountId, season);
    }
981795
def key_json(minion_id,
             pillar,  # pylint: disable=W0613
             pillar_key=None):
    '''
    
    '''
    key_data = __salt__['redis.get_key'](minion_id)
    # Return nothing for non-existent keys
    if not key_data:
        return {}

    data = salt.utils.json.loads(key_data)
    # Return as requested
    if isinstance(data, dict) and not pillar_key:
        return data
    elif not pillar_key:
        return {'redis_pillar': data}
    else:
        return {pillar_key: data}
980988
def to_dict(self):
        

        result = super(Progress, self).to_dict()

        label = LABELS['last_progress_change'][self.progress_type]
        result[label] = to_iso8601_datetime(self.last_progress_change)

        if self.progress_type == 'watched':
            result['reset_at'] = self.reset_at

        result['seasons'] = [
            season.to_dict()
            for season in self.seasons.values()
        ]

        if self.hidden_seasons:
            result['hidden_seasons'] = [
                popitems(season.to_dict(), ['number', 'ids'])
                for season in self.hidden_seasons.values()
            ]

        if self.next_episode:
            result['next_episode'] = popitems(self.next_episode.to_dict(), ['season', 'number', 'title', 'ids'])
            result['next_episode']['season'] = self.next_episode.keys[0][0]

        if self.last_episode:
            result['last_episode'] = popitems(self.last_episode.to_dict(), ['season', 'number', 'title', 'ids'])
            result['last_episode']['season'] = self.last_episode.keys[0][0]

        return result