// Unsure how the .Prompt call surfaces, it hasn't come up.
347252
func (s *ssProvider) unlock(p dbus.ObjectPath) error {
	var unlocked []dbus.ObjectPath
	var prompt dbus.ObjectPath
	method := fmt.Sprint(ssServiceIface, "Unlock")
	err := s.srv.Call(method, 0, []dbus.ObjectPath{p}).Store(&unlocked, &prompt)
	if err != nil {
		return fmt.Errorf("keyring/dbus: Unlock error: %s", err)
	}
	if prompt != dbus.ObjectPath("/") {
		method = fmt.Sprint(ssPromptIface, "Prompt")
		call := s.Object(ssServiceName, prompt).Call(method, 0, "unlock")
		return call.Err
	}
	return nil
}
590631
func (s *SecretService) PromptAndWait(prompt dbus.ObjectPath) (paths *dbus.Variant, err error) {
	if prompt == NullPrompt {
		return nil, nil
	}
	call := s.Obj(prompt).Call("org.freedesktop.Secret.Prompt.Prompt", NilFlags, "Keyring Prompt")
	if call.Err != nil {
		return nil, errors.Wrap(err, "failed to prompt")
	}
	for {
		var result PromptCompletedResult
		select {
		case signal := <-s.signalCh:
			if signal.Name != "org.freedesktop.Secret.Prompt.Completed" {
				continue
			}
			err = dbus.Store(signal.Body, &result.Dismissed, &result.Paths)
			if err != nil {
				return nil, errors.Wrap(err, "failed to unmarshal prompt result")
			}
			if result.Dismissed {
				return nil, PromptDismissedError{errors.New("prompt dismissed")}
			}
			return &result.Paths, nil
		case <-time.After(30 * time.Second):
			return nil, errors.New("prompt timed out")
		}
	}
}
615202
func (c *Client) Call(method string, args interface{}, reply interface{}) error {
	call := <-c.Go(method, args, reply, make(chan *Call, 1)).Done
	return call.Error
}
1067923
func (c *Client) Call(serviceMethod string, args []interface{}, reply interface{}) error {
	rpc, err := xmlrpc.NewClient(c.Url, nil)
	if err != nil {
		return err
	}
	return rpc.Call(serviceMethod, args, reply)
}
1102205
func Retry(format string, args ...interface{}) {
	// Ensure the user's command prompt starts on the next line.
	if !strings.HasSuffix(format, "\n") {
		format += "\n"
	}
	fmt.Fprintf(os.Stderr, format, args...)
	panic(format) // Panic instead of os.Exit so that deferred will run.
}
1201609
func RespondWithHelpConfused(in *dt.Msg) string {
	if in.Plugin != nil {
		use := randUseForPlugin(in.Plugin)
		use2 := randUseForPlugin(in.Plugin)
		if use == use2 {
			return fmt.Sprintf("%s You can try telling me %q",
				ConfusedLang(), use)
		}
		return fmt.Sprintf("%s You can try telling me %q or %q",
			ConfusedLang(), use, use2)
	}
	if len(PluginsGo) == 0 {
		return ConfusedLang()
	}
	use := randUse()
	use2 := randUse()
	if use == use2 {
		return fmt.Sprintf("%s How about %q", ConfusedLang(), use)
	}
	return fmt.Sprintf("%s How about %q or %q", ConfusedLang(), use, use2)
}
109884
func promptInteractive(upgradedHostId, upgradedHostName string) (stopPrompting bool, err error) {
	stopPrompting = false
	scanner := bufio.NewScanner(os.Stdin)
	if upgradedHostName != "" {
		glog.Infof("Pausing after finished %q, node %q", upgradedHostId, upgradedHostName)
	} else {
		glog.Infof("Pausing after finished %q", upgradedHostId)
	}
	fmt.Print("Continue? (Y)es, (N)o, (A)lwaysYes: [Y] ")
	scanner.Scan()
	err = scanner.Err()
	if err != nil {
		glog.Infof("unable to interpret input: %v", err)
		return stopPrompting, err
	}
	val := scanner.Text()
	val = strings.TrimSpace(val)
	val = strings.ToLower(val)
	switch val {
	case "n":
		glog.Info("User signaled to stop")
		os.Exit(3)
	case "a":
		glog.Info("Always Yes, stop prompting for rest of hosts")
		stopPrompting = true
	}
	return stopPrompting, err
}
560472
func (e *Endpoint) Call(function string, args interface{}, reply interface{}) error {
	call := <-e.Go(function, args, reply, make(chan *rpc.Call, 1)).Done
	return call.Error
}
259078
func (t *MockSocket) ExpectCall(request string, response string) {
	t.expectedRequests <- &mocksocketRequest{sentMessage: json.RawMessage(request), responses: []json.RawMessage{json.RawMessage(response)}}
}
258267
func RespondWithHelp(in *dt.Msg) string {
	if len(in.StructuredInput.Commands) != 1 {
		return ""
	}
	if in.StructuredInput.Commands[0] != "help" {
		return ""
	}
	if in.Plugin != nil {
		use := randUseForPlugin(in.Plugin)
		use2 := randUseForPlugin(in.Plugin)
		if use == use2 {
			return fmt.Sprintf("Try telling me %q", use)
		}
		return fmt.Sprintf("Try telling me %q or %q", use, use2)
	}
	switch len(PluginsGo) {
	case 0:
		return ""
	case 1:
		return fmt.Sprintf("Try saying %q", randUse())
	default:
		use := randUse()
		use2 := randUse()
		if use == use2 {
			return fmt.Sprintf("Try telling me %q", use)
		}
		return fmt.Sprintf("Try telling me %q or %q", use, use2)
	}
}
948348
func PromptLine(entity string) (_ string, err error) {
	fmt.Printf("%s: ", entity)
	in := bufio.NewReader(os.Stdin)
	line, err := in.ReadString('\n')
	if err != nil {
		return
	}
	return strings.TrimSpace(line), nil
}
232133
func InitiateCall(client *messagebird.Client, source, destination string, callflow CallFlow, webhook *Webhook) (*Call, error) {
	body := struct {
		Source      string   `json:"source"`
		Destination string   `json:"destination"`
		Callflow    CallFlow `json:"callflow"`
		Webhook     struct {
			URL   string `json:"url,omitempty"`
			Token string `json:"token,omitempty"`
		}
	}{
		Source:      source,
		Destination: destination,
		Callflow:    callflow,
	}
	if webhook != nil {
		body.Webhook.URL = webhook.URL
		body.Webhook.Token = webhook.Token
	}
	var resp struct {
		Data []Call `json:"data"`
	}
	if err := client.Request(&resp, http.MethodPost, apiRoot+"/calls", body); err != nil {
		return nil, err
	}
	return &resp.Data[0], nil
}
1279762
func (m *MinTerm) PromptPassword(prompt string) (string, error) {
	if !strings.HasSuffix(prompt, ": ") {
		prompt += ": "
	}
	return m.readSecret(prompt)
}
1052807
func NewRekeyRequestWithPaperPromptEvent() RekeyEvent {
	e := NewRekeyRequestEvent()
	d := rekeyWithPromptWaitTimeDefault
	e.request.promptPaper = true
	e.request.timeout = &d
	return e
}
715498
func PromptForStringWithDefault(r io.Reader, w io.Writer, def string, format string, a ...interface{}) string {
	if w == nil {
		w = os.Stdout
	}

	s := PromptForString(r, w, format, a...)
	if len(s) == 0 {
		return def
	}
	return s
}
405309
func (twilio *Twilio) CallWithApplicationCallbacks(from, to, applicationSid string) (*VoiceResponse, *Exception, error) {
	formValues := url.Values{}
	formValues.Set("From", from)
	formValues.Set("To", to)
	formValues.Set("ApplicationSid", applicationSid)

	return twilio.voicePost(formValues)
}
943431
func prompt(promptText string) string {
	fmt.Fprint(cmdmain.Stdout, promptText)
	sc := bufio.NewScanner(cmdmain.Stdin)
	sc.Scan()
	return strings.TrimSpace(sc.Text())
}