#NEWLINE# def to_url( self ) : #NEWLINE# #INDENT# 'Serialize as a URL for a GET request.' #NEWLINE# base_url = urlparse . urlparse ( self . url ) #NEWLINE# query = parse_qs ( base_url . query ) #NEWLINE# for ( k , v ) in self . items ( ) : #NEWLINE# #INDENT# query . setdefault ( k , [ ] ) . append ( v ) #NEWLINE# #UNINDENT# url = ( base_url . scheme , base_url . netloc , base_url . path , base_url . params , urllib . urlencode ( query , True ) , base_url . fragment ) #NEWLINE# return urlparse . urlunparse ( url )