Get bucket object.

        Returns:
            oss2.Bucket
195206
def _get_bucket(self, client_kwargs):
        
        return _oss.Bucket(self.client, endpoint=self._endpoint,
                           bucket_name=client_kwargs['bucket_name'])
1025535
def _bucket_key(self):
        
        return "{}.size.{}".format(
            self.prefix, (self._hashed_key//1000)
            if self._hashed_key > 1000 else self._hashed_key)
57610
def get_bucket_file_list(self):
        
        logger.debug("Retrieving bucket object list")

        paginator = self.s3_client.get_paginator('list_objects')
        options = {
            'Bucket': self.aws_bucket_name
        }
        if self.aws_bucket_prefix:
            logger.debug("Adding prefix {} to bucket list as a filter".format(self.aws_bucket_prefix))
            options['Prefix'] = self.aws_bucket_prefix
        page_iterator = paginator.paginate(**options)

        obj_dict = {}
        for page in page_iterator:
            obj_dict.update(get_bucket_page(page))

        return obj_dict
1145816
def get_all_metadata(
            self,
            bucket: str,
            key: str
    ) -> dict:
        
        try:
            return self.s3_client.head_object(
                Bucket=bucket,
                Key=key
            )
        except botocore.exceptions.ClientError as ex:
            if str(ex.response['Error']['Code']) == \
                    str(requests.codes.not_found):
                raise BlobNotFoundError(f"Could not find s3://{bucket}/{key}") from ex
            raise BlobStoreUnknownError(ex)
108197
def get_instance_signature(instance):
    
    with suppress(AttributeError):
        return instance._getsate_bucketcache_()

    with suppress(AttributeError):
        return instance.__getstate__()

    return instance.__dict__
525841
def get_bucket_location(self, bucket):
        
        details = self._details(
            method=b"GET",
            url_context=self._url_context(bucket=bucket, object_name="?location"),
        )
        d = self._submit(self._query_factory(details))
        d.addCallback(self._parse_bucket_location)
        return d
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]))
408930
def get_content_type(
            self,
            bucket: str,
            key: str
    ) -> str:
        
        blob_obj = self._get_blob_obj(bucket, key)
        return blob_obj.content_type
982296
def get(self):
        
        super(CloudDatabaseInstance, self).get()
        # Make the volume into an accessible object instead of a dict
        self.volume = CloudDatabaseVolume(self, self.volume)
828633
def get_bucket_list():
    
    args = parser.parse_args()
    for b in s3_conn(args.aws_access_key_id, args.aws_secret_access_key).get_all_buckets():
        print(''.join([i if ord(i) < 128 else ' ' for i in b.name]))
369857
def get(self, name):
        ""
        for bucket in self:
            for k,v in self[bucket].items():
                if k == name:
                    return v
964952
def get_object(self):
        
        queryset = None
        slug = self.kwargs.get(self.slug_url_kwarg, None)

        if slug is not None:
            queryset = self.get_queryset()
            slug_field = self.slug_field
            queryset = queryset.filter(**{slug_field: slug})
            try:
                self.object = queryset.get()
            except ObjectDoesNotExist:
                raise http.Http404
        return self.object
132070
def get_bucket(self, name):
        ""
        for bucket in self:
            for k,v in self[bucket].items():
                if k == name:
                    return bucket
356279
def get_bucket_for(self, node):
        
        for index, bucket in enumerate(self.buckets):
            if node.long_id < bucket.range[1]:
                return index
        # we should never be here, but make linter happy
        return None
274664
def get_bucket_props(self, bucket):
        
        bucket_type = self._get_bucket_type(bucket.bucket_type)
        url = self.bucket_properties_path(bucket.name,
                                          bucket_type=bucket_type)
        status, headers, body = self._request('GET', url)

        if status == 200:
            props = json.loads(bytes_to_str(body))
            return props['props']
        else:
            raise RiakError('Error getting bucket properties.')
818153
def download_object(self, instance, bucket_name, object_name):
        
        url = '/buckets/{}/{}/{}'.format(instance, bucket_name, object_name)
        response = self._client.get_proto(path=url)
        return response.content
1313715
def get_bucket_policy(self, bucket_name):
        
        is_valid_bucket_name(bucket_name)

        response = self._url_open("GET",
                                  bucket_name=bucket_name,
                                  query={"policy": ""})
        return response.data