def query_params(*es_query_params):
 def _wrapper(func):
  @wraps(func)
  def _wrapped(*args, **kwargs):
   params = {}
   if (u'params' in kwargs):
    params = kwargs.pop(u'params').copy()
   for p in (es_query_params + GLOBAL_PARAMS):
    if (p in kwargs):
     v = kwargs.pop(p)
     if (v is not None):
      params[p] = _escape(v)
   for p in (u'ignore', u'request_timeout'):
    if (p in kwargs):
     params[p] = kwargs.pop(p)
   return func(params=params, *args, **kwargs)
  return _wrapped
 return _wrapper

def query_params ( * es_query_params ) : def _wrapper ( func ) : @ wraps ( func ) def _wrapped ( * args , ** kwargs ) : params = { } if ( u'params' in kwargs ) : params = kwargs . pop ( u'params' ) . copy ( ) for p in ( es_query_params + GLOBAL_PARAMS ) : if ( p in kwargs ) : v = kwargs . pop ( p ) if ( v is not None ) : params [ p ] = _escape ( v ) for p in ( u'ignore' , u'request_timeout' ) : if ( p in kwargs ) : params [ p ] = kwargs . pop ( p ) return func ( params = params , * args , ** kwargs ) return _wrapped return _wrapper
decorator that pops all accepted parameters from methods kwargs and puts them in the params argument .