def parse_url_overrides(kw):
 anchor = ''
 qs = ''
 app_url = None
 host = None
 scheme = None
 port = None
 if ('_query' in kw):
  query = kw.pop('_query')
  if isinstance(query, string_types):
   qs = ('?' + url_quote(query, QUERY_SAFE))
  elif query:
   qs = ('?' + urlencode(query, doseq=True))
 if ('_anchor' in kw):
  anchor = kw.pop('_anchor')
  anchor = url_quote(anchor, ANCHOR_SAFE)
  anchor = ('#' + anchor)
 if ('_app_url' in kw):
  app_url = kw.pop('_app_url')
 if ('_host' in kw):
  host = kw.pop('_host')
 if ('_scheme' in kw):
  scheme = kw.pop('_scheme')
 if ('_port' in kw):
  port = kw.pop('_port')
 return (app_url, scheme, host, port, qs, anchor)

def parse_url_overrides ( kw ) : anchor = '' qs = '' app_url = None host = None scheme = None port = None if ( '_query' in kw ) : query = kw . pop ( '_query' ) if isinstance ( query , string_types ) : qs = ( '?' + url_quote ( query , QUERY_SAFE ) ) elif query : qs = ( '?' + urlencode ( query , doseq = True ) ) if ( '_anchor' in kw ) : anchor = kw . pop ( '_anchor' ) anchor = url_quote ( anchor , ANCHOR_SAFE ) anchor = ( '#' + anchor ) if ( '_app_url' in kw ) : app_url = kw . pop ( '_app_url' ) if ( '_host' in kw ) : host = kw . pop ( '_host' ) if ( '_scheme' in kw ) : scheme = kw . pop ( '_scheme' ) if ( '_port' in kw ) : port = kw . pop ( '_port' ) return ( app_url , scheme , host , port , qs , anchor )
parse special arguments passed when generating urls .