// DefaultOneTimeKeyboard ...
340923
func (bot *TgBot) DefaultOneTimeKeyboard(b bool) *TgBot {
	bot.DefaultOptions.OneTimeKeyboard = &b
	return bot
}
956913
func DefaultTimeout(tx interface{}) *time.Duration {
	var td time.Duration
	switch raw := tx.(type) {
	case time.Duration:
		return &raw
	case int64:
		td = time.Duration(raw)
	case float64:
		td = time.Duration(int64(raw))
	default:
		log.Printf("[WARN] Unknown type in DefaultTimeout: %#v", tx)
	}
	return &td
}
490963
func (c *KeyboardScroller) BindKeyboard(hori, vert string) {
	c.keysMu.Lock()

	c.verticalAxis = vert
	c.horizontalAxis = hori

	defer c.keysMu.Unlock()
}
917094
func (l *defaultLogger) SetLogTimeFormat(format string) {
	log.SetFlags(0) // disable timestamp logging done by the log package
	l.timeFormat = format
}
83269
func (ckf ComputedKeyFamily) GetKeyRoleAtTime(kid keybase1.KID, t time.Time) (ret KeyRole) {
	if info, err := ckf.getCkiIfActiveAtTime(kid, t); err != nil {
		ckf.G().Log.Debug("GetKeyRoleAtTime %s, %s => err %s", kid, t, err)
		ret = DLGNone
	} else if info.Sibkey {
		ret = DLGSibkey
	} else {
		ret = DLGSubkey
	}
	return
}
764686
func ErrorTimeFinder(err error) (time.Time, bool) {
	if err == nil {
		return time.Time{}, false
	}

	if tserr, ok := err.(*timestampError); ok {
		if tserr == nil {
			return time.Time{}, false
		}
		return tserr.time, true
	}

	for {
		if e, ok := err.(errorCauser); ok {
			if tserr, ok := e.(*timestampError); ok {
				if tserr == nil {
					break
				}
				return tserr.time, true
			}
			err = e.Cause()
			continue
		}
		break
	}

	return time.Time{}, false
}
273199
func convertTermboxKeyboardEvent(e tb.Event) Event {
	ID := "%s"
	if e.Mod == tb.ModAlt {
		ID = "<M-%s>"
	}

	if e.Ch != 0 {
		ID = fmt.Sprintf(ID, string(e.Ch))
	} else {
		converted, ok := keyboardMap[e.Key]
		if !ok {
			converted = ""
		}
		ID = fmt.Sprintf(ID, converted)
	}

	return Event{
		Type: KeyboardEvent,
		ID:   ID,
	}
}
30751
func OutputSignatureSuccessNonKeybase(m libkb.MetaContext, keyID uint64, signatureTime time.Time) error {
	arg := keybase1.OutputSignatureSuccessNonKeybaseArg{
		KeyID:    fmt.Sprintf("%X", keyID),
		SignedAt: keybase1.TimeFromSeconds(signatureTime.Unix()),
	}
	return m.UIs().PgpUI.OutputSignatureSuccessNonKeybase(m.Ctx(), arg)
}
727284
func WithDefaultRuntime(rt string) ClientOpt {
	return func(c *clientOpts) error {
		c.defaultRuntime = rt
		return nil
	}
}
215255
func (namespace *Namespace) KeyNameSpaceWithTime(key string, key_time goltime.Timestamp) string {
	return fmt.Sprintf("%s:%s", key, namespace.TimeKeyPart(key_time))
}
297388
func startTime(c context.Context) time.Time {
	ts, ok := c.Value(startTimeContextKey(0)).(time.Time)
	if !ok {
		panic("impossible, startTimeContextKey is not set")
	}
	return ts
}
745741
func (ckf ComputedKeyFamily) GetAllActiveKeysWithRoleAtTime(role KeyRole, t time.Time) (ret []GenericKey) {
	for kid := range ckf.kf.AllKIDs {
		if ckf.GetKeyRoleAtTime(kid, t) == role {
			key, err := ckf.FindKeyWithKIDUnsafe(kid)
			if err != nil {
				ckf.G().Log.Warning("GetAllActiveKeysWithRoleAtTime: Error in getting KID %s: %s", kid, err)
			}
			if key == nil {
				ckf.G().Log.Warning("GetAllActiveKeysWithRoleAtTime: Null key for KID %s", kid)
			} else {
				ret = append(ret, key)
			}
		}
	}
	return
}
143571
func StartTimeFromContext(ctx context.Context) (start time.Time, ok bool) {
	start, ok = ctx.Value(ctxKeyStartTime).(time.Time)
	return
}
1167437
func timeHookFunc(from reflect.Type, to reflect.Type, data interface{}) (interface{}, error) {
	// Decode time.Time
	if to == timeType {
		var timeInt int64

		switch from.Kind() {
		case reflect.Int:
			timeInt = int64(data.(int))
		case reflect.String:
			var err error
			timeInt, err = strconv.ParseInt(data.(string), 10, 64)
			if err != nil {
				return nil, fmt.Errorf("invalid time %q: %v", data, err)
			}
		}

		if timeInt > 0 {
			return time.Unix(timeInt, 0), nil
		}
	}

	return data, nil
}
105302
func TclToKeybaseTime(tcl TypedChainLink) *KeybaseTime {
	return &KeybaseTime{
		Unix:  tcl.GetCTime().Unix(),
		Chain: tcl.GetMerkleSeqno(),
	}
}
1280408
func (me *DefaultAdapter) LiteralTime(buf *SqlBuilder, t time.Time) error {
	if buf.IsPrepared {
		return me.PlaceHolderSql(buf, t)
	}
	return me.Literal(buf, t.UTC().Format(me.TimeFormat))
}
645399
func (enc *Encoder) Uint16KeyOmitEmpty(key string, v uint16) {
	enc.Uint64KeyOmitEmpty(key, uint64(v))
}