def filter_query_params(url, remove_params):
 if (not url):
  return url
 remove_params = dict((((p, None) if isinstance(p, basestring) else p) for p in remove_params))
 parsed_url = urlparse.urlparse(url)
 parsed_qsl = urlparse.parse_qsl(parsed_url.query, keep_blank_values=True)
 filtered_qsl = [(p, remove_params.get(p, v)) for (p, v) in parsed_qsl]
 filtered_qsl = [(p, v) for (p, v) in filtered_qsl if (v is not None)]
 filtered_url = urlparse.ParseResult(scheme=parsed_url.scheme, netloc=parsed_url.netloc, path=parsed_url.path, params=parsed_url.params, query=urllib.urlencode(filtered_qsl), fragment=parsed_url.fragment)
 return urlparse.urlunparse(filtered_url)

def filter_query_params ( url , remove_params ) : if ( not url ) : return url remove_params = dict ( ( ( ( p , None ) if isinstance ( p , basestring ) else p ) for p in remove_params ) ) parsed_url = urlparse . urlparse ( url ) parsed_qsl = urlparse . parse_qsl ( parsed_url . query , keep_blank_values = True ) filtered_qsl = [ ( p , remove_params . get ( p , v ) ) for ( p , v ) in parsed_qsl ] filtered_qsl = [ ( p , v ) for ( p , v ) in filtered_qsl if ( v is not None ) ] filtered_url = urlparse . ParseResult ( scheme = parsed_url . scheme , netloc = parsed_url . netloc , path = parsed_url . path , params = parsed_url . params , query = urllib . urlencode ( filtered_qsl ) , fragment = parsed_url . fragment ) return urlparse . urlunparse ( filtered_url )
remove all provided parameters from the query section of the url .