Retrieves the creation date for a given key in a given bucket.
        :param bucket: the bucket the object resides in.
        :param key: the key of the object for which the creation date is being retrieved.
        :return: the creation date
500929
def get_creation_date(
            self,
            bucket: str,
            key: str,
    ) -> datetime:
        
        # An S3 object's creation date is stored in its LastModified field which stores the
        # most recent value between the two.
        return self.get_last_modified_date(bucket, key)
1327654
function getKey(key, req) {
  var val = this._data[key];

  // got an expired key, delete it (active expiry)
  if(val && val.e && val.e <= Date.now()) {
    this.emit('expired', key);
    this.delKey(key, req);
    return undefined;
  }

  if(req) this.emit(val ? 'hit' : 'miss', key);

  if(typeof val === 'object') val.t = Date.now();

  return val ? val.v : undefined;
}
935238
def get_bucket_lifecycle(self, bucket):
        
        details = self._details(
            method=b"GET",
            url_context=self._url_context(bucket=bucket, object_name="?lifecycle"),
        )
        d = self._submit(self._query_factory(details))
        d.addCallback(self._parse_lifecycle_config)
        return d
398349
def get(self, bucket: str, key: str) -> bytes:
        
        try:
            response = self.s3_client.get_object(
                Bucket=bucket,
                Key=key
            )
            return response['Body'].read()
        except botocore.exceptions.ClientError as ex:
            if ex.response['Error']['Code'] == "NoSuchKey":
                raise BlobNotFoundError(f"Could not find s3://{bucket}/{key}") from ex
            raise BlobStoreUnknownError(ex)
539801
def valid_date(key, config_date):
    
    key_date = "/".join(key.split("/")[4:7])
    return parse_date(key_date) > parse_date(config_date)
575395
def creation_dates(self, sort=True):
        
        if not sort:
            return pool_creation_date(self.filepaths)
        else:
            pcd = pool_creation_date(self.filepaths)
            pcd.sort(key=itemgetter(1), reverse=True)
            return pcd
320099
def get_default_bucket_key(buckets: List[Tuple[int, int]]) -> Tuple[int, int]:
    
    return max(buckets)
623012
def upload_token(
            self,
            bucket,
            key=None,
            expires=3600,
            policy=None,
            strict_policy=True):
        
        if bucket is None or bucket == '':
            raise ValueError('invalid bucket name')

        scope = bucket
        if key is not None:
            scope = '{0}:{1}'.format(bucket, key)

        args = dict(
            scope=scope,
            deadline=int(time.time()) + expires,
        )

        if policy is not None:
            self.__copy_policy(policy, args, strict_policy)

        return self.__upload_token(args)
449320
def get(self, key) -> str:
        
        # TODO: get is creating files when a key is given which is more than
        # the store size
        chunk_no, offset = self._get_key_location(key)
        with self._openChunk(chunk_no) as chunk:
            return chunk.get(str(offset))
248378
private Bucket getOrCreateBucketForKey(Object key)
    {
        int index = getBucketIndexForKey(key);

        // Double-checked locking.  Safe since buckets do not initialize any state
        // until they are synchronized by the caller.                      d739870
        Bucket bucket = buckets[index];
        if (bucket == null)
        {
            synchronized (bucketLock)
            {
                bucket = buckets[index];
                if (bucket == null)
                {
                    // If this is to be a cache of EJB Wrappers, then create Wrapper
                    // specific buckets, that hold EJSWrapperCommon objects,
                    // otherwise create generic BucketImpl.                   d195605
                    bucket = wrappers ? new WrapperBucket(this) : new BucketImpl();
                    buckets[index] = bucket;
                }
            }
        }

        return bucket;
    }
460335
def bucket_type_key(bucket_type):
    

    def decorator(f):

        @functools.wraps(f)
        def wrapped(item, session):
            key = f(item)

            if session is not None:
                for handler in session.random_order_bucket_type_key_handlers:
                    key = handler(item, key)

            return key

        bucket_type_keys[bucket_type] = wrapped
        return wrapped

    return decorator
170851
def get(self, key):
        
        data = self._store.get(key)
        if not data:
            return None
        value, expire = data
        if expire and time.time() > expire:
            del self._store[key]
            return None
        return value
4721
def set(self, key, val, bucket):
        

        if bucket not in self._cache:
            self._cache[bucket] = {}

        self._cache[bucket][key] = val
890174
def get_preflist(self, bucket, key):
        
        if not self.preflists():
            raise NotImplementedError("fetching preflists is not supported.")
        bucket_type = self._get_bucket_type(bucket.bucket_type)
        url = self.preflist_path(bucket.name, key, bucket_type=bucket_type)
        status, headers, body = self._request('GET', url)

        if status == 200:
            preflist = json.loads(bytes_to_str(body))
            return preflist['preflist']
        else:
            raise RiakError('Error getting bucket/key preflist.')
1171303
async def get_object(self, Bucket: str, Key: str, **kwargs) -> dict:
        
        if self._s3_client is None:
            await self.setup()

        # Ok so if we are doing a range get. We need to align the range start/end with AES block boundaries
        # 9223372036854775806 is 8EiB so I have no issue with hardcoding it.
        # We pass the actual start, desired start and desired end to the decrypt function so that it can
        # generate the correct IV's for starting decryption at that block and then chop off the start and end of the
        # AES block so it matches what the user is expecting.
        _range = kwargs.get('Range')
        actual_range_start = None
        desired_range_start = None
        desired_range_end = None
        if _range:
            range_match = RANGE_REGEX.match(_range)
            if not range_match:
                raise ValueError('Dont understand this range value {0}'.format(_range))

            desired_range_start = int(range_match.group(1))
            desired_range_end = range_match.group(2)
            if desired_range_end is None:
                desired_range_end = 9223372036854775806
            else:
                desired_range_end = int(desired_range_end)

            actual_range_start, actual_range_end = _get_adjusted_crypto_range(desired_range_start, desired_range_end)

            # Update range with actual start_end
            kwargs['Range'] = 'bytes={0}-{1}'.format(actual_range_start, actual_range_end)

        s3_response = await self._s3_client.get_object(Bucket=Bucket, Key=Key, **kwargs)
        file_data = await s3_response['Body'].read()
        metadata = s3_response['Metadata']
        whole_file_length = int(s3_response['ResponseMetadata']['HTTPHeaders']['content-length'])

        if 'x-amz-key' not in metadata and 'x-amz-key-v2' not in metadata:
            # No crypto
            return s3_response

        if 'x-amz-key' in metadata:
            # Crypto V1
            body = await self._decrypt_v1(file_data, metadata, actual_range_start)
        else:
            # Crypto V2
            body = await self._decrypt_v2(file_data, metadata, whole_file_length,
                                          actual_range_start, desired_range_start,
                                          desired_range_end)

        s3_response['Body'] = DummyAIOFile(body)

        return s3_response
489329
def get_as_datetime(self, key):
        
        value = self.get(key)
        return DateTimeConverter.to_datetime(value)
902351
def get_preflist(self, bucket, key):
        
        if not self.preflists():
            raise NotImplementedError("fetching preflists is not supported.")
        msg_code = riak.pb.messages.MSG_CODE_GET_BUCKET_KEY_PREFLIST_REQ
        codec = self._get_codec(msg_code)
        msg = codec.encode_get_preflist(bucket, key)
        resp_code, resp = self._request(msg, codec)
        return [codec.decode_preflist(item) for item in resp.preflist]