// GetDateTimer returns a new DateTimer interface of DateTime
972215
func GetDateTimer() DateTimer {
	mu.Lock()
	defer mu.Unlock()

	if date == nil {
		date = &DateTime{}
	}
	return date
}
529453
func NewTimer() *Timer {
	return &Timer{t: time.NewTimer(time.Duration(math.MaxInt64))}
}
384717
func (ms *MetricSystem) StartTimer(name string) TimerToken {
	return TimerToken{
		Name:         name,
		Start:        time.Now(),
		MetricSystem: ms,
	}
}
744492
func (f *FileStorage) GetReader() (io.ReadCloser, error) {
	newFile, err := os.Open(f.file.Name())
	if err != nil {
		return nil, err
	}
	return &FileReader{
		content:      newFile,
		subscription: f.subscription.NewSubscriber(),
		unsubscribe:  f.subscription.RemoveSubscriber,
	}, nil
}
776958
func GetLogger(name string, logger MultiLogger) (l *log.Logger) {
	switch name {
	case "trace": // TODO trace is deprecated, replaced by debug
		l = log.New(loggerRewrite{Logger: logger, Level: log15.LvlDebug}, "", 0)
	case "debug":
		l = log.New(loggerRewrite{Logger: logger, Level: log15.LvlDebug}, "", 0)
	case "info":
		l = log.New(loggerRewrite{Logger: logger, Level: log15.LvlInfo}, "", 0)
	case "warn":
		l = log.New(loggerRewrite{Logger: logger, Level: log15.LvlWarn}, "", 0)
	case "error":
		l = log.New(loggerRewrite{Logger: logger, Level: log15.LvlError}, "", 0)
	case "request":
		l = log.New(loggerRewrite{Logger: logger, Level: log15.LvlInfo}, "", 0)
	}

	return l

}
1105447
func GetOrRegisterResettingTimer(name string, r Registry) ResettingTimer {
	if nil == r {
		r = DefaultRegistry
	}
	return r.GetOrRegister(name, NewResettingTimer).(ResettingTimer)
}
1231201
func (f *Feeds) GetTimelineURL() string {
	if f == nil || f.TimelineURL == nil {
		return ""
	}
	return *f.TimelineURL
}
148725
func (t *TrendService) GetGenre(req TrendGenreRequest) (*TrendGenreResponse, error) {

	v := url.Values{}
	if req.Lang != nil {
		v.Set("lang", *req.Lang)
	}

	var trendRes TrendGenreResponse
	res, err := t.client.get(t.ctx, TrendGenreURL, v, &trendRes)
	if err != nil {
		return nil, err
	}

	defer res.Body.Close()

	return &trendRes, nil
}
721038
func GetOrRegisterTimer(name string, r Registry) Timer {
	if nil == r {
		r = DefaultRegistry
	}
	return r.GetOrRegister(name, NewTimer).(Timer)
}
549890
func (e *Endpoint) getLogger() *logrus.Entry {
	v := atomic.LoadPointer(&e.logger)
	return (*logrus.Entry)(v)
}
906354
func (t *timeoutTicker) stopTimer() {
	// Stop() returns false if it was already fired or was stopped
	if !t.timer.Stop() {
		select {
		case <-t.timer.C:
		default:
			t.Logger.Debug("Timer already stopped")
		}
	}
}
669043
func TimeRepr(t time.Time) (string, error) {
	notification := TimeNotification{
		Time: t.String(),
	}
	repr, err := json.Marshal(notification)
	return string(repr), err
}
217475
func (c *config) GetIntErr(key string, args ...interface{}) (int, error) {
	val, err := c.Get(key, args...)
	if err != nil {
		return 0, err
	}
	ival, err := cfg.ToInt(val)
	c.log(TOINT, err, toVarArgs(args, val, ival)...)
	return ival, err
}
1317020
func (c *connector) GetAttr(key string) interface{} {
	c.RLock()
	v := c.attrs[key]
	c.RUnlock()
	return v
}
29270
func (l Tickers) GetTicker(id int32) tick.Ticker {
	l.RLock()
	defer l.RUnlock()
	return l.list[id]
}
948521
func stoppedTimer() *time.Timer {
	timer := time.NewTimer(0)
	if !timer.Stop() {
		<-timer.C
	}
	return timer
}
1236922
func getItemsPtr(list runtime.Object) (interface{}, error) {
	v, err := conversion.EnforcePtr(list)
	if err != nil {
		return nil, err
	}

	items := v.FieldByName("Items")
	if !items.IsValid() {
		return nil, errExpectFieldItems
	}
	switch items.Kind() {
	case reflect.Interface, reflect.Ptr:
		target := reflect.TypeOf(items.Interface()).Elem()
		if target.Kind() != reflect.Slice {
			return nil, errExpectSliceItems
		}
		return items.Interface(), nil
	case reflect.Slice:
		return items.Addr().Interface(), nil
	default:
		return nil, errExpectSliceItems
	}
}