// IsNew returns true if the supplied timestamp for the supplied key is more recent than the
// timestamp we have on record.
14729
func (t *TSCache) IsNew(key string, tm time.Time) bool {
	t.mux.RLock()
	defer t.mux.RUnlock()
	v, ok := t.table[key]
	if !ok {
		return true // We've never seen this before, so consider everything a new sample
	}
	return !tm.Before(v)
}
714515
func (o *MockOracle) IsExpired(lockTimestamp uint64, TTL uint64) bool {
	o.RLock()
	defer o.RUnlock()

	return oracle.GetPhysical(time.Now().Add(o.offset)) >= oracle.ExtractPhysical(lockTimestamp)+int64(TTL)
}
853031
func (p Bits) HasRowKeys() bool {
	for i := range p {
		if p[i].RowKey != "" {
			return true
		}
	}
	return false
}
1028235
func (p *TTLPolicy) IsExpired(obj *timestampedEntry) bool {
	return p.Ttl > 0 && p.Clock.Since(obj.timestamp) > p.Ttl
}
145431
func (mem *Memcache) IsExist(key string) bool {
	if _, err := mem.conn.Get(key); err != nil {
		return false
	}
	return true
}
540680
func (d *indirectIndex) MaybeContainsValue(key []byte, timestamp int64) bool {
	d.mu.RLock()
	defer d.mu.RUnlock()

	iter := d.ro.Iterator()
	exact, _ := iter.Seek(key, &d.b)
	if !exact {
		return false
	}

	for _, t := range d.tombstones[iter.Offset()] {
		if t.Min <= timestamp && timestamp <= t.Max {
			return false
		}
	}

	if d.prefixTombstones.checkOverlap(key, timestamp) {
		return false
	}

	entries, err := d.ReadEntries(key, nil)
	if err != nil {
		d.logger.Error("error reading tsm index key", zap.String("key", fmt.Sprintf("%q", key)))
		return false
	}

	for _, entry := range entries {
		if entry.Contains(timestamp) {
			return true
		}
	}

	return false
}
694149
func IsGreaterThan(timeLeft time.Time, timeRight time.Time, orEqual bool) bool {
	if timeLeft.After(timeRight) {
		return true
	} else if orEqual && timeLeft.Equal(timeRight) {
		return true
	}
	return false
}
332432
func isBefore(key, max []byte) bool {
	return key != nil && bytes.Compare(key, max) <= 0
}
855439
func isNewGUI(st *state.State) bool {
	vers, err := st.GUIVersion()
	if err != nil {
		logger.Warningf("cannot retrieve GUI version: %v", err)
		// Assume a recent version of the GUI is being served.
		return true
	}
	return vers.Major > 2 || (vers.Major == 2 && vers.Minor >= 3)
}
279913
func IsKeyInDomain(key, start, end []byte) bool {
	if bytes.Compare(key, start) < 0 {
		return false
	}
	if end != nil && bytes.Compare(end, key) <= 0 {
		return false
	}
	return true
}
58768
func (cred Credentials) IsExpired() bool {
	if cred.Expiration.IsZero() || cred.Expiration == timeSentinel {
		return false
	}

	return cred.Expiration.Before(time.Now().UTC())
}
844476
func (d *ResourceDiff) HasChange(key string) bool {
	old, new := d.GetChange(key)

	// If the type implements the Equal interface, then call that
	// instead of just doing a reflect.DeepEqual. An example where this is
	// needed is *Set
	if eq, ok := old.(Equal); ok {
		return !eq.Equal(new)
	}

	return !reflect.DeepEqual(old, new)
}
533525
func (d *Diff) HasChanged() bool {
	if d.HasKeyAdded() || d.HasKeyRemoved() {
		return true
	}
	return false
}
1116603
func IsRightWinding(a, b *T) bool {
	ab := b.Rotated(-a.Angle())
	return ab.Angle() < 0
}
1306066
func (wkb TLFWriterKeyBundleV3) IsWriter(user keybase1.UID, deviceKey kbfscrypto.CryptPublicKey) bool {
	_, ok := wkb.Keys[user][deviceKey]
	return ok
}
1269258
func hasExpired(eventTime time.Time, lastUpdate time.Time, maxDuration time.Duration) bool {
	return eventTime.Sub(lastUpdate) > maxDuration*2 // consider stable if it's ok for twice the maxDuration
}
672183
func (r *Redis) IsExist(key string) bool {
	conn := r.conn.Get()
	defer conn.Close()

	a, _ := conn.Do("EXISTS", key)
	i := a.(int64)
	if i > 0 {
		return true
	}
	return false
}