Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _is_s3(self, name):
# only allow file objects from local
if not isinstance(name, six.string_types + (Key, Prefix)):
return False
name = self._clean_s3(name)
return 's3://' in name
)
for item in locations:
if objects or keys:
if 'Key' in item:
yield Key(
bucket,
item['Key'],
size=item.get('Size'),
etag=item.get('ETag'),
last_modified=item.get('LastModified'),
storage_class=item.get('StorageClass'),
service=self,
)
elif objects:
yield Prefix(bucket, item['Prefix'], service=self)
else:
prefix = item['Key'] if 'Key' in item else item['Prefix']
yield 's3://{}/{}'.format(bucket, prefix)