// evictionMessage constructs a useful message about why an eviction occurred, and annotations to provide metadata about the eviction
765643
func evictionMessage(resourceToReclaim v1.ResourceName, pod *v1.Pod, stats statsFunc) (message string, annotations map[string]string) {
	annotations = make(map[string]string)
	message = fmt.Sprintf(nodeLowMessageFmt, resourceToReclaim)
	containers := []string{}
	containerUsage := []string{}
	podStats, ok := stats(pod)
	if !ok {
		return
	}
	for _, containerStats := range podStats.Containers {
		for _, container := range pod.Spec.Containers {
			if container.Name == containerStats.Name {
				requests := container.Resources.Requests[resourceToReclaim]
				var usage *resource.Quantity
				switch resourceToReclaim {
				case v1.ResourceEphemeralStorage:
					if containerStats.Rootfs != nil && containerStats.Rootfs.UsedBytes != nil && containerStats.Logs != nil && containerStats.Logs.UsedBytes != nil {
						usage = resource.NewQuantity(int64(*containerStats.Rootfs.UsedBytes+*containerStats.Logs.UsedBytes), resource.BinarySI)
					}
				case v1.ResourceMemory:
					if containerStats.Memory != nil && containerStats.Memory.WorkingSetBytes != nil {
						usage = resource.NewQuantity(int64(*containerStats.Memory.WorkingSetBytes), resource.BinarySI)
					}
				}
				if usage != nil && usage.Cmp(requests) > 0 {
					message += fmt.Sprintf(containerMessageFmt, container.Name, usage.String(), requests.String())
					containers = append(containers, container.Name)
					containerUsage = append(containerUsage, usage.String())
				}
			}
		}
	}
	annotations[OffendingContainersKey] = strings.Join(containers, ",")
	annotations[OffendingContainersUsageKey] = strings.Join(containerUsage, ",")
	annotations[StarvedResourceKey] = string(resourceToReclaim)
	return
}
1046603
func (c *Client) RequestMessage(level string, r *http.Request, msg string) {
	c.RequestMessageWithExtras(level, r, msg, noExtras)
}
1027323
func (s *EntityRecognizerProperties) SetMessage(v string) *EntityRecognizerProperties {
	s.Message = &v
	return s
}
722703
func (u *user) logMessage(t time.Time, m gregor.InBandMessage, i *item) {
	for _, l := range u.log {
		if bytes.Equal(l.m.Metadata().MsgID().Bytes(), m.Metadata().MsgID().Bytes()) {
			return
		}
	}
	u.log = append(u.log, loggedMsg{m, t, i})
}
1140339
func (v *Bonk) GetMessage() (o string) {
	if v != nil && v.Message != nil {
		return *v.Message
	}

	return
}
1000294
func (c *Commit) GetMessage() string {
	if c == nil || c.Message == nil {
		return ""
	}
	return *c.Message
}
806591
func (sc *StatementContext) GetMessage() string {
	sc.mu.Lock()
	msg := sc.mu.message
	sc.mu.Unlock()
	return msg
}
370127
func (bot *BotAPI) DeleteMessage(config DeleteMessageConfig) (APIResponse, error) {
	v, err := config.values()
	if err != nil {
		return APIResponse{}, err
	}

	bot.debugLog(config.method(), v, nil)

	return bot.MakeRequest(config.method(), v)
}
967237
func (mw *MirrorWriter) broadcastMessage(b []byte) bool {
	var dropped bool
	for i, w := range mw.writers {
		_, err := w.Write(b)
		if err != nil {
			mw.writers[i] = nil
			dropped = true
		}
	}
	return dropped
}
98209
func HandlerMessage(entry *logrus.Entry, _ *CustomFormatter) (interface{}, error) {
	return entry.Message, nil
}
811291
func (gitter *Gitter) GetMessage(roomID, messageID string) (*Message, error) {

	var message Message
	response, err := gitter.get(gitter.config.apiBaseURL + "rooms/" + roomID + "/chatMessages/" + messageID)
	if err != nil {
		gitter.log(err)
		return nil, err
	}

	err = json.Unmarshal(response, &message)
	if err != nil {
		gitter.log(err)
		return nil, err
	}

	return &message, nil
}
247256
func (mr *MockAgentMockRecorder) HandleMessage(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleMessage", reflect.TypeOf((*MockAgent)(nil).HandleMessage), arg0, arg1, arg2, arg3, arg4)
}
630487
func rebaseMessage(cls error, err error) string {
	desc := errDesc(err)
	clss := cls.Error()
	if desc == clss {
		return ""
	}

	return strings.TrimSuffix(desc, ": "+clss)
}
1318659
func (s *logger) logMessage(depth int, level LogLevelName, description string, keysAndValues ...interface{}) {
	// If there are an odd number of keysAndValue, then there's probably one
	// missing, which means we'd interpret a value as a key, which can be bad for
	// logs-as-data, like metrics on keys or elasticsearch. But, instead of
	// throwing the corrupt data out, serialize it into a string, which both
	// keeps the info, and maintains key-value integrity.
	if len(keysAndValues)%2 == 1 {
		// But, before checking for corrupt keys, remove golog_id, if present, cuz
		// that's an auto-field, so don't let user's missuse of keysAndValues mess up
		// the ID, which they didn't do incorrectly.
		if len(keysAndValues) >= 2 && keysAndValues[0] == "golog_id" {
			keysAndValues = []interface{}{
				"golog_id", keysAndValues[1],
				"corruptFields", flattenKeyValues(keysAndValues[2:]),
			}
		} else {
			keysAndValues = []interface{}{"corruptFields", flattenKeyValues(keysAndValues)}
		}
	}

	// hack in caller stats
	if defaultStackTrace {
		if _, fn, line, ok := runtime.Caller(depth + 1); ok {
			keysAndValues = append(keysAndValues, "file", filepath.Base(fn), "line", strconv.Itoa(line))
		}
	}

	msg := s.formatLogEvent(s.flags, level, description, s.staticArgs, keysAndValues...)
	s.l.Println(msg)
}
845059
func (f *FileDescriptor) GetMessage(name string) *Descriptor {
	for _, m := range f.GetMessages() {
		if m.GetName() == name || m.GetLongName() == name {
			return m
		}
	}

	return nil
}
96370
func (self *LogRecord) GetMessage() string {
	if len(self.Message) == 0 {
		if self.UseFormat {
			self.Message = fmt.Sprintf(self.Format, self.Args...)
		} else {
			self.Message = fmt.Sprint(self.Args...)
		}
	}
	return self.Message
}
1083849
func (api *Client) UpdateMessage(channelID, timestamp string, options ...MsgOption) (string, string, string, error) {
	return api.SendMessageContext(context.Background(), channelID, MsgOptionUpdate(timestamp), MsgOptionCompose(options...))
}