Wait for a method that matches our allowed_methods parameter (the
        default value of None means match any method), and dispatch to it.
498125
def wait(self, allowed_methods=None):
        """"""
        method_sig, args, content = self.connection._wait_method(
            self.channel_id, allowed_methods)

        return self.dispatch_method(method_sig, args, content)
819553
def allowed(self, method, _dict, allow):
        
        for key in _dict.keys():
            if key not in allow:
                raise LunrError("'%s' is not an argument for method '%s'"
                                % (key, method))
1179233
def simple_wait(func):
    
    @wraps(func)
    def wrapper(*args, **kwargs):
        wait = Wait()
        wait.start()
        try:
            ret = func(*args, **kwargs)
        finally:
            wait.stop()
        sys.stdout.write('\n')
        return ret
    return wrapper
31387
def handle
      return unless engine?
      return if decorators.empty?

      validate_decorators!
      validate_pattern_matching!

      engine.add_method_decorator(method_type, method_name, decorator)
      mark_pattern_matching_decorators
      method_reference.make_alias(target)
      redefine_method
    end
1043282
def _dispatch(self, method, params):
        """"""
        self._count += 1

        func = getattr(self, method)
        try:
            return func(*params)
        except Exception as e:
            traceback.print_exc()
            raise e
1100467
function (reqContext, name, args) {
    return BPromise.resolve()
        .bind(this)
        .then(function () {
            var method = this._methods[name];
            if (!method) {
                throw new MWError(404, "Method not found");
            }
            var context = R.merge(method.context, reqContext);
            return method.fn.apply(context, args);
        });
}
1352474
def wait(self, timeout=None, raise_error=True):
        
        return self.get(timeout=timeout, raise_error=raise_error)
838957
def wait_for(options={}, &block)
      Wait.new(Cloudpassage::wait_options.merge(options)).until do
        instance_eval &block
      end
    end
860591
def _process_methods(self, req, resp, resource):
        
        requested_method = self._get_requested_method(req)
        if not requested_method:
            return False

        if self._cors_config['allow_all_methods']:
            allowed_methods = self._get_resource_methods(resource)
            self._set_allowed_methods(resp, allowed_methods)
            if requested_method in allowed_methods:
                return True
        elif requested_method in self._cors_config['allow_methods_list']:
            resource_methods = self._get_resource_methods(resource)
            # Only list methods as allowed if they exist
            # on the resource AND are in the allowed_methods_list
            allowed_methods = [
                method for method in resource_methods
                if method in self._cors_config['allow_methods_list']
            ]
            self._set_allowed_methods(resp, allowed_methods)
            if requested_method in allowed_methods:
                return True

        return False
1172004
def first(self, methodname, *args, **kwargs):
        

        for r in self.call(methodname, *args, **kwargs):
            if r is not None:
                return r

        raise ValueError("No plugins returned a non-None value")
865995
def maybe_wait(func):
    
    def wrapper(self, *args, **kwargs):
        if self.slow:
            time.sleep(random.randint(5, 15))
        return func(self, *args, **kwargs)

    return wrapper
762884
def _watch_callback(obj_weakref, method_name, *args, **kwargs):
    
    obj = obj_weakref()
    if obj is None:
        return
    getattr(obj, method_name)(*args, **kwargs)
356925
def (self, method):
        
        def _handler(callback, schema=None):
            """
            _handler
            """
            # reentrant default is False [POST, DELETE, PUT]
            reentrant = False
            if method == "get":
                reentrant = True

            self.handlers.append({
                "method": method,
                "callback": callback,
                "schema": schema,
                "reentrant": reentrant
            })
            return self

        return _handler
287977
def method_missing(method, *args, &block)
      return rpc(method, args.first, args[1]) if function(method)

      super
    end
210572
def dispatch(self, method_frame):
        '''
        
        '''
        method = self.dispatch_map.get(method_frame.method_id)
        if method:
            callback = self.channel.clear_synchronous_cb(method)
            callback(method_frame)
        else:
            raise self.InvalidMethod(
                "no method is registered with id: %d" % method_frame.method_id)
867545
def callToThread(method):
    
    def func_wrapped(self, *args, **kwargs):
      self.thread.execute_queue.put_nowait((threading.get_ident(), method, args, kwargs))
      return self.waitResult()
    return func_wrapped
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()