def switch_host_s3_accelerate(request, operation_name, **kwargs):
 parts = urlsplit(request.url).netloc.split('.')
 parts = [p for p in parts if (p in S3_ACCELERATE_WHITELIST)]
 endpoint = 'https://s3-accelerate.'
 if (len(parts) > 0):
  endpoint += ('.'.join(parts) + '.')
 endpoint += 'amazonaws.com'
 if (operation_name in ['ListBuckets', 'CreateBucket', 'DeleteBucket']):
  return
 _switch_hosts(request, endpoint, use_new_scheme=False)

def switch_host_s3_accelerate ( request , operation_name , ** kwargs ) : parts = urlsplit ( request . url ) . netloc . split ( '.' ) parts = [ p for p in parts if ( p in S3_ACCELERATE_WHITELIST ) ] endpoint = 'https://s3-accelerate.' if ( len ( parts ) > 0 ) : endpoint += ( '.' . join ( parts ) + '.' ) endpoint += 'amazonaws.com' if ( operation_name in [ 'ListBuckets' , 'CreateBucket' , 'DeleteBucket' ] ) : return _switch_hosts ( request , endpoint , use_new_scheme = False )
switches the current s3 endpoint with an s3 accelerate endpoint .