Get MSW API response.
199595
def get_msw(requestURL):
    """"""
    msw_response = requests.get(requestURL)
    msw_response.raise_for_status()

    json_d = msw_response.json()
    headers = msw_response.headers

    if ERROR_RESPONSE in json_d:
        code = json_d.get(ERROR_RESPONE).get('code')
        msg = json_d.get(ERROR_RESPONE).get('error_msg')
        raise Exception('API returned error code {}. {}'.format(code, msg))
    if len(json_d) == 1:
        return ForecastDataPoint(json_d[0], headers, msw_response)
    return ForecastDataBlock(json_d, headers, msw_response)
283757
protected function getResponse(){

        $post = false;

        // use output parameter if required by the service
        $this->requestUrl.= $this->service['endpoint']
                            ? $this->endpoint
                            : '';

        // set API Key
        $this->requestUrl.= 'key='.urlencode( $this->key );


        switch( $this->service['type'] ){

            case 'POST':

                    $post =  json_encode( $this->service['param'] );

                break;


            case 'GET':
            default:
                    $this->requestUrl.='&'. Parameters::getQueryString( $this->service['param'] );
                break;
        }


        return $this->make( $post );

    }
16427
def get_prefix_response(self, key_prefix, sort_order=None,
                            sort_target='key', keys_only=False):
        """"""
        range_request = self._build_get_range_request(
            key=key_prefix,
            range_end=utils.increment_last_byte(utils.to_bytes(key_prefix)),
            sort_order=sort_order,
            sort_target=sort_target,
            keys_only=keys_only,
        )

        return self.kvstub.Range(
            range_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )
670115
def response(self):
        """"""
        values = []
        sum_values = 0.
        ma_coefs = self.ma_coefs
        ar_coefs = self.ar_coefs
        ma_order = self.ma_order
        for idx in range(len(self.ma.delays)):
            value = 0.
            if idx < ma_order:
                value += ma_coefs[idx]
            for jdx, ar_coef in enumerate(ar_coefs):
                zdx = idx-jdx-1
                if zdx >= 0:
                    value += ar_coef*values[zdx]
            values.append(value)
            sum_values += value
        return numpy.array(values)
682236
def get_data(self, ptr, unbuffered=False):
        """"""
        result = _decode(self.get_raw_data(ptr, unbuffered),
                         self._reading_format[self.ws_type])
        return result
265391
def get(self, request, *args, **kwargs):
        """"""
        try:
            context = self.get_context_data(**kwargs)
        except exceptions.NotAvailable:
            exceptions.handle(request)
        self.set_workflow_step_errors(context)
        return self.render_to_response(context)
90945
def get(self):
        
        params = self.param_dict_builder.params
        logger.debug(pprint.pformat(format(params)))
        response = requests.post(SSOS_URL,
                                 data=params,
                                 headers=self.headers)
        logger.debug(response.url)
        assert isinstance(response, requests.Response)
        assert (response.status_code == requests.codes.ok)

        lines = response.content
        # note: spelling 'occured' is in SSOIS
        if len(lines) < 2 or "An error occured getting the ephemeris" in lines:
            print lines
            print response.url
            raise IOError(os.errno.EACCES,
                          "call to SSOIS failed on format error")

        if os.access("backdoor.tsv", os.R_OK):
            lines += open("backdoor.tsv").read()
        return lines
1286358
def get_survey_reponse
      url = ApiRequest.base_path("questionpro.survey.surveyResponse")
      result = self.class.get(url, body: self.options)
      
      self.full_response = result
      self.status = result['status']

      response = SurveyResponse.new(result['response']['surveyResponse'])

      return response
    end
965873
def get_response(self, action, params, page=0, itemSet=None):
        
        params['Service'] = "AWSECommerceService"
        params['Operation'] = action
        if page:
            params['ItemPage'] = page
        response = self.make_request(None, params, "/onca/xml")
        body = response.read()
        boto.log.debug(body)

        if response.status != 200:
            boto.log.error('%s %s' % (response.status, response.reason))
            boto.log.error('%s' % body)
            raise self.ResponseError(response.status, response.reason, body)

        if itemSet == None:
            rs = ItemSet(self, action, params, page)
        else:
            rs = itemSet
        h = handler.XmlHandler(rs, self)
        xml.sax.parseString(body, h)
        return rs
747160
def rws_call(ctx, method, default_attr=None):
    """"""
    try:
        response = ctx.obj['RWS'].send_request(method)

        if ctx.obj['RAW']:  # use response from RWS
            result = ctx.obj['RWS'].last_result.text
        elif default_attr is not None:  # human-readable summary
            result = ""
            for item in response:
                result = result + item.__dict__[default_attr] + "\n"
        else:  # use response from RWS
            result = ctx.obj['RWS'].last_result.text

        if ctx.obj['OUTPUT']:  # write to file
            ctx.obj['OUTPUT'].write(result.encode('utf-8'))
        else:  # echo
            click.echo(result)

    except RWSException as e:
        click.echo(str(e))
220760
def get_psms(self):
        """"""
        self.header = actions.create_header(self.oldheader, self.spectracol)
        self.psms = actions.generate_psms_spectradata(self.lookup, self.fn,
                                                      self.oldheader)
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
357286
private MwsResponseHeaderMetadata getResponseHeaderMetadata(HttpResponse response) {
        Header requestIdHeader = response.getFirstHeader("x-mws-request-id");
        String requestId = requestIdHeader == null ? null : requestIdHeader.getValue();

        Header timestampHeader = response.getFirstHeader("x-mws-timestamp");
        String timestamp = timestampHeader == null ? null : timestampHeader.getValue();

        Header contextHeader = response.getFirstHeader("x-mws-response-context");
        String contextString = contextHeader==null ? "" : contextHeader.getValue();
        List<String> context = Collections.unmodifiableList(Arrays.asList(contextString.split(",")));

        Double quotaMax;
        try {
            Header quotaMaxHeader = response.getFirstHeader("x-mws-quota-max");
            quotaMax = quotaMaxHeader == null ? null : Double.valueOf(quotaMaxHeader.getValue());
        } catch (NumberFormatException ex) {
            quotaMax = null;
        }

        Double quotaRemaining;
        try {
            Header quotaRemainingHeader = response.getFirstHeader("x-mws-quota-remaining");
            quotaRemaining = quotaRemainingHeader == null ? null : Double.valueOf(quotaRemainingHeader.getValue());
        } catch (NumberFormatException ex) {
            quotaRemaining = null;
        }

        Date quotaResetDate;
        try {
            Header quotaResetHeader = response.getFirstHeader("x-mws-quota-resetsOn");
            quotaResetDate = quotaResetHeader == null ? null : MwsUtl.parseTimestamp(quotaResetHeader.getValue());
        } catch (java.text.ParseException ex) {
            quotaResetDate = null;
        }

        return new MwsResponseHeaderMetadata(requestId, context, timestamp, quotaMax, quotaRemaining, quotaResetDate);
    }
855754
def get_state(self) -> str:
        """"""
        xdoc = self.connection.soap_action('/ws/ControllerService',
                                           'getState', "")
        if xdoc:
            return xdoc.find('./SOAP-ENV:Body/ns1:getState1/ns1:state',
                             IHCSoapClient.ihcns).text
        return False
181083
def response(self, apdu):
        """"""
        if _debug: ClientSSM._debug("response %r", apdu)

        # make sure it has a good source and destination
        apdu.pduSource = self.pdu_address
        apdu.pduDestination = None

        # send it to the application
        self.ssmSAP.sap_response(apdu)
696902
def _retrieve_result(endpoints, token_header):
        """"""
        request_list = [
            (url, token_header)
            for (task_id, url) in endpoints
        ]

        responses = concurrent_get(request_list)

        # Quick sanity check
        assert len(endpoints) == len(responses)

        responses_dic = {
            task_id: r.content
            for (task_id, _), r in zip(endpoints, responses)
        }
        return responses_dic
934880
async def _async_ws_handler(self, data):
        """"""
        sia_message = data['data']['sia']
        spc_id = sia_message['sia_address']
        sia_code = sia_message['sia_code']

        _LOGGER.debug("SIA code is %s for ID %s", sia_code, spc_id)

        if sia_code in Area.SUPPORTED_SIA_CODES:
            entity = self._areas.get(spc_id, None)
            resource = 'area'
        elif sia_code in Zone.SUPPORTED_SIA_CODES:
            entity = self._zones.get(spc_id, None)
            resource = 'zone'
        else:
            _LOGGER.debug("Not interested in SIA code %s", sia_code)
            return
        if not entity:
            _LOGGER.error("Received message for unregistered ID %s", spc_id)
            return

        data = await self._async_get_data(resource, entity.id)
        entity.update(data, sia_code)

        if self._async_callback:
            ensure_future(self._async_callback(entity))