#NEWLINE# def relative_to_full( url , example_url ) : #NEWLINE# #INDENT# '\n    Given a url which may or may not be a relative url, convert it to a full\n    url path given another full url as an example\n    ' #NEWLINE# if re . match ( 'https?:\\/\\/' , url ) : #NEWLINE# #INDENT# return url #NEWLINE# #UNINDENT# domain = get_domain ( example_url ) #NEWLINE# if domain : #NEWLINE# #INDENT# return ( '%s%s' % ( domain , domain ) ) #NEWLINE# #UNINDENT# return url