// Cacheable checks whether the input ast is cacheable.
359581
func Cacheable(node ast.Node) bool {
	_, isSelect := node.(*ast.SelectStmt)
	_, isUpdate := node.(*ast.UpdateStmt)
	_, isInsert := node.(*ast.InsertStmt)
	_, isDelete := node.(*ast.DeleteStmt)
	if !(isSelect || isUpdate || isInsert || isDelete) {
		return false
	}
	checker := cacheableChecker{
		cacheable: true,
	}
	node.Accept(&checker)
	return checker.cacheable
}
1270307
func isIterable(src interface{}) bool {
	if src == nil {
		return false
	}
	t := reflect.TypeOf(src)
	if t.Kind() == reflect.Ptr {
		t = t.Elem()
	}
	return t.Kind() == reflect.Slice || t.Kind() == reflect.Array
}
255862
func (p *SortKeys) AsSortable(data []Record) *Sortable {
	bk := &Sortable{
		Keys:        p.Keys,
		Data:        data,
		Comparators: make([]SortComparator, len(p.Keys), len(p.Keys)),
	}
	for x, c := range p.AsRecordComparators() {
		c := c
		bk.Comparators[x] = func(i, j int) bool {
			return c(bk.Data[i], bk.Data[j])
		}
	}
	return bk
}
1342907
func (md *RootMetadata) IsReadable() bool {
	return md.TlfID().Type() == tlf.Public || md.data.Dir.IsInitialized()
}
680689
func (c *CachePolicy) Enabled() bool {
	if c.EnabledFlag == "" {
		return true
	}
	enabled, _ := utils.ParseBool(c.EnabledFlag)
	return enabled
}
1352199
func (d dynamicSystemView) CachingDisabled() bool {
	return d.core.cachingDisabled || (d.mountEntry != nil && d.mountEntry.Config.ForceNoCache)
}
1103583
func isPrintable(s string) bool {
	if !utf8.ValidString(s) {
		return false
	}
	for _, ch := range s {
		if !unicode.IsPrint(ch) {
			return false
		}
	}
	return true
}
61449
func (e *edge) execIfPossible(f *pipeFactory) bool {
	if len(e.cacheRecords) > 0 {
		if e.keysDidChange {
			e.postpone(f)
			return true
		}
		e.execReq = f.NewFuncRequest(e.loadCache)
		for req := range e.depRequests {
			req.Cancel()
		}
		return true
	} else if e.allDepsCompleted {
		if e.keysDidChange {
			e.postpone(f)
			return true
		}
		e.execReq = f.NewFuncRequest(e.execOp)
		return true
	}
	return false
}
1234033
func (k *Item) SetSynchronizable(sync Synchronizable) {
	if sync != SynchronizableDefault {
		k.attr[SynchronizableKey] = syncTypeRef[sync]
	} else {
		delete(k.attr, SynchronizableKey)
	}
}
179937
func (s *Switch) AllocateTable() (int, error) {
	s.lock.Lock()
	defer s.lock.Unlock()

	// Make lazy intialization
	if s.tables == nil {
		for i := 0; i < int(s.features.NumTables); i++ {
			s.tables = append(s.tables, i)
		}
	}

	// The first table is reserved for protocol matching.
	if len(s.tables) < 2 {
		return 0, ErrTableAllocate
	}

	tableNo := s.tables[1]
	s.tables = append(s.tables[:1], s.tables[2:]...)

	return tableNo, nil
}
116937
func IsAccessible() bool {
	if pkcs11Lib == "" {
		return false
	}
	ctx, session, err := SetupHSMEnv(pkcs11Lib, defaultLoader)
	if err != nil {
		return false
	}
	defer cleanup(ctx, session)
	return true
}
350192
func IsPrintableASCII(s string) bool {
	for _, v := range s {
		if v < ' ' || v > '~' {
			return false
		}
	}
	return true
}
1213883
func NewTable(db ethdb.Database, prefix string) ethdb.Database {
	return &table{
		db:     db,
		prefix: prefix,
	}
}
750466
func (a *AQL) Cache(enable bool) *AQL {
	a.cache = &enable
	return a
}
922332
func isReadable(char *gen.CharacteristicMetadata) bool {
	for _, perm := range char.Properties {
		if perm == "read" {
			return true
		}
	}

	return false
}
560990
func (h *HTTPBin) Cache(w http.ResponseWriter, r *http.Request) {
	if r.Header.Get("If-Modified-Since") != "" || r.Header.Get("If-None-Match") != "" {
		w.WriteHeader(http.StatusNotModified)
		return
	}

	lastModified := time.Now().Format(time.RFC1123)
	w.Header().Add("Last-Modified", lastModified)
	w.Header().Add("ETag", sha1hash(lastModified))
	h.Get(w, r)
}
1002598
func NewTable(headers []string) *Table {
	pt := &Table{
		headers:     headers,
		columnWidth: make([]int, len(headers)),
		colSpacing:  "   ",
		transformer: make([]Transformer, len(headers)),
	}
	// Standard colorization, column 0 is auto-highlighted as some
	// name. Everything else has no transformation (== identity
	// transform)
	for i := range pt.transformer {
		pt.transformer[i] = nop
	}
	if 0 < len(headers) {
		pt.transformer[0] = TableContentHeaderColor
	}
	return pt
}