// Human, when set to true, returns time and byte-values in human-readable format.
7908
func (s *IndicesSegmentsService) Human(human bool) *IndicesSegmentsService {
	s.human = &human
	return s
}
874702
func Time(ctx *cli.Context) command.Command {
	usage := "time"
	desc := "Returns the server time"

	return command.NewCommand("time", usage, desc, func(args ...string) ([]byte, error) {
		t := time.Now().Format(time.RFC1123)
		return []byte("Server time is: " + t), nil
	})
}
1251696
func (k *Key) Time() (time.Time, error) {
	return k.TimeFormat(time.RFC3339)
}
633884
func (p *parser) Time(i int, context string) Time {
	s := p.String(i, context)
	if p.err != nil {
		return Time{}
	}
	v, err := ParseTime(s)
	if err != nil {
		p.SetErr(context, s)
	}
	return v
}
1144449
func (s *ID) Time() time.Time {
	tm, ok := s.UUID().Time()
	if !ok {
		return time.Time{}
	}
	sec, nsec := tm.UnixTime()
	return time.Unix(sec, nsec).UTC()
}
528223
func (s *Stream) Time() time.Duration {
	return duration(C.Pa_GetStreamTime(s.paStream))
}
570127
func (n node) HumanType() string {
	switch k := n.Kind(); k {
	case reflect.Slice:
		c := n.Type().Elem()
		return "[]" + node{Value: reflect.New(c).Elem()}.HumanType()
	default:
		return k.String()
	}
}
677168
func (self *Commands) IsTime(value interface{}) error {
	if stringutil.IsTime(value) {
		return nil
	} else {
		return fmt.Errorf("Expected time value")
	}
}
1045240
func (s *NodesStatsService) Human(human bool) *NodesStatsService {
	s.human = &human
	return s
}
199270
func FormatTime(t *time.Time, formatISO bool) string {
	if formatISO {
		// If requested, use ISO time format.
		// The format we use is RFC3339 without the "T". From the spec:
		// NOTE: ISO 8601 defines date and time separated by "T".
		// Applications using this syntax may choose, for the sake of
		// readability, to specify a full-date and full-time separated by
		// (say) a space character.
		return t.UTC().Format("2006-01-02 15:04:05Z")
	}
	// Otherwise use local time.
	return t.Local().Format("02 Jan 2006 15:04:05Z07:00")
}
337402
func (b *Build) HumanStatus() string {
	switch b.Status {
	case buildbucketpb.Status_SCHEDULED:
		return "Pending"
	case buildbucketpb.Status_STARTED:
		return "Running"
	case buildbucketpb.Status_SUCCESS:
		return "Success"
	case buildbucketpb.Status_FAILURE:
		return "Failure"
	case buildbucketpb.Status_INFRA_FAILURE:
		return "Infra Failure"
	case buildbucketpb.Status_CANCELED:
		return "Cancelled"
	default:
		return "Unknown status"
	}
}
1319115
func HumanDuration(d time.Duration) string {
	t := int64(d.Seconds())
	day := t / 86400
	hr := (t % 86400) / 3600

	if day > 0 {
		if hr != 0 {
			return fmt.Sprintf("%d days %d hrs", day, hr)
		}
		return fmt.Sprintf("%d days", day)
	}

	min := (t % 3600) / 60
	if hr > 0 {
		if min != 0 {
			return fmt.Sprintf("%d hrs %d mins", hr, min)
		}
		return fmt.Sprintf("%d hrs", hr)
	}

	sec := t % 60
	if min > 0 {
		if sec != 0 {
			return fmt.Sprintf("%d mins %d secs", min, sec)
		}
		return fmt.Sprintf("%d mins", min)
	}

	if sec != 0 {
		return fmt.Sprintf("%d secs", sec)
	}

	if d > time.Millisecond {
		return fmt.Sprintf("%d ms", d/time.Millisecond)
	}

	return "0"
}
112622
func (logger *Logger) time(r *record) interface{} {
	return r.time.Format(logger.timeFormat)
}
849441
func (n NamespacedKV) Time(key string) (time.Time, bool) {
	var t time.Time
	valBs, err := n.db.Get(n.prefixedKey(key), nil)
	if err != nil {
		return t, false
	}
	err = t.UnmarshalBinary(valBs)
	return t, err == nil
}
1027576
func HumanSize(bytes uintptr) string {
	switch {
	case bytes < 1024:
		return fmt.Sprintf("%d B", bytes)
	case bytes < 1024*1024:
		return fmt.Sprintf("%.3f KB", float64(bytes)/1024)
	default:
		return fmt.Sprintf("%.3f MB", float64(bytes)/1024/1024)
	}
}
621750
func (id ULID) Time() uint64 {
	return uint64(id[5]) | uint64(id[4])<<8 |
		uint64(id[3])<<16 | uint64(id[2])<<24 |
		uint64(id[1])<<32 | uint64(id[0])<<40
}
543905
func (rs *Ruleset) Humanize(word string) string {
	word = replaceLast(word, "_id", "") // strip foreign key kinds
	// replace and strings in humans list
	for _, rule := range rs.humans {
		word = strings.Replace(word, rule.suffix, rule.replacement, -1)
	}
	sentence := rs.separatedWords(word, " ")

	r, n := utf8.DecodeRuneInString(sentence)
	return string(unicode.ToUpper(r)) + sentence[n:]
}