def parse_s3_uri(uri):
 components = urlparse(uri)
 if ((components.scheme not in ('s3', 's3n')) or ('/' not in components.path)):
  raise ValueError(('Invalid S3 URI: %s' % uri))
 return (components.netloc, components.path[1:])

def parse_s3_uri ( uri ) : components = urlparse ( uri ) if ( ( components . scheme not in ( 's3' , 's3n' ) ) or ( '/' not in components . path ) ) : raise ValueError ( ( 'Invalid S3 URI: %s' % uri ) ) return ( components . netloc , components . path [ 1 : ] )
parse an s3 uri into .