Respond to an I-Am request.
181742
def do_IAmRequest(self, apdu):
        """"""
        if _debug: WhoIsIAmServices._debug("do_IAmRequest %r", apdu)

        # check for required parameters
        if apdu.iAmDeviceIdentifier is None:
            raise MissingRequiredParameter("iAmDeviceIdentifier required")
        if apdu.maxAPDULengthAccepted is None:
            raise MissingRequiredParameter("maxAPDULengthAccepted required")
        if apdu.segmentationSupported is None:
            raise MissingRequiredParameter("segmentationSupported required")
        if apdu.vendorID is None:
            raise MissingRequiredParameter("vendorID required")

        # extract the device instance number
        device_instance = apdu.iAmDeviceIdentifier[1]
        if _debug: WhoIsIAmServices._debug("    - device_instance: %r", device_instance)

        # extract the source address
        device_address = apdu.pduSource
        if _debug: WhoIsIAmServices._debug("    - device_address: %r", device_address)
767119
def _post(self, url, data=None, json=None, params=None, headers=None):
        """"""
        url = self.clean_url(url)
        response = requests.post(url, data=data, json=json, params=params,
                                 headers=headers, timeout=self.timeout,
                                 verify=self.verify)
        return response
1098512
private static void respond(Request request, List<LocationSuggestion> suggestions, Callback callback) {

        callback.onSuggestionsReady(request, new Response(suggestions));
    }
246722
def response(self, beacon_config, request, client_address):
		
		return self._message(beacon_config, invert_hello=self.__invert_hello)
339969
def request(self, msgtype, msgid, method, params=[]):
        """"""
        result = None
        error = None
        exception = None

        try:
            result = self.dispatch.call(method, params)
        except Exception as e:
            error = (e.__class__.__name__, str(e))
            exception = e

        if isinstance(result, Deferred):
            result.add_callback(self._result, msgid)
            result.add_errback(self._error, msgid)
        else:
            self.send_response(msgid, error, result)
474881
def im_open(self, *, user: str, **kwargs) -> SlackResponse:
        
        kwargs.update({"user": user})
        return self.api_call("im.open", json=kwargs)
1255314
def _request(self, *args, **kwargs):
        # type (Any) -> Response
        """"""
        self._amend_request_kwargs(kwargs)
        _response = self._requests_session.request(*args, **kwargs)
        try:
            _response.raise_for_status()
        except HTTPError as e:
            if e.response is not None:
                raise_from(ConjureHTTPError(e), e)
            raise e
        return _response
1192464
def _request_devices(self, url, _type):
        """"""
        res = self._request(url)
        return res.get(_type) if res else {}
1034587
def respond_to?(m, *args)
      super(m, *args) || @targets.all? { |t| t.respond_to?(m, *args) }
    end
949365
def _request(self, method, url, params=None, headers=None, data=None):
        """"""
        if not params:
            params = {}

        # set default headers
        if not headers:
            headers = {
                'accept': '*/*'
            }
            if method == 'POST' or method == 'PUT':
                headers.update({'Content-Type': 'application/json'})
        try:
            response = requests.request(method=method, url=self.host + self.key + url, params=params,
                                        headers=headers, data=data)

            try:
                response.raise_for_status()

                response_code = response.status_code
                success = True if response_code // 100 == 2 else False
                if response.text:
                    try:
                        data = response.json()
                    except ValueError:
                        data = response.content
                else:
                    data = ''

                response_headers = response.headers

                return BurpResponse(success=success, response_code=response_code, data=data,
                                    response_headers=response_headers)
            except ValueError as e:
                return BurpResponse(success=False, message="JSON response could not be decoded {}.".format(e))
            except requests.exceptions.HTTPError as e:
                if response.status_code == 400:
                    return BurpResponse(success=False, response_code=400, message='Bad Request')
                else:
                    return BurpResponse(
                        message='There was an error while handling the request. {}'.format(response.content),
                        success=False)
        except Exception as e:
            return BurpResponse(success=False, message='Eerror is %s' % e)
1224322
def send(self, sender, **kwargs):
        """"""
        if id(self) not in _alleged_receivers:
            return
        for func in _alleged_receivers[id(self)]:
            func(sender, **kwargs)
1075227
def req(self, message_id, timeout):
        ''''''
        return self.send(constants.REQ + ' ' + message_id + ' ' + str(timeout))
419899
def response(self, msgid, error, result):
        """"""
        if error:
            self.requests[msgid].errback(Exception(str(error)))
        else:
            self.requests[msgid].callback(result)
        del self.requests[msgid]
799923
def handle_call(self, body, message):
        """"""
        try:
            r = self._DISPATCH(body, ticket=message.properties['reply_to'])
        except self.Next:
            # don't reply, delegate to other agents.
            pass
        else:
            self.reply(message, r)
1086936
def send_request(self, request):
        """"""
        # throttle the number of requests to each host
        self.aggregate.wait_for_host(self.urlparts[1])
        kwargs = self.get_request_kwargs()
        kwargs["allow_redirects"] = False
        self._send_request(request, **kwargs)
160251
async def handle_request(self, request):
        """"""
        service_name = request.rel_url.query['servicename']
        received_code = request.rel_url.query['pairingcode'].lower()
        _LOGGER.info('Got pairing request from %s with code %s',
                     service_name, received_code)

        if self._verify_pin(received_code):
            cmpg = tags.uint64_tag('cmpg', int(self._pairing_guid, 16))
            cmnm = tags.string_tag('cmnm', self._name)
            cmty = tags.string_tag('cmty', 'iPhone')
            response = tags.container_tag('cmpa', cmpg + cmnm + cmty)
            self._has_paired = True
            return web.Response(body=response)

        # Code did not match, generate an error
        return web.Response(status=500)
523293
def _request_internal(self, command, **kwargs):
        """"""
        args = dict(kwargs)
        if self.ssid:
            args['ssid'] = self.ssid
        method = getattr(self.api, command)
        response = method(**args)
        if response and 'status' in response:
            if response['status'] == 'error':
                raise SubregError(
                    message=response['error']['errormsg'],
                    major=response['error']['errorcode']['major'],
                    minor=response['error']['errorcode']['minor']
                )
            if response['status'] == 'ok':
                return response['data'] if 'data' in response else dict()
            raise Exception("Invalid status found in SOAP response")
        raise Exception('Invalid response')