// CheckExists does the same as Exists for a hard deletable item but only returns the error value; thereby
// being a handy convenience function.
483698
func CheckHardDeletableExists(ctx context.Context, db *gorm.DB, tableName string, id string) error {
	_, err := exists(ctx, db, tableName, "id", id, false)
	return err
}
553822
func FileExists(path string) bool {
	ret, isDir := FileOrDirExists(path)
	return ret && !isDir
}
187706
func (c *collection) IndexExists(ctx context.Context, name string) (bool, error) {
	req, err := c.conn.NewRequest("GET", path.Join(c.relPath("index"), name))
	if err != nil {
		return false, WithStack(err)
	}
	resp, err := c.conn.Do(ctx, req)
	if err != nil {
		return false, WithStack(err)
	}
	if err := resp.CheckStatus(200); err == nil {
		return true, nil
	} else if IsNotFound(err) {
		return false, nil
	} else {
		return false, WithStack(err)
	}
}
647032
func (vrsConnection *VRSConnection) CheckEntityExists(id string) (bool, error) {
	readRowArgs := ovsdb.ReadRowArgs{
		Condition: []string{ovsdb.NuageVMTableColumnVMUUID, "==", id},
		Columns:   []string{ovsdb.NuageVMTableColumnVMUUID},
	}

	var idRows []map[string]interface{}
	var err error
	if idRows, err = vrsConnection.vmTable.ReadRows(vrsConnection.ovsdbClient, readRowArgs); err != nil {
		return false, fmt.Errorf("OVSDB read error %v", err)
	}

	var ids []string
	for _, row := range idRows {
		ids = append(ids, row[ovsdb.NuageVMTableColumnVMUUID].(string))
	}

	if len(ids) == 1 && id == ids[0] {
		return true, err
	}

	return false, err
}
888166
func (asw *actualStateOfWorld) SnapshotExists(snapshotName string) bool {
	asw.RLock()
	defer asw.RUnlock()
	_, snapshotExists := asw.snapshots[snapshotName]

	return snapshotExists
}
608119
func (c *LedisCacher) IsExist(key string) bool {
	count, err := c.c.Exists([]byte(key))
	if err == nil && count > 0 {
		return true
	}
	c.c.HDel(defaultHSetName, []byte(key))
	return false
}
1220851
func (d Data) KeyExists(key string) bool {
	_, found := d.Values[key]
	return found
}
970644
func (c *BundlingChecker) PresumeExists(item *Item) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.existingDigests[string(item.Digest)] = struct{}{}
}
45282
func (fsh *Handler) FileExists(file string) bool {
	if _, err := os.Stat(file); os.IsNotExist(err) {
		return false
	}
	return true
}
1070105
func (ns *Namespace) FileExists(i interface{}) (bool, error) {
	path, err := cast.ToStringE(i)
	if err != nil {
		return false, err
	}

	if path == "" {
		return false, errors.New("fileExists needs a path to a file")
	}

	status, err := afero.Exists(ns.readFileFs, path)
	if err != nil {
		return false, err
	}

	return status, nil
}
1359609
func (set *Set) Exists(item interface{}) bool {
	set.lock.RLock()

	_, ok := set.items[item]

	set.lock.RUnlock()

	return ok
}
1231497
func (c *Connector) ScopeExists(ctx context.Context, scope string) (bool, error) {
	return true, nil
}
1239226
func (c *APIStore) BucketExists(name string) bool {
	b, err := c.service.Buckets.Get(name).Do()
	if err != nil {
		return false
	}

	return b.Id != ""
}
1222636
func (s *resourceServiceImpl) CheckExists(ctx context.Context, resourceID string) error {
	return s.Repositories().ResourceRepository().CheckExists(ctx, resourceID)
}
332909
func (s *solver) checkRevisionExists(a atomWithPackages, cdep completeDep) error {
	r, isrev := cdep.Constraint.(Revision)
	if !isrev {
		// Constraint is not a revision; nothing to do
		return nil
	}

	present, _ := s.b.RevisionPresentIn(cdep.Ident, r)
	if present {
		return nil
	}

	return &nonexistentRevisionFailure{
		goal: dependency{
			depender: a.a,
			dep:      cdep,
		},
		r: r,
	}
}
346253
func (mock *Mock) FileExists(file string) bool {
	items := mock.getReturnValues("FileExists")
	return items[0].(bool)
}
306325
func (r *GormTrackerQueryRepository) CheckExists(ctx context.Context, id uuid.UUID) error {
	return repository.CheckExists(ctx, r.db, trackerQueriesTableName, id)
}