// IsTomorrow determines if the current time is tomorrow
976585
func (c *Carbon) IsTomorrow() bool {
	n := Now().AddDay()

	return c.IsSameDay(n)
}
120605
func (t *TopK) isTop(freq uint64) bool {
	if t.elements.Len() < int(t.k) {
		return true
	}

	return freq >= (*t.elements)[0].Freq
}
55830
func (d *Dialer) deadline() time.Time {
	if d.Timeout == 0 {
		return d.Deadline
	}
	timeout := time.Now().Add(d.Timeout)
	if d.Deadline.IsZero() || timeout.Before(d.Deadline) {
		return timeout
	}
	return d.Deadline
}
850301
func (c *Carbon) IsYesterday() bool {
	n := Now().SubDay()

	return c.IsSameDay(n)
}
136892
func (this *Future) GetOrTimeout(mm uint) (val interface{}, err error, timout bool) {
	if mm == 0 {
		mm = 10
	} else {
		mm = mm * 1000 * 1000
	}

	select {
	case <-time.After((time.Duration)(mm) * time.Nanosecond):
		return nil, nil, true
	case <-this.final:
		r, err := getFutureReturnVal(this.loadResult())
		return r, err, false
	}
}
1072750
func (c *crontime) nextValidHour(baseTime time.Time) {
	for _, hour := range c.hour {
		if c.calculatedTime.Day() == baseTime.Day() {
			if !hasPassed(hour, c.calculatedTime.Hour()) {
				c.calculatedTime = setHour(c.calculatedTime, hour)
				return
			}
		} else {
			c.calculatedTime = setHour(c.calculatedTime, hour)
			return
		}
	}
	// If no result was found try it again in the following day.
	c.calculatedTime = c.calculatedTime.AddDate(0, 0, 1)    // <-|
	c.calculatedTime = setHour(c.calculatedTime, c.hour[0]) //   |
	//log.Println("Cronbee: Hour", c.calculatedTime, baseTime) // |
	c.nextValidMonth(baseTime) // May trigger a new month --------|
	c.nextValidDay(baseTime)
	c.nextValidHour(baseTime)
}
627706
func NewSchedule(ctx ttnlog.Interface) Schedule {
	s := &schedule{
		ctx:                   ctx,
		items:                 make(map[string]*scheduledItem),
		downlinkSubscriptions: make(map[string]chan *router_pb.DownlinkMessage),
	}
	go func() {
		for {
			<-time.After(10 * time.Second)
			s.RLock()
			numItems := len(s.items)
			s.RUnlock()
			if numItems > 0 {
				s.Lock()
				for id, item := range s.items {
					// Delete the item if we are more than 2 seconds after the deadline
					if time.Now().After(item.deadlineAt.Add(2 * time.Second)) {
						delete(s.items, id)
					}
				}
				s.Unlock()
			}
		}
	}()
	return s
}
312338
func isTemporaryNetworkError(err error) bool {
	if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) {
		return true
	}
	return false
}
251778
func (t TimeRange) IsZero() bool {
	return t.Min.IsZero() && t.Max.IsZero()
}
996924
func IsThinWaist(m ma.Multiaddr) bool {
	m = zoneless(m)
	if m == nil {
		return false
	}
	p := m.Protocols()

	// nothing? not even a waist.
	if len(p) == 0 {
		return false
	}

	if p[0].Code != ma.P_IP4 && p[0].Code != ma.P_IP6 {
		return false
	}

	// only IP? still counts.
	if len(p) == 1 {
		return true
	}

	switch p[1].Code {
	case ma.P_TCP, ma.P_UDP, ma.P_IP4, ma.P_IP6:
		return true
	default:
		return false
	}
}
1075941
func isNewer(ti time.Time, newerRef string) bool {
	objectAge := UTCNow().Sub(ti)
	var e error
	var newerThan time.Duration
	if newerRef != "" {
		newerThan, e = ioutils.ParseDurationTime(newerRef)
		fatalIf(probe.NewError(e), "Unable to parse newerThan=`"+newerRef+"`.")
	}
	return objectAge >= newerThan
}
146728
func isInternal(n *node) bool {
	if n == nil {
		return false
	}
	return n.entry == nil
}
169834
func isTime(v interface{}) bool {
	s, ok := v.(string)
	if !ok {
		return false
	}
	if _, err := time.Parse("15:04:05Z07:00", s); err == nil {
		return true
	}
	if _, err := time.Parse("15:04:05.999999999Z07:00", s); err == nil {
		return true
	}
	return false
}
254407
func (c *Cluster) IsManager() bool {
	c.mu.RLock()
	defer c.mu.RUnlock()
	return c.currentNodeState().IsActiveManager()
}
784035
func IsTimeoutError(err error) bool {
	return yarpcerrors.FromError(err).Code() == yarpcerrors.CodeDeadlineExceeded
}
630157
func NewTimestampTsCell(t time.Time) TsCell {
	v := ToUnixMillis(t)
	tsc := riak_ts.TsCell{TimestampValue: &v}
	tsct := riak_ts.TsColumnType_TIMESTAMP
	return TsCell{columnType: tsct, cell: &tsc}
}
496592
func (t *Time) IsZero() bool {
	if t == nil {
		return true
	}
	return t.Time.IsZero()
}