Override dispatch to call appropriate methods:
        * $query - ng_query
        * $get - ng_get
        * $save - ng_save
        * $delete and $remove - ng_delete
327324
def dispatch(self, request, *args, **kwargs):
        
        allowed_methods = self.get_allowed_methods()
        try:
            if request.method == 'GET' and 'GET' in allowed_methods:
                if 'pk' in request.GET or self.slug_field in request.GET:
                    return self.ng_get(request, *args, **kwargs)
                return self.ng_query(request, *args, **kwargs)
            elif request.method == 'POST' and 'POST' in allowed_methods:
                return self.ng_save(request, *args, **kwargs)
            elif request.method == 'DELETE' and 'DELETE' in allowed_methods:
                return self.ng_delete(request, *args, **kwargs)
        except self.model.DoesNotExist as e:
            return self.error_json_response(e.args[0], 404)
        except NgMissingParameterError as e:
            return self.error_json_response(e.args[0])
        except JSONResponseException as e:
            return self.error_json_response(e.args[0], e.status_code)
        except ValidationError as e:
            if hasattr(e, 'error_dict'):
                return self.error_json_response('Form not valid', detail=e.message_dict)
            else:
                return self.error_json_response(e.message)

        return self.error_json_response('This view can not handle method {0}'.format(request.method), 405)
381614
function proxyMethods(exec, query) {
    const methods = [].concat(END_POINT_METHODS).concat(CHAINABLE_METHODS);
    for (let name of methods) {
        const oldMethod = query[name];
        query[name] = function (...args) {
            const clonedQuery = query.clone();
            proxyMethods(exec, clonedQuery);
            oldMethod.apply(clonedQuery, args);
            if (CHAINABLE_METHODS.indexOf(name) > -1) {
                return clonedQuery;
            } else {
                return exec(clonedQuery.toString());
            }
        }
    }
}
891400
public function dispatch()
    {
        if (php_sapi_name() === 'cli' || defined('STDIN')) {

            global $argv;

            App::make('Cli', [array_slice($argv, 1), $this]);

            $this->terminate();
        }

        $this->execute()->respond()->terminate();
    }
985810
def method_missing(slug, *args)
      return super unless (klass = filter(slug))

      options = args.last.is_a?(Hash) ? args.pop : {}

      yield(klass, args, options) if block_given?

      self
    end
507898
def dispatch(self, request, *args, **kwargs):
        
        ajax_kwargs = {'mandatory': self.ajax_mandatory}
        if self.json_encoder:
            ajax_kwargs['cls'] = self.json_encoder

        return ajax(**ajax_kwargs)(super(
            AJAXMixin, self).dispatch)(request, *args, **kwargs)
1102874
def dispatch(self):
        """"""
        method_name = 'on_' + self.environ['REQUEST_METHOD'].lower()
        method = getattr(self, method_name, None)
        if method:
            return method()
        else:
            return self.on_bad_method()
1067609
function handleQuery () {
    var searchText = $scope.searchText || '';
    var term = searchText.toLowerCase();

    // If caching is enabled and the current searchText is stored in the cache
    if (!$scope.noCache && cache[term]) {
      // The results should be handled as same as a normal un-cached request does.
      handleResults(cache[term]);
    } else {
      fetchResults(searchText);
    }

    ctrl.hidden = shouldHide();
  }
1219300
public function dispatch($method)
	{
		// Save original input.
		$original_input = Request::input();
		
		// Create request.
		$request = Request::create($this->uri, $method, $this->params);
		
		// Replace input (maintain api auth parameters).
		Request::replace(array_merge($request->input(), array(
			'client_id'     => Request::input('client_id'),
			'client_secret' => Request::input('client_secret'),
			'access_token'  => Request::input('access_token'),
		)));
		
		// Dispatch request.
		$response = Route::dispatch($request);
		
		// Restore original input.
		Request::replace($original_input);
		
		$content = $response->getContent();
		return empty($content) ? null : json_decode($response->getContent(), true);
	}
455839
function dispatch(req, done) {
      var site = req.site
        , path = upath.join(site.path || '', req.path)
        , parent = site.parent;
      while (parent) {
        path = upath.join(parent.path || '', path);
        parent = parent.parent;
      }
      
      console.log('# ' + path);
      
      var page = new Page(path, req.context);
      pages.push(page);
      
      page.once('close', done);
      //page.site = self;
      //page.pages = pages;
      self.handle(page);
    }
1310767
def dispatch_request(self, *args, **kwargs):
        
        self.args = args
        self.kwargs = kwargs
        self.meth = request.method.lower()
        self.resource = current_app.blueprints.get(request.blueprint, None)

        if not any([self.meth in self.methods, self.meth.upper() in self.methods]):
            return self.return_error(405)

        self.process_before_request_hooks()

        resp = super(Endpoint, self).dispatch_request(*args, **kwargs)
        resp = self.make_response(resp)

        resp = self.process_after_request_hooks(resp)

        return resp
748375
protected function resolveQuery() : callable
	{
		return function($query) {
			foreach ($this->features as $key => $feature) {
				$query->orWhere('features->' . $key, urldecode($feature));
			}
		};
	}
1150791
def dispatch(self, request, **kwargs):
        '''
        
        '''

        # Check if this is a webservice request
        self.json_worker = (bool(getattr(self.request, "authtoken", False))) or (self.json is True)
        self.__authtoken = (bool(getattr(self.request, "authtoken", False)))

        # Check if this is an AJAX request
        if (request.is_ajax() or self.json_worker) and request.body:
            request.POST = QueryDict('').copy()
            body = request.body
            if type(request.body) == bytes:
                body = body.decode("utf-8")
            post = json.loads(body)
            for key in post:
                if type(post[key]) == dict and '__JSON_DATA__' in post[key]:
                    post[key] = json.dumps(post[key]['__JSON_DATA__'])

            request.POST.update(post)

        # Set class internal variables
        self._setup(request)

        # Call the base implementation
        return super(GenModify, self).dispatch(request, **kwargs)
464834
public function dispatch() {
        foreach ($this->_listeners as $key => $listeners) {
            foreach ($this->_events as $events) {
                if (isset($listeners->implementedEvents()[$events->getName()])) {
                    foreach ($listeners->implementedEvents()[$events->getName()] as $event) {
                        if ($events->getStatus() == Event::START && method_exists($listeners, $event)) {
                            ob_start();
                            $this->addError('EVENT call the listener "' . $key . '" "' . get_class($listeners) . '::' . $event . '" for the event "' . $events->getName() . '"', __FILE__, __LINE__, ERROR_INFORMATION);
                            $events->setResult($listeners->$event($events), get_class($listeners) . '::' . $event, get_class($listeners), $event);
                            $output = ob_get_contents();
                            ob_get_clean();

                            $this->addError('[' . $key . '] [' . get_class($listeners) . '::' . $event . '] [' . $events->getName() . "]\n[" . $output . ']', 0, 0, 0, LOG_EVENT);
                        }
                    }
                }
            }
        }
    }
1222291
function dispatch(methodName, inDocument, xpath, contextNode, namespaceResolver) {
        xpath = preprocess(xpath);

        if (! contextNode) {
            contextNode = inDocument;
        }

        var result = getEngineFor(inDocument)
            .setIgnoreAttributesWithoutValue(ignoreAttributesWithoutValue)
            [methodName](xpath, contextNode, namespaceResolver);

        return result;
    }
710389
def dispatch_hook(key, hooks, hook_data, **kwargs):
    """"""
    hooks = hooks or {}
    hooks = hooks.get(key)
    if hooks:
        if hasattr(hooks, '__call__'):
            hooks = [hooks]
        for hook in hooks:
            _hook_data = hook(hook_data, **kwargs)
            if _hook_data is not None:
                hook_data = _hook_data
    return hook_data
818911
def delete_by_query!(query, params = nil, request_options = {})
      res = delete_by_query(query, params, request_options)
      wait_task(res['taskID'], WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, request_options) if res
      res
    end
1284512
def dispatch(self, *args, **kwargs):
        """"""
        return super(BreedingDelete, self).dispatch(*args, **kwargs)