:param params:
        :param handler: defaults to self.search_handler (fallback to 'select')
        :return:
344266
def _select(self, params, handler=None):
        
        # specify json encoding of results
        params['wt'] = 'json'
        custom_handler = handler or self.search_handler
        handler = 'select'
        if custom_handler:
            if self.use_qt_param:
                params['qt'] = custom_handler
            else:
                handler = custom_handler

        params_encoded = safe_urlencode(params, True)

        if len(params_encoded) < 1024:
            # Typical case.
            path = '%s/?%s' % (handler, params_encoded)
            return self._send_request('get', path)
        else:
            # Handles very long queries by submitting as a POST.
            path = '%s/' % handler
            headers = {
                'Content-type': 'application/x-www-form-urlencoded; charset=utf-8',
            }
            return self._send_request('post', path, body=params_encoded, headers=headers)
949843
def register(self, handler, filters=None, index=None):
        from .filters import get_filters_spec
        
        spec, handler = _get_spec(handler)

        if filters and not isinstance(filters, (list, tuple, set)):
            filters = [filters]
        filters = get_filters_spec(self.dispatcher, filters)

        record = Handler.HandlerObj(handler=handler, spec=spec, filters=filters)
        if index is None:
            self.handlers.append(record)
        else:
            self.handlers.insert(index, record)
69970
def trigger(self, *args, **kwargs):
		
		current = self.name.split('/')
		while current:
			name = '/'.join(current)
			current.pop()
			if name in self.context.handlers:
				self.all_handlers += [(name, h) for h in self.context.handlers[name]] 
				if name == self.name:
					self.handlers += self.context.handlers[name]

		for name, handler in self.all_handlers:
			res = handler(self, *args, **kwargs)
			self.all_executed += 1
			self.all_result.append(res)
			if name == self.name:
				self.executed += 1
				self.result.append(res)
			if self.stopped:
				break

		self.all_handlers = [h for name, h in self.all_handlers]
1333895
def get_request_from_view_args(
        self, view: typing.Callable, args: typing.Iterable, kwargs: typing.Mapping
    ) -> Request:
        
        req = None
        for arg in args:
            if isinstance(arg, web.Request):
                req = arg
                break
            elif isinstance(arg, web.View):
                req = arg.request
                break
        assert isinstance(req, web.Request), "Request argument not found for handler"
        return req
1110471
def get_query_params
      out = {}
      search_attributes.each do |val|
        out[val.field]=self.send(val.field) unless self.send(val.field).blank?
      end

      out
    end
793708
def get_request_from_view_args(self, view, args, kwargs):
        
        if len(args) > 1 and isinstance(args[1], sanic.request.Request):
            req = args[1]
        else:
            req = args[0]
        assert isinstance(
            req, sanic.request.Request
        ), "Request argument not found for handler"
        return req
797109
def lookup(self, request: Request) -> List[Callable[[], Handler]]:
        
        key = request.__class__.__name__
        if key not in self._registry:
            if request.is_command():
                raise ConfigurationException("There is no handler registered for this request")
            elif request.is_event():
                return []  # type: Callable[[] Handler]

        return self._registry[key]
388696
function(handler) {
  var argLength = handler.length;
  var lastArgName = lastArgumentName(handler);

  // handler(req, res)
  // handler(req, res, next)
  // handler(err, req, res, next)
  if (lastArgName === "next" || argLength === 2) return handler;

  if (argLength > 4) {
    // handler(err, req, res, next, _)
    return function(err, req, res, next) {
      handler(err, req, res, next, function(e) {
        if (e) {
          if (err) e.innerError = err;
          return next(e);
        }
      });
    };
  } else if (argLength > 3) {
    // handler(req, res, next, _)
    return function(req, res, next) {
      handler(req, res, next, function(err) {
        if (err) return next(err);
      });
    };
  } else if (argLength > 2) {
    // handler(req, res, _)
    return function(req, res, next) {
      handler(req, res, function(err) {
        if (err) return next(err);
      });
    };
  }
}
390662
function(method, args, options) {
            var that = this, methodHandler;

            options = options || {};

            var handler = this.getHandler(method);
            if (!handler) return Q.reject(new Error("No handler found for method: "+method));

            // Is offline
            if (!Offline.isConnected()) {
                methodHandler = handler.fallback;
            }
            methodHandler = methodHandler || handler.execute || this.defaultHandler.execute;

            // No default
            if (!methodHandler) {
                return Q.reject(new Error("No handler found for this method in this backend"));
            }

            return Q(methodHandler(args, options, method)).then(function(results) {
                if (handler.after) {
                    return Q.all([
                        Q(handler.after(args, results, options, method)),
                        Q((that.defaultHandler.after || function() {})(args, results, options, method))
                    ]).then(function() {
                        return Q(results);
                    }, function() {
                        return Q(results);
                    });
                }
                return results;
            });
        }
42852
def add_search_to_params(search)
      if !search.empty?
        pars = search[1..-1].split('&')

        pars.each do |par|
          pair = par.split('=')
          @params[ pair[0] ] = pair[1] if pair.length == 2
        end
      end
    end
767824
def remove_handler(self, handler):
        
        while handler in self.handlers:
            self.handlers.remove(handler)
105538
def handler(self):
		''
		from feedjack import filters # shouldn't be imported globally, as they may depend on models
		proc_func = getattr(filters, self.handler_name or self.name, None)
		if proc_func is None:
			if '.' not in self.handler_name:
				raise ImportError('Processing function not available: {0}'.format(self.handler_name))
			proc_module, proc_func = it.imap(str, self.handler_name.rsplit('.', 1))
			proc_func = getattr(__import__(proc_module, fromlist=[proc_func]), proc_func)
		return proc_func
36220
function (params) {
        this.query = params.q !== undefined ? String(params.q) : defaultParams.query;
        this.page = params.p !== undefined ? parseInt(params.p, 10) : defaultParams.page;
        switch (params.s) {
          case 'name':
          case 'owner':
          case 'stars':
          case 'updated':
            this.sorting = params.s;
            break;
          default:
            this.sorting = defaultParams.sorting;
        }
        switch (params.o) {
          case 'asc':
          case 'desc':
            this.order = params.o;
            break;
          default:
            this.order = defaultParams.order;
        }
      }
789305
def default_match_error_handler(exc):
    
    if isinstance(exc, NotFound):
        return http.NotFound()
    elif isinstance(exc, MethodNotAllowed):
        return http.MethodNotAllowed()
    elif isinstance(exc, RequestRedirect):
        return redirect(exc.new_url)
    else:
        raise exc
513661
function (query, params, stringifier) {
    if (!query || !query.length || !params) {
      return query;
    }
    if (!stringifier) {
      stringifier = function (a) {return a.toString()};
    }
    var parts = [];
    var isLiteral = false;
    var lastIndex = 0;
    var paramsCounter = 0;
    for (var i = 0; i < query.length; i++) {
      var char = query.charAt(i);
      if (char === "'" && query.charAt(i-1) !== '\\') {
        //opening or closing quotes in a literal value of the query
        isLiteral = !isLiteral;
      }
      if (!isLiteral && char === '?') {
        //is a placeholder
        parts.push(query.substring(lastIndex, i));
        parts.push(stringifier(params[paramsCounter++]));
        lastIndex = i+1;
      }
    }
    parts.push(query.substring(lastIndex));
    return parts.join('');
  }
150758
function replace_handler(rule, values) {
  return function (_, n, name) {
    return name ? values[rule.map[name].index + 1] : values[n];
  };
}
773245
function searchBar_openEngineManager(handler)
  {
    this.enginesDropDownOpen = true;
    var engineManager = this.getElement({type: "engine_manager"});

    // Setup the modal dialog handler
    md = new modalDialog.modalDialog(this._controller.window);
    md.start(handler);

    // XXX: Bug 555347 - Process any outstanding events before clicking the entry
    this._controller.sleep(0);
    this._controller.click(engineManager);
    md.waitForDialog();

    this._controller.assert(function () {
      return this.enginesDropDownOpen == false;
    }, "The search engine drop down menu has been closed", this);
  }