Send a CTCP request to the given target.
5914
def ctcp(self, target, ctcp_verb, argument=None):
        """"""
        # we don't support complex ctcp encapsulation because we're somewhat sane
        atoms = [ctcp_verb]
        if argument is not None:
            atoms.append(argument)
        X_DELIM = '\x01'
        self.msg(target, X_DELIM + ' '.join(atoms) + X_DELIM, formatted=False)
565798
def send(self):
        """"""
        success = False
        if self.method is None:
            raise ParamsError()
        try:
            if self.method == 'SEARCH':
                req = self._get_requests()
                _url = self.__NETEAST_HOST + self._METHODS[self.method]
                resp = req.post(_url, data=self.data)
                self._build_response(resp)
                self.response.ok = True
            else:
                if isinstance(self.data, dict):
                    data = encrypted_request(self.data)

                req = self._get_webapi_requests()
                _url = self.__NETEAST_HOST + self._METHODS[self.method]

                if self.method in ('USER_DJ', 'USER_FOLLOWS', 'USER_EVENT'):
                    _url = _url % self.params['uid']

                if self.method in ('LYRIC', 'MUSIC_COMMENT'):
                    _url = _url % self.params['id']
                # GET
                if self.method in ('LYRIC'):
                    resp = req.get(_url)
                else:
                    resp = req.post(_url, data=data)
                self._build_response(resp)
                self.response.ok = True
        except Exception as why:
            traceback.print_exc()
            print 'Requests Exception', why
            # self._build_response(why)
            self.response.error = why
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)
344192
def script_request_list_send(self, target_system, target_component, force_mavlink1=False):
                '''
                

                '''
                return self.send(self.script_request_list_encode(target_system, target_component), force_mavlink1=force_mavlink1)
458373
private void handleRequest(final ChannelHandlerContext ctx, final ByteBuf message) {
    if (isDataMessage(message)) {
      dataEventHandler.onEvent(flowController, message);
    } else if (isControlMessage(message)) {
      controlHandler.onEvent(flowController, message);
    } else if (DcpNoopRequest.is(message)) {
      try {
        ByteBuf buffer = ctx.alloc().buffer();
        DcpNoopResponse.init(buffer);
        MessageUtil.setOpaque(MessageUtil.getOpaque(message), buffer);
        ctx.writeAndFlush(buffer);
      } finally {
        message.release();
      }
    } else {
      try {
        LOGGER.warn("Unknown DCP Message, ignoring. \n{}", MessageUtil.humanize(message));
      } finally {
        message.release();
      }
    }
  }
467907
def send(self, value, error=False):
        
        if error:
            resp = [1, self._request_id, value, None]
        else:
            resp = [1, self._request_id, None, value]
        debug('sending response to request %d: %s', self._request_id, resp)
        self._msgpack_stream.send(resp)
1187611
def _send(self, method, **parameters):
        """"""
        msg = {
            'index': self._calls,
            'method': method,
        }
        msg.update(parameters)

        promise = SimplePromise()
        self._callbacks[self._calls] = promise

        self._calls += 1
        self._comm.send(msg)

        return promise
72944
def param_request_list_send(self, target_system, target_component, force_mavlink1=False):
                '''
                

                '''
                return self.send(self.param_request_list_encode(target_system, target_component), force_mavlink1=force_mavlink1)
786705
def request(self, target="candidate"):
        
        node = new_ele("lock")
        sub_ele(sub_ele(node, "target"), target)
        return self._request(node)
898416
def _target_load(self, load):
        '''
        
        '''
        mp_call = _metaproxy_call(self.opts, 'target_load')
        return mp_call(self, load)
613584
public void initiate(final AjaxRequestTarget target)
	{
		String url = getCallbackUrl().toString();

		if (antiCache)
		{
			url = url + (url.contains("?") ? "&" : "?");
			url = url + "antiCache=" + System.currentTimeMillis();
		}
		// the timeout is needed to let Wicket release the channel
		target.appendJavaScript("setTimeout(\"window.location.href='" + url + "'\", 100);");
	}
330051
def _send_commit_request(self, retry_delay=None, attempt=None):
        """"""
        # If there's a _commit_call, and it's not active, clear it, it probably
        # just called us...
        if self._commit_call and not self._commit_call.active():
            self._commit_call = None

        # Make sure we only have one outstanding commit request at a time
        if self._commit_req is not None:
            raise OperationInProgress(self._commit_req)

        # Handle defaults
        if retry_delay is None:
            retry_delay = self.retry_init_delay
        if attempt is None:
            attempt = 1

        # Create new OffsetCommitRequest with the latest processed offset
        commit_offset = self._last_processed_offset
        commit_request = OffsetCommitRequest(
            self.topic, self.partition, commit_offset,
            TIMESTAMP_INVALID, self.commit_metadata)
        log.debug("Committing off=%d grp=%s tpc=%s part=%s req=%r",
                  self._last_processed_offset, self.consumer_group,
                  self.topic, self.partition, commit_request)

        # Send the request, add our callbacks
        self._commit_req = d = self.client.send_offset_commit_request(
            self.consumer_group, [commit_request])

        d.addBoth(self._clear_commit_req)
        d.addCallbacks(
            self._update_committed_offset, self._handle_commit_error,
            callbackArgs=(commit_offset,),
            errbackArgs=(retry_delay, attempt))
906592
def bind_target(self, target, ctx=None):
        

        # process self _bind_target
        result = self._bind_target(target=target, ctx=ctx)

        # fire on bind target event
        self.on_bind_target(target=target, ctx=ctx)

        return result
220529
def ctcp(self, target, message, nowait=False):
        """"""
        if target and message:
            messages = utils.split_message(message, self.config.max_length)
            f = None
            for message in messages:
                f = self.send_line('PRIVMSG %s :\x01%s\x01' % (target,
                                                               message),
                                   nowait=nowait)
            return f
162253
public void transferResponse(HttpServletResponse target) throws IOException // never
  // called
  // for
  // ARD.
  // would
  // be
  // in
  // trouble
  // with
  // a
  // bunch
  // of
  // include
  // warnings
  {
    _finish();

    if (containsError())
    {
      // transfer error
      String message = getErrorMessage();
      int sc = getErrorStatusCode();
      if (message == null)
      {
        target.sendError(sc);
      }
      else
      {
        target.sendError(sc, message);
      }
    }
    else if (isRedirected())
    {
      // transfer cookies
      Cookie[] cookies = getCookies();
      for (int i = 0; i < cookies.length; i++)
      {
        target.addCookie(cookies[i]);
      }

      // transfer redirect
      target.sendRedirect(getRedirectURI());
    }
    else
    {
      // transfer status code
      if (getStatusMessage() == null)
      {
        target.setStatus(getStatusCode());
      }
      else
      {
        target.setStatus(getStatusCode(), getStatusMessage());
      }

      // transfer headers
      _header.transferHeader(target);

      // transfer cookies
      Cookie[] cookies = getCookies();
      for (int i = 0; i < cookies.length; i++)
      {
        target.addCookie(cookies[i]);
      }

      if (this.getOutputBuffer() != null)
      { // PM17019
        // transfer data
        ServletOutputStream out;
        try
        {
          out = target.getOutputStream();
        }
        catch (IllegalStateException i)
        {
          while (!(target instanceof StoredResponse))
          {
            while (target instanceof HttpServletResponseWrapper)
            {
              target = ((HttpServletResponse) ((HttpServletResponseWrapper) target).getResponse());
            }

            while (target instanceof HttpServletResponseProxy)
            {
              target = ((HttpServletResponse) ((HttpServletResponseProxy) target).getProxiedHttpServletResponse());
            }

            while (target instanceof IncludedResponse)
            {
              target = ((IncludedResponse) target).getProxiedHttpServletResponse();
            }

            // PQ88880 begin
            if (target instanceof SRTServletResponse)
            {
              target.getWriter().write(this.getOutputBufferAsString().toCharArray());
              return;
            }
            // PQ88880 end
          }

          StoredResponse s = (StoredResponse) target;

          out = s._outInternal;
        }

        out.write(this.getOutputBuffer());
      }
    }
  }
866043
def _send(self, msg):
        """"""
        if isinstance(msg, six.binary_type):
            method = uwsgi.websocket_send_binary
        else:
            method = uwsgi.websocket_send
        if self._req_ctx is not None:
            method(msg, request_context=self._req_ctx)
        else:
            method(msg)
656179
def send(self, request, **kwargs):
        
        # Set defaults that the hooks can utilize to ensure they always have
        # the correct parameters to reproduce the previous request.
        kwargs.setdefault('stream', self.stream)
        kwargs.setdefault('verify', self.verify)
        kwargs.setdefault('cert', self.cert)
        kwargs.setdefault('proxies', self.proxies)

        # It's possible that users might accidentally send a Request object.
        # Guard against that specific failure case.
        if isinstance(request, Request):
            raise ValueError('You can only send PreparedRequests.')

        # Set up variables needed for resolve_redirects and dispatching of hooks
        allow_redirects = kwargs.pop('allow_redirects', True)
        stream = kwargs.get('stream')
        hooks = request.hooks

        # Get the appropriate adapter to use
        adapter = self.get_adapter(url=request.url)

        # Start time (approximately) of the request
        start = preferred_clock()

        # Send the request
        r = adapter.send(request, **kwargs)

        # Total elapsed time of the request (approximately)
        elapsed = preferred_clock() - start
        r.elapsed = timedelta(seconds=elapsed)

        # Response manipulation hooks
        r = dispatch_hook('response', hooks, r, **kwargs)

        # Persist cookies
        if r.history:

            # If the hooks create history then we want those cookies too
            for resp in r.history:
                extract_cookies_to_jar(self.cookies, resp.request, resp.raw)

        extract_cookies_to_jar(self.cookies, request, r.raw)

        # Redirect resolving generator.
        gen = self.resolve_redirects(r, request, **kwargs)

        # Resolve redirects if allowed.
        history = [resp for resp in gen] if allow_redirects else []

        # Shuffle things around if there's history.
        if history:
            # Insert the first (original) request at the start
            history.insert(0, r)
            # Get the last request made
            r = history.pop()
            r.history = history

        # If redirects aren't being followed, store the response on the Request for Response.next().
        if not allow_redirects:
            try:
                r._next = next(self.resolve_redirects(r, request, yield_requests=True, **kwargs))
            except StopIteration:
                pass

        if not stream:
            r.content

        return r