// RepositoryExists checks whether a given repository specified by repositoryID exists.
510044
func (client NexusClient) RepositoryExists(repositoryID RepositoryID) (bool, error) {
	retry := retry.New(3, retry.DefaultBackoffFunc)

	var responseCode int
	work := func() error {
		req, err := http.NewRequest("HEAD", client.BaseURL+"/service/local/repositories/"+string(repositoryID), nil)
		if err != nil {
			return err
		}
		req.SetBasicAuth(client.Username, client.Password)
		req.Header.Add("Accept", "application/json")

		resp, err := client.HttpClient.Do(req)
		if err != nil {
			return err
		}
		resp.Body.Close()

		responseCode = resp.StatusCode
		if !(responseCode == http.StatusOK || responseCode == http.StatusNotFound) {
			return fmt.Errorf("HTTP HEAD status code for whether repository ID exists returns neither 200 or 404: %d\n", responseCode)
		}
		return nil
	}
	return responseCode == http.StatusOK, retry.Try(work)
}
1220851
func (d Data) KeyExists(key string) bool {
	_, found := d.Values[key]
	return found
}
353036
func NodeExists(id uint64, nodes []uint64) bool {
	for _, nodeID := range nodes {
		if nodeID == id {
			return true
		}
	}
	return false
}
306008
func (r *GormWorkItemRepository) CheckExists(ctx context.Context, workitemID uuid.UUID) error {
	defer goa.MeasureSince([]string{"goa", "db", "workitem", "exists"}, time.Now())
	return repository.CheckExists(ctx, r.db, workitemTableName, workitemID)
}
883686
func (S3PathChecker) FileExists(path string) bool {
	reader, err := pathio.Reader(path)
	if reader != nil {
		defer reader.Close()
	}
	return err == nil
}
241256
func (c retryManifest) Exists(ctx context.Context, dgst digest.Digest) (bool, error) {
	for i := 0; ; i++ {
		if err := c.repo.limiter.Wait(ctx); err != nil {
			return false, err
		}
		exists, err := c.ManifestService.Exists(ctx, dgst)
		if c.repo.shouldRetry(i, err) {
			continue
		}
		return exists, err
	}
}
212958
func (g *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error) {
	_, err := g.instanceByProviderID(providerID)
	if err != nil {
		if err == cloudprovider.InstanceNotFound {
			return false, nil
		}
		return false, err
	}

	return true, nil
}
69404
func pathExists(p string) bool {
	if _, err := os.Lstat(p); err != nil && os.IsNotExist(err) {
		return false
	}
	return true
}
770725
func pathExists(ss ...string) bool {
	name := filepath.Join(ss...)
	if _, err := os.Stat(name); err != nil {
		if os.IsNotExist(err) {
			return false
		}
	}
	return true
}
325968
func PathExists(conn client.Connection, p string) (bool, error) {
	exists, err := conn.Exists(p)
	if err == client.ErrNoNode {
		return false, nil
	}
	return exists, err
}
342969
func (m *GormIdentityRepository) CheckExists(ctx context.Context, id string) error {
	defer goa.MeasureSince([]string{"goa", "db", "identity", "exists"}, time.Now())
	return base.CheckExists(ctx, m.db, m.TableName(), id)
}
12537
func (s *Store) IndexExists(tx *bolt.Tx, typeName, indexName string) bool {
	return (tx.Bucket(indexBucketName(typeName, indexName)) != nil)
}
888166
func (asw *actualStateOfWorld) SnapshotExists(snapshotName string) bool {
	asw.RLock()
	defer asw.RUnlock()
	_, snapshotExists := asw.snapshots[snapshotName]

	return snapshotExists
}
48188
func (s *StateStore) namespaceExists(txn *memdb.Txn, namespace string) (bool, error) {
	return namespace == structs.DefaultNamespace, nil
}
490134
func (s *UpdateCondition) SetExists(v bool) *UpdateCondition {
	s.Exists = &v
	return s
}
1298116
func (a arping) blockUntilInterfaceExists(interfaceName string) {
	// TODO: Timeout waiting for net interface to exist?
	for !a.fs.FileExists(path.Join("/sys/class/net", interfaceName)) {
		time.Sleep(a.interfaceCheckDelay)
	}
}
1365323
func unresolvablePredicateExists(failedPredicates []predicates.PredicateFailureReason) bool {
	for _, failedPredicate := range failedPredicates {
		if _, ok := unresolvablePredicateFailureErrors[failedPredicate]; ok {
			return true
		}
	}
	return false
}