Check the LRU cache to see if the Aspera Key has already been retrieved for
this bucket. If it has, return it, else call onto the s3Client to get the
FASPConnectionInfo for the bucket name

@param bucketName
@return
495160
public FASPConnectionInfo getFaspConnectionInfo(String bucketName) {
		log.trace("AsperaTransferManager.getFaspConnectionInfo >> start " + System.nanoTime());
		FASPConnectionInfo faspConnectionInfo = akCache.get(bucketName);

		if (null == faspConnectionInfo) {

			log.trace("AsperaTransferManager.getFaspConnectionInfo >> retrieve from COS " + System.nanoTime());
			faspConnectionInfo = s3Client.getBucketFaspConnectionInfo(bucketName);
			log.trace("AsperaTransferManager.getFaspConnectionInfo << retrieve from COS " + System.nanoTime());

			if (null == faspConnectionInfo) {
				throw new SdkClientException("Failed to retrieve faspConnectionInfo for bucket: " + bucketName);
			}

			akCache.put(bucketName, faspConnectionInfo);
		}

		log.trace("AsperaTransferManager.getFaspConnectionInfo << end " + System.nanoTime());
		return faspConnectionInfo;
	}
290538
def get_bucket():
    
    args = parser.parse_args()

    bucket = s3_bucket(args.aws_access_key_id, args.aws_secret_access_key, args.bucket_name)
    for b in bucket.list():
        print(''.join([i if ord(i) < 128 else ' ' for i in b.name]))
626691
def get_cache_key(bucket, name, args, kwargs):
    
    u = ''.join(map(str, (bucket, name, args, kwargs)))
    return 'native_tags.%s' % sha_constructor(u).hexdigest()
1272512
private Observable<ProposedBucketConfigContext> refreshAgainstNode(final String bucketName,
        final NetworkAddress hostname) {
        final Credential credential = registrations().get(bucketName);
        if (credential == null) {
            LOGGER.debug("Ignoring refresh attempt since it seems the bucket registration is gone (closed).");
            return Observable.empty();
        }

        return Observable.defer(new Func0<Observable<BucketConfigResponse>>() {
            @Override
            public Observable<BucketConfigResponse> call() {
                return cluster()
                    .<BucketConfigResponse>send(new BucketConfigRequest(HttpLoader.TERSE_PATH, hostname, bucketName,
                        credential.username(), credential.password()))
                    .flatMap(new Func1<BucketConfigResponse, Observable<BucketConfigResponse>>() {
                        @Override
                        public Observable<BucketConfigResponse> call(BucketConfigResponse response) {
                            if (response.status().isSuccess()) {
                                LOGGER.debug("Successfully got config refresh from terse bucket remote.");
                                return Observable.just(response);
                            }

                            LOGGER.debug("Terse bucket config refresh failed, falling back to verbose.");
                            return cluster().send(
                                new BucketConfigRequest(HttpLoader.VERBOSE_PATH, hostname, bucketName,
                                    credential.username(), credential.password()));
                        }
                    });
            }
        }).map(new Func1<BucketConfigResponse, ProposedBucketConfigContext>() {
            @Override
            public ProposedBucketConfigContext call(final BucketConfigResponse response) {
                String config = response.config().replace("$HOST", hostname.address());
                return new ProposedBucketConfigContext(bucketName, config, hostname);
            }
        }).doOnError(new Action1<Throwable>() {
            @Override
            public void call(Throwable ex) {
                LOGGER.debug("Could not fetch config from bucket \"" + bucketName + "\" against \""
                    + hostname + "\".", ex);
            }
        });
    }
1115058
public List<Acl> listBucketAcls(String bucketName) {
    // [START listBucketAcls]
    List<Acl> acls = storage.listAcls(bucketName);
    for (Acl acl : acls) {
      // do something with ACL entry
    }
    // [END listBucketAcls]
    return acls;
  }
394716
protected final Bucket<K, V> getBucketForKey(K key) {
        int bucket_index = (key.hashCode() & 0x7FFFFFFF) % buckets.length;
        Bucket<K, V> thebucket = buckets[bucket_index];
        if (thebucket == null) {
            synchronized (this) {
                thebucket = buckets[bucket_index];
                if (thebucket == null) {
                    thebucket = new Bucket<K, V>();
                    buckets[bucket_index] = thebucket;
                } // if
            } // sync
        } // if
        return thebucket;
    }
1356397
def get(self, key, bucket):
        

        try:
            return self._cache[bucket][key]
        except (KeyError, TypeError):
            return None
1159003
public boolean hasCacheContent(String rfsName) {

        File f = new File(rfsName);
        if (f.exists()) {
            return true;
        }
        return false;
    }
357448
public Bucket enableBucketPolicyOnly(String bucketName) throws StorageException {
    // [START storage_enable_bucket_policy_only]
    // Instantiate a Google Cloud Storage client
    Storage storage = StorageOptions.getDefaultInstance().getService();

    // The name of a bucket, e.g. "my-bucket"
    // String bucketName = "my-bucket";

    BucketInfo.IamConfiguration iamConfiguration =
        BucketInfo.IamConfiguration.newBuilder().setIsBucketPolicyOnlyEnabled(true).build();
    Bucket bucket =
        storage.update(
            BucketInfo.newBuilder(bucketName).setIamConfiguration(iamConfiguration).build());

    System.out.println("Bucket Policy Only was enabled for " + bucketName);
    // [END storage_enable_bucket_policy_only]
    return bucket;
  }
1151822
def get_s3_bucket_keys(api_client, bucket_name, bucket, check_encryption, check_acls):
    
    bucket['keys'] = []
    keys = handle_truncated_response(api_client.list_objects, {'Bucket': bucket_name}, ['Contents'])
    bucket['keys_count'] = len(keys['Contents'])
    key_count = 0
    update_status(key_count, bucket['keys_count'], 'keys')
    for key in keys['Contents']:
        key_count += 1
        key['name'] = key.pop('Key')
        key['LastModified'] = str(key['LastModified'])
        if check_encryption:
            try:
                # The encryption configuration is only accessible via an HTTP header, only returned when requesting one object at a time...
                k = api_client.get_object(Bucket = bucket_name, Key = key['name'])
                key['ServerSideEncryption'] = k['ServerSideEncryption'] if 'ServerSideEncryption' in k else None
                key['SSEKMSKeyId'] = k['SSEKMSKeyId'] if 'SSEKMSKeyId' in k else None
            except Exception as e:
                printException(e)
                continue
        if check_acls:
            try:
                key['grantees'] = get_s3_acls(api_client, bucket_name, bucket, key_name = key['name'])
            except Exception as e:
                continue
        # Save it
        bucket['keys'].append(key)
        update_status(key_count, bucket['keys_count'], 'keys')
885881
def does_s3_object_exist(bucket_name, key, session=None):
    """"""
    if session:
        s3_resource = session.resource('s3')
    else:
        s3_resource = boto3.resource('s3')

    try:
        s3_resource.Object(bucket_name, key).load()
    except ClientError as exc:
        if exc.response['Error']['Code'] == '404':
            return False
        raise
    return True
1160858
def _storage_get_key_names(bucket, pattern):
  
  return [item.metadata.name for item in _storage_get_keys(bucket, pattern)]
697708
def contains(self, name):
    
    try:
      self._api.buckets_get(name)
    except google.datalab.utils.RequestException as e:
      if e.status == 404:
        return False
      raise e
    except Exception as e:
      raise e
    return True
1281722
public File getAsFile(String bucket, String fname) throws IOException {
    Storage.Objects.Get request = storage.objects().get(bucket, fname);
    File file = File.createTempFile("gcsdownload", "obj");
    try (OutputStream out = new FileOutputStream(file)) {
      request.executeMediaAndDownloadTo(out);
    }
    return file;
  }
159162
public static synchronized Cache getCache(final String cacheName) {
        LOGGER.log(Level.INFO, "Constructing cache [name={0}]....", cacheName);

        Cache ret = CACHES.get(cacheName);

        try {
            if (null == ret) {
                Class<Cache> cacheClass;
                switch (Latkes.getRuntimeCache()) {
                    case LOCAL_LRU:
                        cacheClass = (Class<Cache>) Class.forName("org.b3log.latke.cache.caffeine.CaffeineCache");

                        break;
                    case REDIS:
                        cacheClass = (Class<Cache>) Class.forName("org.b3log.latke.cache.redis.RedisCache");

                        break;
                    case NONE:
                        cacheClass = (Class<Cache>) Class.forName("org.b3log.latke.cache.NoneCache");

                        break;
                    default:
                        throw new RuntimeException("Latke runs in the hell.... Please set the environment correctly");
                }

                ret = cacheClass.newInstance();

                ret.setName(cacheName);
                CACHES.put(cacheName, ret);
            }
        } catch (final Exception e) {
            throw new RuntimeException("Can not get cache: " + e.getMessage(), e);
        }

        LOGGER.log(Level.INFO, "Constructed cache [name={0}, runtime={1}]", cacheName, Latkes.getRuntimeCache());

        return ret;
    }
1072087
@Override
    public <K, V> Cache<K, V> getCache(String cacheName) {
        return this.getCache(cacheName, true);
    }
600547
protected StreamingDistributionSummary getExistingDistribution(String bucketName) {

        List<StreamingDistributionSummary> dists =
            getAllExistingDistributions(bucketName);
        if (dists.isEmpty()) {
            return null;
        } else {
            return dists.get(0);
        }
    }