def keep_query(*keep_params, **additional_params):
 if ((not keep_params) and (not additional_params)):
  keep_params = ('*',)
 params = additional_params.copy()
 qs_keys = request.httprequest.args.keys()
 for keep_param in keep_params:
  for param in fnmatch.filter(qs_keys, keep_param):
   if ((param not in additional_params) and (param in qs_keys)):
    params[param] = request.httprequest.args.getlist(param)
 return werkzeug.urls.url_encode(params)

def keep_query ( * keep_params , ** additional_params ) : if ( ( not keep_params ) and ( not additional_params ) ) : keep_params = ( '*' , ) params = additional_params . copy ( ) qs_keys = request . httprequest . args . keys ( ) for keep_param in keep_params : for param in fnmatch . filter ( qs_keys , keep_param ) : if ( ( param not in additional_params ) and ( param in qs_keys ) ) : params [ param ] = request . httprequest . args . getlist ( param ) return werkzeug . urls . url_encode ( params )
generate a query string keeping the current request querystrings parameters specified in keep_params and also adds the parameters specified in additional_params .