#NEWLINE# def normalize( base , url ) : #NEWLINE# #INDENT# parsed_url = urlparse ( urljoin ( base , url ) ) #NEWLINE# path = posixpath . normpath ( parsed_url [ 2 ] ) #NEWLINE# return urlunparse ( ( parsed_url . scheme , parsed_url . netloc , path , url . params , parsed_url . query , parsed_url . fragment ) )