/*
Determines if a streaming distribution already exists for a given bucket
183918
protected List<StreamingDistributionSummary> getAllExistingDistributions(String bucketName) {

        List<StreamingDistributionSummary> distListForBucket = new ArrayList<>();

        StreamingDistributionList distList =
            cfClient.listStreamingDistributions(new ListStreamingDistributionsRequest())
                    .getStreamingDistributionList();

        List<StreamingDistributionSummary> streamingDistList = distList.getItems();
        while (distList.isTruncated()) {
            distList = cfClient.listStreamingDistributions(
                new ListStreamingDistributionsRequest().withMarker(distList.getNextMarker()))
                               .getStreamingDistributionList();
            streamingDistList.addAll(distList.getItems());
        }

        for (StreamingDistributionSummary distSummary : streamingDistList) {
            if (isDistFromBucket(bucketName, distSummary)) {
                distListForBucket.add(distSummary);
            }
        }

        return distListForBucket;
    }
167935
private boolean datastreamExists(FedoraClient fedora, String vitalPid,
            String dsPid) {
        try {
            // Some options:
            // * getAPIA().listDatastreams... seems best
            // * getAPIM().getDatastream... causes Exceptions against new IDs
            // * getAPIM().getDatastreams... is limited to a single state
            DatastreamDef[] streams = fedora.getAPIA().listDatastreams(
                    vitalPid, null);
            for (DatastreamDef stream : streams) {
                if (stream.getID().equals(dsPid)) {
                    return true;
                }
            }
        } catch (Exception ex) {
            log.error("API Query error: ", ex);
        }
        return false;
    }
60271
def exists(self, callback=None):
        
        def existence_tested(response):
            if callable(callback):
                callback(bool(response))
        self.bucket.lookup(self.name, callback=existence_tested)
744617
def bucket_exists(self, bucket_name):
        
        is_valid_bucket_name(bucket_name)

        try:
            self._url_open('HEAD', bucket_name=bucket_name)
        # If the bucket has not been created yet, MinIO will return a "NoSuchBucket" error.
        except NoSuchBucket:
            return False
        except ResponseError:
            raise
        return True
287578
private boolean isBucketProcessed(int bucketId) {
        synchronized (actualProcessingBuckets) {
            for (Bucket<Data> oneBucket : this.actualProcessingBuckets) {
                if (oneBucket.getBucketId() == bucketId) {
                    return true;
                }
            }
        }
        return false;
    }
188913
function (key) {
            var hash = hashFunction(key), ret = false;
            var bucket = null;
            if ((bucket = this.__map[hash]) != null) {
                ret = bucket.find(key) != null;
            }
            return ret;
        }
929590
def exists(self, qname):
        '''
        
        '''
        try:
            # First if not exists() -> exit
            if self.conn.queue_exists(qname):
                return True
            return False
        except pyrax.exceptions as err_msg:
            log.error('RackSpace API got some problems during '
                      'existing queue check: %s',
                      err_msg)
        return False
613847
def artifact_already_exists(cli, meta, owner):
    
    distro_name = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist())

    try:
        dist_info = cli.distribution(owner, meta.name(), meta.version(), distro_name)
    except binstar_client.errors.NotFound:
        dist_info = {}

    return bool(dist_info)
704928
def exists(name, path=None):
    '''
    
    '''

    _exists = name in ls_(path=path)
    # container may be just created but we did cached earlier the
    # lxc-ls results
    if not _exists:
        _exists = name in ls_(cache=False, path=path)
    return _exists
598971
static long getBucketsNeeded(long maxKeys,double loadFactor,int bucketSize) {
		/*
		 * force a power-of-two bucket count so hash functions for bucket index
		 * can hashBits%numBuckets and get randomly distributed index. See wiki
		 * "Modulo Bias". Only time we can get perfectly distributed index is
		 * when numBuckets is a power of 2.
		 */
		long bucketsNeeded = DoubleMath.roundToLong((1.0 / loadFactor) * maxKeys / bucketSize, RoundingMode.UP);
		// get next biggest power of 2
		long bitPos = Long.highestOneBit(bucketsNeeded);
		if (bucketsNeeded > bitPos)
			bitPos = bitPos << 1;
		return bitPos;
	}
621409
def exists(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        elb = conn.get_all_load_balancers(load_balancer_names=[name])
        if elb:
            return True
        else:
            log.debug('The load balancer does not exist in region %s', region)
            return False
    except boto.exception.BotoServerError as error:
        log.warning(error)
        return False
799035
def _should_get_another_batch(self, content):
    
    if ('max-keys' in self._options and
        self._options['max-keys'] <= common._MAX_GET_BUCKET_RESULT):
      return False

    elements = self._find_elements(
        content, set([common._T_IS_TRUNCATED,
                      common._T_NEXT_MARKER]))
    if elements.get(common._T_IS_TRUNCATED, 'false').lower() != 'true':
      return False

    next_marker = elements.get(common._T_NEXT_MARKER)
    if next_marker is None:
      self._options.pop('marker', None)
      return False
    self._options['marker'] = next_marker
    return True
1214002
def exists(self, bbox_or_slices):
    
    if type(bbox_or_slices) is Bbox:
      requested_bbox = bbox_or_slices
    else:
      (requested_bbox, _, _) = self.__interpret_slices(bbox_or_slices)
    realized_bbox = self.__realized_bbox(requested_bbox)
    cloudpaths = txrx.chunknames(realized_bbox, self.bounds, self.key, self.underlying)
    cloudpaths = list(cloudpaths)

    with Storage(self.layer_cloudpath, progress=self.progress) as storage:
      existence_report = storage.files_exist(cloudpaths)
    return existence_report
808528
public function doesObjectExist($bucket, $key, array $params = [])
    {
        return $this->instance->doesObjectExist($bucket, $key, $params);
    }
186930
def exists(self, filename):
        """"""
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(filename)
        r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/")
        if r.get("Contents") or r.get("CommonPrefixes"):
            return True
        return False
781313
def _bucket_exists(self):
        """"""
        try:
            self.s3client.get_bucket_location(Bucket=self.bucket)
            return True
        except ClientError as error:
            LOG.error(error)
            return False
521495
def bucket_exists?(bucket_name)
      begin
        s3 = AWS::S3.new
        s3.buckets[bucket_name].exists?

      rescue AWS::S3::Errors::SignatureDoesNotMatch => e
        raise AWSCredentialsInvalidError, 'AWS access credentials are invalid'
      rescue AWS::Errors::Base => s3e
        raise S3AccessError.new(s3e.http_response), s3e.message
      end
    end