// SayHello returns error if request.name was not filled otherwise: "hello " + request.Name
558076
func (*GreeterService) SayHello(ctx context.Context, request *helloworld.HelloRequest) (*helloworld.HelloReply, error) {
	if request.Name == "" {
		return nil, errors.New("not filled name in the request")
	}

	logging.Infof("Greeting client: %v", request.Name)

	return &helloworld.HelloReply{Message: "Greetings " + request.Name}, nil
}
255826
func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {
	s.mu.Lock()
	defer s.mu.Unlock()
	// Track the number of times the user has been greeted.
	s.count[in.Name]++
	if s.count[in.Name] > 1 {
		st := status.New(codes.ResourceExhausted, "Request limit exceeded.")
		ds, err := st.WithDetails(
			&epb.QuotaFailure{
				Violations: []*epb.QuotaFailure_Violation{{
					Subject:     fmt.Sprintf("name:%s", in.Name),
					Description: "Limit one greeting per person",
				}},
			},
		)
		if err != nil {
			return nil, st.Err()
		}
		return nil, ds.Err()
	}
	return &pb.HelloReply{Message: "Hello " + in.Name}, nil
}
200737
func (l *Log) Shout(format string, args ...interface{}) {
	l.output(l.quiet, &line{"", l.format(true, shout, format, args), l})
}
1096407
func (term *Terminal) Ask(question string) (bool, error) {
	input, err := term.Custom(question+"? (y/n)", func(input string) (string, bool) {
		if input == "" {
			return "", false
		}
		input = strings.ToLower(input)

		if input == "y" || input == "yes" {
			return "yes", true
		}

		return "", true
	})

	var ok bool
	if input != "" {
		ok = true
	}

	return ok, err
}
1069157
func (s *DemoServiceServer) SayHello(ctx context.Context, request *pb.HelloRequest) (*pb.HelloResponse, error) {
	customizedCounterMetric.WithLabelValues(request.Name).Inc()
	return &pb.HelloResponse{Message: fmt.Sprintf("Hello %s", request.Name)}, nil
}
152021
func Whoami() error {
	c, err := client.New()

	if err != nil {
		return err
	}

	fmt.Printf("You are %s at %s\n", c.Username, c.ControllerURL.String())
	return nil
}
1104901
func AskYesNo(question string, noIsDefault bool) bool {
	var s string
	alternatives := "Yn"
	if noIsDefault {
		alternatives = "yN"
	}
	fmt.Printf(question + " [" + alternatives + "] ")
	fmt.Scanf("%s", &s)
	if noIsDefault {
		// Anything that isn't yes is "no" (false)
		return s == "Y" || s == "y"
	}
	// Anything that isn't no is "yes" (true)
	return !(s == "N" || s == "n")
}
1110232
func (c ModuleCallInstance) Output(name string) ModuleCallOutput {
	return ModuleCallOutput{
		Call: c,
		Name: name,
	}
}
21579
func Header(name, val string) RequestOption {
	return func(req *http.Request) error {
		req.Header.Add(name, val)
		return nil
	}
}
1182438
func (s *stream) Say(format string, args ...interface{}) {
	s.log.output(s.quiet, &line{"", s.log.format(s.timestamps, say, format, args), s})
}
542387
func (l *Log) Say(format string, args ...interface{}) {
	l.output(l.quiet, &line{"", l.format(true, say, format, args), l})
}
449114
func Name(name string) Option {
	return func(o *Options) error {
		o.Name = name
		return nil
	}
}
503297
func (b *IrcBot) Say(channel string, text string) {
	msg := NewIrcMsg()
	msg.Command = "PRIVMSG"
	msg.CmdParams = []string{channel}
	msg.Trailing = []string{":", text}

	b.ChOut <- msg
}
968553
func (c *RedisClient) Hello() (HelloResponse, error) {

	vals, err := redis.Values(c.conn.Do("HELLO"))
	ret := HelloResponse{}
	if err != nil {
		return ret, err
	}

	if len(vals) < 3 {
		return ret, fmt.Errorf("disque: invalid HELLO response: %v", vals)
	}

	versionId := vals[0].(int64)
	if versionId != HelloVersionId {
		return ret, fmt.Errorf("disque: unsupported HELLo version: %d, expected %d", versionId, HelloVersionId)
	}

	ret.NodeId = string(vals[1].([]byte))
	ret.Nodes = make(nodeList, 0, len(vals)-2)
	for _, v := range vals {

		if arr, ok := v.([]interface{}); ok {
			if len(arr) != 4 {
				log.Println("Invalid HELLO entry: %v", arr)
				continue
			}

			prio, err := strconv.ParseInt(string(arr[3].([]byte)), 10, 32)
			if err != nil {
				log.Println("Invalid priority: %v", arr[3])
				continue
			}

			addr := ""
			host := string(arr[1].([]byte))

			//in a single node, it doesn't know its IP, we just take it from the client itself
			if host == "" {
				addr = c.node.Addr
			} else {
				addr = fmt.Sprintf("%s:%s", host, string(arr[2].([]byte)))
			}

			add, err := net.ResolveTCPAddr("tcp", addr)
			if err != nil {
				log.Printf("Invalid address given: %s", addr)
				continue
			}
			node := Node{
				Id:       string(arr[0].([]byte)),
				Addr:     add.String(),
				Priority: int(prio),
			}

			ret.Nodes = append(ret.Nodes, node)
		}

	}

	return ret, nil
}
425740
func askCredentials(c *context.Context, status int, text string) {
	c.Resp.Header().Set("WWW-Authenticate", "Basic realm=\".\"")
	c.HandleText(status, text)
}
840031
func greet(c cli.Command) {
	greeting := c.Param("greeting")
	str := fmt.Sprintf("%s", greeting)
	str = styleByFlags(str, c)
	c.Println(str)
}
1036106
func (c *Client) NewShell(id string) *Shell {
	return &Shell{client: c, id: id}
}