// newRespInbox creates a new literal response subject
// that will trigger the mux subscription handler.
// Lock should be held.
423621
func (nc *Conn) newRespInbox() string {
	if nc.respMap == nil {
		nc.initNewResp()
	}
	var b [respInboxPrefixLen + replySuffixLen]byte
	pres := b[:respInboxPrefixLen]
	copy(pres, nc.respSub)
	rn := nc.respRand.Int63()
	for i, l := respInboxPrefixLen, rn; i < len(b); i++ {
		b[i] = rdigits[l%base]
		l /= base
	}
	return string(b[:])
}
114730
func NewResponse(w http.ResponseWriter, e *Echo) (r *Response) {
	return &Response{Writer: w, echo: e}
}
1325191
func NewMux() *Mux {
	return &Mux{
		mux: http.NewServeMux(),
		log: func(err error) { println(err.Error()) },
	}
}
736260
func NewQuickReply(title string, pst string) QR {
	return QR{
		Title:   title,
		Payload: pst,
		Type:    "text",
	}
}
913470
func (service *VboxPortType) IGuestMultiTouchEventgetYPositions(request *IGuestMultiTouchEventgetYPositions) (*IGuestMultiTouchEventgetYPositionsResponse, error) {
	response := new(IGuestMultiTouchEventgetYPositionsResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
490427
func NewResponseWithBodyAndStatus(body *Body, c int, s string) *http.Response {
	resp := NewResponse()
	resp.Body = body
	resp.ContentLength = body.Length()
	resp.Status = s
	resp.StatusCode = c
	return resp
}
177891
func (c *Client) CreateResponseObject(i *CreateResponseObjectInput) (*ResponseObject, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Version == 0 {
		return nil, ErrMissingVersion
	}

	path := fmt.Sprintf("/service/%s/version/%d/response_object", i.Service, i.Version)
	resp, err := c.PostForm(path, i, nil)
	if err != nil {
		return nil, err
	}

	var b *ResponseObject
	if err := decodeJSON(&b, resp.Body); err != nil {
		return nil, err
	}
	return b, nil
}
1231835
func (fw *Framework) NewReply(request protocol.Request) (reply protocol.Reply, err error) {
	switch request.Version() {
	case protocol.RequestV1:
		reply, err = v1.NewReply(request, fw.Config.Identity)
	default:
		err = fmt.Errorf("Do not know how to create a Reply version %s", request.Version())
	}

	return
}
569297
func New() *Weavebox {
	return &Weavebox{
		router:          httprouter.New(),
		Output:          os.Stderr,
		ErrorHandler:    defaultErrorHandler,
		EnableAccessLog: false,
		logger:          kitlog.NewLogfmtLogger(os.Stderr),
		context:         context.Background(),
	}
}
1014208
func (mo *mailOrchestrator) exclusiveGetOrCreateMailBox(
	chanID lnwire.ChannelID) MailBox {

	mailbox, ok := mo.mailboxes[chanID]
	if !ok {
		mailbox = newMemoryMailBox()
		mailbox.Start()
		mo.mailboxes[chanID] = mailbox
	}

	return mailbox
}
482105
func getSandboxPortMapInfo(sb libnetwork.Sandbox) nat.PortMap {
	pm := nat.PortMap{}
	if sb == nil {
		return pm
	}

	for _, ep := range sb.Endpoints() {
		pm, _ = getEndpointPortMapInfo(ep)
		if len(pm) > 0 {
			break
		}
	}
	return pm
}
554990
func NewInvalidResponseError(reason string, lines []string) *InvalidResponseError {
	return &InvalidResponseError{Reason: reason, Data: lines}
}
1360374
func NewResponseReverter(w dns.ResponseWriter, r *dns.Msg) *ResponseReverter {
	return &ResponseReverter{
		ResponseWriter:   w,
		originalQuestion: r.Question[0],
	}
}
1110204
func (service *VboxPortType) IGuestSessiondirectoryRemoveRecursive(request *IGuestSessiondirectoryRemoveRecursive) (*IGuestSessiondirectoryRemoveRecursiveResponse, error) {
	response := new(IGuestSessiondirectoryRemoveRecursiveResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
12752
func (service *VboxPortType) IPCIAddresssetBus(request *IPCIAddresssetBus) (*IPCIAddresssetBusResponse, error) {
	response := new(IPCIAddresssetBusResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
1019340
func (r *Response) PassThreadToInbox() error {
	p := passThreadControl{
		Recipient:   r.to,
		TargetAppID: InboxPageID,
		Metadata:    "Passing to inbox secondary app",
	}

	data, err := json.Marshal(p)
	if err != nil {
		return err
	}

	req, err := http.NewRequest("POST", ThreadControlURL, bytes.NewBuffer(data))
	if err != nil {
		return err
	}

	req.Header.Set("Content-Type", "application/json")
	req.URL.RawQuery = "access_token=" + r.token

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	return checkFacebookError(resp.Body)
}
626138
func NewResponseWithContent(c string) *http.Response {
	return &http.Response{
		Status:     "200 OK",
		StatusCode: 200,
		Proto:      "HTTP/1.0",
		ProtoMajor: 1,
		ProtoMinor: 0,
		Body:       NewBody(c),
		Request:    NewRequest(),
	}
}