def format_s3_location(user, key, authurl, bucket, obj):
 scheme = 's3'
 if authurl.startswith('https://'):
  scheme = 's3+https'
  authurl = authurl[8:]
 elif authurl.startswith('http://'):
  authurl = authurl[7:]
 authurl = authurl.strip('/')
 return ('%s://%s:%s@%s/%s/%s' % (scheme, user, key, authurl, bucket, obj))

def format_s3_location ( user , key , authurl , bucket , obj ) : scheme = 's3' if authurl . startswith ( 'https://' ) : scheme = 's3+https' authurl = authurl [ 8 : ] elif authurl . startswith ( 'http://' ) : authurl = authurl [ 7 : ] authurl = authurl . strip ( '/' ) return ( '%s://%s:%s@%s/%s/%s' % ( scheme , user , key , authurl , bucket , obj ) )
helper method that returns a s3 store uri given the component pieces .