Invokes the UV Index History endpoint

        :param params_dict: dict of parameters
        :returns: a string containing raw JSON data
        :raises: *ValueError*, *APICallError*
163047
def get_uvi_history(self, params_dict):
        
        lat = str(params_dict['lat'])
        lon = str(params_dict['lon'])
        start = str(params_dict['start'])
        end = str(params_dict['end'])
        params = dict(lat=lat, lon=lon, start=start, end=end)

        # build request URL
        uri = http_client.HttpClient.to_url(UV_INDEX_HISTORY_URL,
                                            self._API_key,
                                            None)
        _, json_data = self._client.cacheable_get_json(uri, params=params)
        return json_data
794686
def process_parameters(parameters):
    
    if not parameters:
        return {}
    params = copy.copy(parameters)
    for param_name in parameters:
        value = parameters[param_name]
        server_param_name = re.sub(r'_(\w)', lambda m: m.group(1).upper(), param_name)
        if isinstance(value, dict):
            value = process_parameters(value)
        params[server_param_name] = value
        if server_param_name != param_name:
            del params[param_name]
    return params
438030
def _get_api_params(api_url=None,
                    page_id=None,
                    api_key=None,
                    api_version=None):
    '''
    
    '''
    statuspage_cfg = __salt__['config.get']('statuspage')
    if not statuspage_cfg:
        statuspage_cfg = {}
    return {
        'api_url': api_url or statuspage_cfg.get('api_url') or BASE_URL,  # optional
        'api_page_id': page_id or statuspage_cfg.get('page_id'),  # mandatory
        'api_key': api_key or statuspage_cfg.get('api_key'),  # mandatory
        'api_version': api_version or statuspage_cfg.get('api_version') or DEFAULT_VERSION
    }
817194
def extract_params(params):
    
    values = []
    if isinstance(params, dict):
        for key, value in params.items():
            values.extend(extract_params(value))
    elif isinstance(params, list):
        for value in params:
            values.extend(extract_params(value))
    else:
        values.append(params)
    return values
1057868
def to_param_dict(self):
        
        param_dict = {}
        for index, dictionary in enumerate(self.value):
            for key, value in dictionary.items():
                param_name = '{param_name}[{index}][{key}]'.format(
                                                    param_name=self.param_name,
                                                    index=index,
                                                    key=key)
                param_dict[param_name] = value
        return OrderedDict(sorted(param_dict.items()))
740648
def _get_json(self, url):
        ""
        content = self._get_content('jsonds/' + url)
        try:
            json_content = json.loads(content.decode())
        except AttributeError:
            json_content = json.loads(content)
        if json_content['Comment']:
            log.warning(json_content['Comment'])
        if json_content['Result'] != 'OK':
            raise ValueError('Error while retrieving the parameter list.')
        return json_content['Data']
298254
def index(cls):
        
        res = requests.get(cls.URL, headers=HEADERS, verify=False)
        res.raise_for_status()
        return res.json()
992580
def _api_item_history(self, plugin, item, nb=0):
        
        return self._api_itemvalue(plugin, item, history=True, nb=int(nb))
824702
def json(self, dict=None, indent=None):
        
        if not dict:
            dict = self.dict()
        for key, value in dict.iteritems():
            if type(value) == datetime.datetime:
                dict[key] = value.strftime(conf.GOSCALE_ATOM_DATETIME_FORMAT)
        return simplejson.dumps(dict, indent=indent)
888301
def json_repr(self, minimal=False):
        
        if self.value:
            return [self.field, self.operator, self.value]
        else:
            return [self.field, self.operator]
1048433
def params_to_dict(params, dct):
    
    for param, val in params.items():
        if val is None:
            continue
        dct[param] = val
    return dct
36996
def update_http_method_params(self):
        
        url_params = {}

        if self.start:
            url_params.update(
                {"start": int(calendar.timegm(self.start.timetuple()))}
            )

        if self.stop:
            url_params.update(
                {"stop": int(calendar.timegm(self.stop.timetuple()))}
            )

        if self.probe_ids:
            url_params.update({"probe_ids": self.probe_ids})

        self.http_method_args["params"].update(url_params)
577179
def parse_pagination_dict(cls, response_obj):
        

        pagination_dict = {}

        cls.update_dict_id_field_from_response_field(
            pagination_dict,
            cls._FIELD_OLDER_ID,
            response_obj,
            cls._FIELD_OLDER_URL,
            client.Pagination.PARAM_OLDER_ID
        )
        cls.update_dict_id_field_from_response_field(
            pagination_dict,
            cls._FIELD_NEWER_ID,
            response_obj,
            cls._FIELD_NEWER_URL,
            client.Pagination.PARAM_NEWER_ID
        )
        cls.update_dict_id_field_from_response_field(
            pagination_dict,
            cls._FIELD_FUTURE_ID,
            response_obj,
            cls._FIELD_FUTURE_URL,
            client.Pagination.PARAM_NEWER_ID
        )

        return pagination_dict
1261013
def to_json(self):
    
    return {self.BLOB_KEY_PARAM: self._blob_key,
            self.START_INDEX_PARAM: self._start_index,
            self.END_INDEX_PARAM: self._end_index}
1147892
def _extract_params(request_dict, param_list, param_fallback=False):
        '''  '''

        if not param_list or not request_dict:
            return dict()

        query = dict()
        for param in param_list:
            # Retrieve all items in the form of {param: value} and
            # convert {param__key: value} into {param: {key: value}}
            for query_key, query_value in request_dict.items():
                if param == query_key:
                    query[param] = query_value
                else:
                    query_key_parts = query_key.split('__', 1)
                    if param == query_key_parts[0]:
                        query[param] = {query_key_parts[1]: query_value}

        # Convert special string "__null__" into Python None
        nullifier = lambda d: {k:(nullifier(v) if isinstance(v, dict) else # pylint: disable=used-before-assignment
                                  (None if v == '__null__' else v)) for k, v in d.items()}

        # When fallback is enabled and no parameter matched, assume query refers to first parameter
        if param_fallback and all([param_key not in query.keys() for param_key in param_list]):
            query = {param_list[0]: dict(request_dict)}

        # Return a dictionary with only the requested parameters
        return {k:v for k, v in nullifier(query).items() if k in param_list}
1312405
def get_stats_history(self, item=None, nb=0):
        """"""
        s = self.get_json_history(nb=nb)

        if item is None:
            return self._json_dumps(s)

        if isinstance(s, dict):
            try:
                return self._json_dumps({item: s[item]})
            except KeyError as e:
                logger.error("Cannot get item history {} ({})".format(item, e))
                return None
        elif isinstance(s, list):
            try:
                # Source:
                # http://stackoverflow.com/questions/4573875/python-get-index-of-dictionary-item-in-list
                return self._json_dumps({item: map(itemgetter(item), s)})
            except (KeyError, ValueError) as e:
                logger.error("Cannot get item history {} ({})".format(item, e))
                return None
        else:
            return None
290476
def to_api_repr(self):
        
        s_types = {}
        values = {}
        for name, value in self.struct_values.items():
            type_ = self.struct_types[name]
            if type_ in ("STRUCT", "ARRAY"):
                repr_ = value.to_api_repr()
                s_types[name] = {"name": name, "type": repr_["parameterType"]}
                values[name] = repr_["parameterValue"]
            else:
                s_types[name] = {"name": name, "type": {"type": type_}}
                converter = _SCALAR_VALUE_TO_JSON_PARAM.get(type_)
                if converter is not None:
                    value = converter(value)
                values[name] = {"value": value}

        resource = {
            "parameterType": {
                "type": "STRUCT",
                "structTypes": [s_types[key] for key in self.struct_types],
            },
            "parameterValue": {"structValues": values},
        }
        if self.name is not None:
            resource["name"] = self.name
        return resource