// resolveInputMessage resolves input message type of a method.
555740
func (d *serverDescription) resolveInputMessage(service, method string) (*descriptor.DescriptorProto, error) {
	_, obj, _ := descutil.Resolve(d.Description, service)
	serviceDesc, ok := obj.(*descriptor.ServiceDescriptorProto)
	if !ok {
		return nil, fmt.Errorf("service %q not found", service)
	}

	mi := descutil.FindMethodForService(serviceDesc, method)
	if mi == -1 {
		return nil, fmt.Errorf("method %q in service %q not found", method, service)
	}

	msgName := serviceDesc.Method[mi].GetInputType()
	msgName = strings.TrimPrefix(msgName, ".")
	return d.resolveMessage(msgName)
}
947886
func (bot TgBot) SimpleSendMessage(msg Message, text string) (res Message, err error) {
	ressm := bot.SendMessage(msg.Chat.ID, text, nil, nil, nil, nil)
	return splitResultInMessageError(ressm)
}
1070912
func (dd *DataValidation) SetInput(title, msg string) {
	dd.ShowInputMessage = true
	dd.PromptTitle = &title
	dd.Prompt = &msg
}
538537
func (client *Client) ReplyMessage(replyToken string, messages ...SendingMessage) *ReplyMessageCall {
	return &ReplyMessageCall{
		c:          client,
		replyToken: replyToken,
		messages:   messages,
	}
}
1205264
func (p *parserMixin) ResolvedIP() (target *net.IP) {
	target = new(net.IP)
	p.ResolvedIPVar(target)
	return
}
686610
func GetInputReference(strategy buildapi.BuildStrategy) *kapi.ObjectReference {
	switch {
	case strategy.SourceStrategy != nil:
		return &strategy.SourceStrategy.From
	case strategy.DockerStrategy != nil:
		return strategy.DockerStrategy.From
	case strategy.CustomStrategy != nil:
		return &strategy.CustomStrategy.From
	default:
		return nil
	}
}
805031
func ParseMessage(data []byte, sender net.Addr) (Message, error) {
	address, idx := ReadString(data)
	msg := Message{
		Address: address,
		Sender:  sender,
	}
	data = data[idx:]
	typetags, idx := ReadString(data)
	data = data[idx:]

	// Read all arguments.
	args, err := ReadArguments([]byte(typetags), data)
	if err != nil {
		return Message{}, errors.Wrap(err, "parse message")
	}
	msg.Arguments = args

	return msg, nil
}
862665
func (c *CheckRunAnnotation) GetMessage() string {
	if c == nil || c.Message == nil {
		return ""
	}
	return *c.Message
}
223402
func (nr *nameResolver) resolveColumnNameInContext(ctx *resolverContext, cn *ast.ColumnNameExpr) bool {
	if ctx.inTableRefs {
		// In TableRefsClause, column reference only in join on condition which is handled before.
		return false
	}
	if ctx.inFieldList {
		// only resolve column using tables.
		return nr.resolveColumnInTableSources(cn, ctx.tables)
	}
	if ctx.inGroupBy {
		// From tables first, then field list.
		// If ctx.InByItemExpression is true, the item is not an identifier.
		// Otherwise it is an identifier.
		if ctx.inByItemExpression {
			// From table first, then field list.
			if nr.resolveColumnInTableSources(cn, ctx.tables) {
				return true
			}
			found := nr.resolveColumnInResultFields(ctx, cn, ctx.fieldList)
			if nr.Err == nil && found {
				// Check if resolved refer is an aggregate function expr.
				if _, ok := cn.Refer.Expr.(*ast.AggregateFuncExpr); ok {
					nr.Err = ErrIllegalReference.Gen("Reference '%s' not supported (reference to group function)", cn.Name.Name.O)
				}
			}
			return found
		}
		// Resolve from table first, then from select list.
		found := nr.resolveColumnInTableSources(cn, ctx.tables)
		if nr.Err != nil {
			return found
		}
		// We should copy the refer here.
		// Because if the ByItem is an identifier, we should check if it
		// is ambiguous even it is already resolved from table source.
		// If the ByItem is not an identifier, we do not need the second check.
		r := cn.Refer
		if nr.resolveColumnInResultFields(ctx, cn, ctx.fieldList) {
			if nr.Err != nil {
				return true
			}
			if r != nil {
				// It is not ambiguous and already resolved from table source.
				// We should restore its Refer.
				cn.Refer = r
			}
			if _, ok := cn.Refer.Expr.(*ast.AggregateFuncExpr); ok {
				nr.Err = ErrIllegalReference.Gen("Reference '%s' not supported (reference to group function)", cn.Name.Name.O)
			}
			return true
		}
		return found
	}
	if ctx.inHaving {
		// First group by, then field list.
		if nr.resolveColumnInResultFields(ctx, cn, ctx.groupBy) {
			return true
		}
		if ctx.inHavingAgg {
			// If cn is in an aggregate function in having clause, check tablesource first.
			if nr.resolveColumnInTableSources(cn, ctx.tables) {
				return true
			}
		}
		return nr.resolveColumnInResultFields(ctx, cn, ctx.fieldList)
	}
	if ctx.inOrderBy {
		if nr.resolveColumnInResultFields(ctx, cn, ctx.groupBy) {
			return true
		}
		if ctx.inByItemExpression {
			// From table first, then field list.
			if nr.resolveColumnInTableSources(cn, ctx.tables) {
				return true
			}
			return nr.resolveColumnInResultFields(ctx, cn, ctx.fieldList)
		}
		// Field list first, then from table.
		if nr.resolveColumnInResultFields(ctx, cn, ctx.fieldList) {
			return true
		}
		return nr.resolveColumnInTableSources(cn, ctx.tables)
	}
	if ctx.inShow {
		return nr.resolveColumnInResultFields(ctx, cn, ctx.fieldList)
	}
	// In where clause.
	return nr.resolveColumnInTableSources(cn, ctx.tables)
}
225012
func InterpretMessageRange(imapMessageRange string) (seqRange SequenceRange, err error) {
	result := rangeRegexp.FindStringSubmatch(imapMessageRange)
	if len(result) == 0 {
		return SequenceRange{}, errInvalidRangeString(imapMessageRange)
	}

	first := SequenceNumber(result[1])
	second := SequenceNumber(result[2])

	// Reduce *:* to *
	if first.Last() && second.Last() {
		return SequenceRange{Min: SequenceNumber("*"), Max: SequenceNumber("")}, nil
	}

	// Ensure "*" is always placed in 'Max'
	if first.Last() && !second.Nil() {
		return SequenceRange{Min: second, Max: first}, nil
	}

	// If both sequence numbers are integer values, we need to sort them
	if first.IsValue() && second.IsValue() {
		firstVal, _ := first.Value()
		secondVal, _ := second.Value()
		if firstVal > secondVal {
			return SequenceRange{Min: second, Max: first}, nil
		}
	}

	return SequenceRange{Min: first, Max: second}, nil
}
1339865
func NewMessage(from, subject, body string) *Message {
	return NewMessageType(from, subject, body, "text/plain")
}
873762
func (c *Conversation) injectMessage(vm ValidMessage) {
	c.injections.messages = append(c.injections.messages, vm)
}
55116
func (b *Box) GetInputCapture() func(event *tcell.EventKey) *tcell.EventKey {
	return b.inputCapture
}
1078363
func (po *Po) parseMessage(l string) {
	l = strings.TrimSpace(strings.TrimPrefix(l, "msgstr"))

	// Check for indexed Translation forms
	if strings.HasPrefix(l, "[") {
		idx := strings.Index(l, "]")
		if idx == -1 {
			// Skip wrong index formatting
			return
		}

		// Parse index
		i, err := strconv.Atoi(l[1:idx])
		if err != nil {
			// Skip wrong index formatting
			return
		}

		// Parse Translation string
		po.trBuffer.Trs[i], _ = strconv.Unquote(strings.TrimSpace(l[idx+1:]))

		// Loop
		return
	}

	// Save single Translation form under 0 index
	po.trBuffer.Trs[0], _ = strconv.Unquote(l)
}
1097826
func (s *Server) HandleMessage(pattern string, handler func(*Message)) {
	rx := regexp.MustCompile(pattern)
	s.messageHandlers = append(s.messageHandlers, messageHandler{rx: rx, f: handler})
}
306785
func (r *ValidationResult) Message(message string, args ...interface{}) *ValidationResult {
	if r.Error != nil {
		if len(args) == 0 {
			r.Error.Message = message
		} else {
			r.Error.Message = fmt.Sprintf(message, args...)
		}
	}
	return r
}
623983
func (e *merryErr) WithMessage(msg string) Error {
	if e == nil {
		return nil
	}
	return e.WithValue(message, msg)
}