def parse_uri(uri):
 match = S3_PATH_RE.match(uri)
 if (not match):
  raise ValueError(('Invalid S3 URI: %s' % uri))
 key = (match.group(3) or '')
 basename = (match.group(4) or '')
 return (match.group(1), key, basename)

def parse_uri ( uri ) : match = S3_PATH_RE . match ( uri ) if ( not match ) : raise ValueError ( ( 'Invalid S3 URI: %s' % uri ) ) key = ( match . group ( 3 ) or '' ) basename = ( match . group ( 4 ) or '' ) return ( match . group ( 1 ) , key , basename )
returns tuple .