Lists buckets, by name.
519449
def list():
    """"""
    s3 = boto3.resource('s3')
    return [b.name for b in s3.buckets.all()]
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;
  }
83887
function bucketExists(aws, bucketName) {
  return aws.request('S3', 'listBuckets', {}).then(resp => {
    let exists = false;
    resp.Buckets.forEach(bucket => {
      if (bucket.Name === bucketName) {
        exists = true;
      }
    });
    return exists;
  });
}
816597
private ArrayList<String> getBuckets() {
        String bucketList = getString(KEY_BUCKETS);
        if (bucketList.equals(NO_STRING_VALUE)) {
            return new ArrayList<>();
        } else {
            return deserializeString(bucketList);
        }
    }
903884
def _gcs_list_buckets(project, pattern):
  
  data = [{'Bucket': 'gs://' + bucket.name, 'Created': bucket.metadata.created_on}
          for bucket in google.datalab.storage.Buckets(_make_context(project))
          if fnmatch.fnmatch(bucket.name, pattern)]
  return google.datalab.utils.commands.render_dictionary(data, ['Bucket', 'Created'])
938353
def _list_object_parts(self, bucket_name, object_name, upload_id):
        
        is_valid_bucket_name(bucket_name)
        is_non_empty_string(object_name)
        is_non_empty_string(upload_id)

        query = {
            'uploadId': upload_id,
            'max-parts': '1000'
        }

        is_truncated = True
        part_number_marker = ''
        while is_truncated:
            if part_number_marker:
                query['part-number-marker'] = str(part_number_marker)

            response = self._url_open('GET',
                                      bucket_name=bucket_name,
                                      object_name=object_name,
                                      query=query)

            parts, is_truncated, part_number_marker = parse_list_parts(
                response.data,
                bucket_name=bucket_name,
                object_name=object_name,
                upload_id=upload_id
            )
            for part in parts:
                yield part
1160858
def _storage_get_key_names(bucket, pattern):
  
  return [item.metadata.name for item in _storage_get_keys(bucket, pattern)]
385205
def get_buckets(min_length, max_length, bucket_count):
    '''
    
    '''
    if bucket_count <= 0:
        return [max_length]
    unit_length = int((max_length - min_length) // (bucket_count))
    buckets = [min_length + unit_length *
               (i + 1) for i in range(0, bucket_count)]
    buckets[-1] = max_length
    return buckets
1042861
def listdir(self, dirname):
        """"""
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(dirname)
        p = client.get_paginator("list_objects")
        if not path.endswith("/"):
            path += "/"  # This will now only retrieve subdir content
        keys = []
        for r in p.paginate(Bucket=bucket, Prefix=path, Delimiter="/"):
            keys.extend(o["Prefix"][len(path):-1] for o in r.get("CommonPrefixes", []))
            for o in r.get("Contents", []):
                key = o["Key"][len(path):]
                if key:  # Skip the base dir, which would add an empty string
                    keys.append(key)
        return keys
1194294
def file_list(load):
    '''
    
    '''
    if 'env' in load:
        # "env" is not supported; Use "saltenv".
        load.pop('env')

    ret = []

    if 'saltenv' not in load:
        return ret

    saltenv = load['saltenv']
    metadata = _init()

    if not metadata or saltenv not in metadata:
        return ret
    for bucket in _find_files(metadata[saltenv]):
        for buckets in six.itervalues(bucket):
            files = [f for f in buckets if not fs.is_file_ignored(__opts__, f)]
            ret += _trim_env_off_path(files, saltenv)

    return ret
1315533
def tags(self):
        ""
        for bucket in self:
            for k,v in self[bucket].items():
                yield k,v
971648
def bucket_sort(arr):
    ''' 
    '''
    # The number of buckets and make buckets
    num_buckets = len(arr)
    buckets = [[] for bucket in range(num_buckets)]
    # Assign values into bucket_sort
    for value in arr:
        index = value * num_buckets // (max(arr) + 1)
        buckets[index].append(value)
    # Sort
    sorted_list = []
    for i in range(num_buckets):
        sorted_list.extend(next_sort(buckets[i]))
    return sorted_list
925830
function (prefix, s3, callback) {
        if (!s3.client || !s3.bucket) {
            grunt.warn("Error: No client or bucket name defined.");
        }
        // List all of the objects in the bucket starting with prefix.
        var options = {BucketName : s3.bucket, Prefix: prefix || ''};
        s3.client.ListObjects(options, function(err, data) {
            if (err) {
                var message = (err.Body && err.Body.Error && err.Body.Error.Message) || 'Unknown';
                return callback({message: "Could not fetch bucket objects. " + message});
            }
            var bucketContents = data.Body.ListBucketResult.Contents;

            callback(null, bucketContents);
        });
    }
835410
@Override
  public List<GoogleCloudStorageItemInfo> listObjectInfo(
      String bucketName, String objectNamePrefix, String delimiter) throws IOException {
    return listObjectInfo(bucketName, objectNamePrefix, delimiter, MAX_RESULTS_UNLIMITED);
  }
280949
def get_bucket_inventory(client, bucket, inventory_id):
    """"""
    inventories = client.list_bucket_inventory_configurations(
        Bucket=bucket).get('InventoryConfigurationList', [])
    inventories = {i['Id']: i for i in inventories}
    found = fnmatch.filter(inventories, inventory_id)
    if not found:
        return None

    i = inventories[found.pop()]
    s3_info = i['Destination']['S3BucketDestination']
    return {'bucket': s3_info['Bucket'].rsplit(':')[-1],
            'prefix': "%s/%s/%s" % (s3_info['Prefix'], bucket, i['Id'])}
782730
def list_users(self):
    
        '''  '''
        
    # construct url
        url = self.bucket_url + '/_user/'

    # send request and unwrap response
        response = requests.get(url)
        response = response.json()

        return response
980030
def list_v2(
            self,
            bucket: str,
            prefix: str=None,
            delimiter: str=None,
            start_after_key: str=None,
            token: str=None,
            k_page_max: int=None,
    ) -> typing.Iterable[typing.Tuple[str, dict]]:
        
        raise NotImplementedError()