def preserve_builtin_query_params(url, request=None):
 if (request is None):
  return url
 overrides = [api_settings.URL_FORMAT_OVERRIDE]
 for param in overrides:
  if (param and (param in request.GET)):
   value = request.GET[param]
   url = replace_query_param(url, param, value)
 return url

def preserve_builtin_query_params ( url , request = None ) : if ( request is None ) : return url overrides = [ api_settings . URL_FORMAT_OVERRIDE ] for param in overrides : if ( param and ( param in request . GET ) ) : value = request . GET [ param ] url = replace_query_param ( url , param , value ) return url
given an incoming request .