<s> import posixpath <EOL> try : <EOL> from urllib . parse import urlsplit , urlunsplit <EOL> except ImportError : <EOL> from urlparse import urlsplit , urlunsplit <EOL> def url_join ( base , * args ) : <EOL> """<STR_LIT>""" <EOL> scheme , netloc , path , query , fragment = urlsplit ( base ) <EOL> path = path if len ( path ) else "<STR_LIT:/>" <EOL> path = posixpath . join ( path , * [ ( '<STR_LIT:%s>' % x ) for x in args ] ) <EOL> return urlunsplit ( [ scheme , netloc , path , query , fragment ] ) <EOL> def copy_kwargs ( dictionary ) : <EOL> kwargs = { } <EOL> for key , value in iterator ( dictionary ) : <EOL> kwargs [ key ] = value <EOL> return kwargs <EOL> def iterator ( d ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return d . iteritems ( ) <EOL> except AttributeError : <EOL> return d . items ( ) </s>
