Execute ``method`` in the related node on browser.

        Other keyword arguments are passed to ``params`` attribute.
        If this node is not in any document tree (namely, this node does not
        have parent node), the ``method`` is not executed.
502999
def js_exec(self, method: str, *args: Union[int, str, bool]) -> None:
        
        if self.connected:
            self.ws_send(dict(method=method, params=args))
1036945
private void handleChildMethod(ExecutableElement methodElement) {
    String methodIdentifier = stitchMethodIdentifier(methodElement);
    MethodReferenceNode node = (MethodReferenceNode) elementReferenceMap.get(methodIdentifier);
    if (node == null) {
      node = new MethodReferenceNode(methodElement);
    }
    node.invoked = true;
    elementReferenceMap.put(methodIdentifier, node);
    addToOverrideMap(methodElement);
  }
1287215
function isCallToMethod(node, version, method) {
    return methodDataUtil.isAliasOfMethod(version, method, astUtil.getMethodName(node))
}
1348754
function (method, view, locals/*, cb*/) {
    if (view.options.handled.indexOf(method) === -1) {
      this.handle.apply(this, arguments);
    }
    this.emit(method, view, locals);
  }
782712
def prepare_request(node):
    
    if node.resource.method not in AVAILABLE_METHODS:
        raise UnsupportedHTTPMethodError(node.resource.method)

    def request(data=None, json=None, **kwargs):
        """
            Make request to node's API route with the given keyword arguments
        """
        # validate given query parameters
        for key, value in kwargs.items():
            param = next((p for p in node.resource.query_params if p.name == key), None)
            if not param:
                raise UnsupportedQueryParameter(node.resource.path, key)

            if not match_type(value, param.type):
                raise TypeError(
                    "Resource Query Parameter has type '{0}' but expected type '{1}'".format(
                        value.__class__.__name__, param.type))

        response = requests.request(node.resource.method, node.resource.absolute_uri, params=kwargs,
                                    data=data, json=json)
        return response
    return request
473557
def method_missing(m, *args)
      # the method href would have been defined while initializing the object
      client.send(:do_post, [ href, m.to_s ].join('/'), *args)
    end
530776
def method_missing(method, *args, &block)
      if method[-1] == '='
        # setter
        key = method.slice(0...-1).to_sym

        unless has_key?(key)
          super
        end
        self[key] = args[0]
      else
        unless has_key?(method)
          super
        end

        prop = self[method]
        if prop.is_a? JSFunction
          prop.call_with_instance(self, *args, &block)
        else
          prop
        end
      end
    end
545619
def method_missing(meth, *args, &blk)
      assert_exists

      meth = selector_to_attribute(meth)

      if self.class::ATTRIBUTES.include?(meth) || (self.class == Element && @object.hasAttribute(meth.to_s))
        return @object.getAttribute(meth.to_s)
      end
      Log.warn "Element\#method_missing calling super with #{meth.inspect}"
      super
    end
1085386
private void invoke(Method method, Object instance, Object[] params) throws SlickXMLException {
		try {
			method.setAccessible(true);
			method.invoke(instance, params);
		} catch (IllegalArgumentException e) {
			throw new SlickXMLException("Failed to invoke: "+method+" for an XML attribute, is it valid?", e);
		} catch (IllegalAccessException e) {
			throw new SlickXMLException("Failed to invoke: "+method+" for an XML attribute, is it valid?", e);
		} catch (InvocationTargetException e) {
			throw new SlickXMLException("Failed to invoke: "+method+" for an XML attribute, is it valid?", e);
		} finally {
			method.setAccessible(false);
		}
	}
1134312
def def_node(node, indent)
      # Set a namespace for the current node definition and make it a valid ruby
      # method name
      key = "_opulent_definition_#{node[@value].to_s.tr '-', '_'}"


      # If we have attributes set for our defined node, we will need to create
      # an extension parameter which will be o
      if node[@options][:attributes].empty?
        # Call method without any extension
        method_call = "#{key}"

        # Call arguments set to true, in correct order
        arguments = []
        @definitions[node[@value]][@options][:parameters].keys.each do |k|
          arguments << @definitions[
            node[@value]
          ][@options][:parameters][k][@value]
        end
        arguments << '{}'

        if @in_definition
          arguments << "(indent ? indent + #{indent} : #{indent})"
        else
          arguments << indent
        end
        method_call += '(' + arguments.join(', ') + ')'
        method_call += ' do' unless node[@children].empty?

        buffer_eval method_call
      else
        arguments = []

        # Extract node definition arguments in the correct order. If the given
        # key does not exist, set the value to default or true
        @definitions[
          node[@value]
        ][@options][:parameters].keys.each do |k|
          if node[@options][:attributes].key? k
            arguments << node[@options][:attributes].delete(k)[@value]
          else
            arguments << @definitions[
              node[@value]
            ][@options][:parameters][k][@value]
          end
        end

        call_attributes = buffer_attributes_to_hash(
          node[@options][:attributes]
        )

        # If the call node is extended as well, merge the call attributes hash
        # with the extension hash
        if node[@options][:extension]
          # .merge!(var_name)
          call_attributes += '.merge!(' \
                             "#{node[@options][:extension][@value]}" \
                             ')'

          # { |key, value1, value2|
          call_attributes += " { |#{OPULENT_KEY}, " \
                             "#{OPULENT_VALUE}1, #{OPULENT_VALUE}2|"

          # class ? value1 + value2 : value2
          call_attributes += "#{OPULENT_KEY} == :class ? (" \
                             "#{OPULENT_VALUE}1 += " \
                             "#{OPULENT_VALUE}2) : (#{OPULENT_VALUE}2" \
                             ')'

          # }
          call_attributes += '}'
        end

        arguments << call_attributes

        call = "#{key}(#{arguments.join ', '}, #{indent})"
        call += ' do' unless node[@children].empty?

        buffer_eval call
      end

      # Set call node children as block evaluation. Very useful for
      # performance and evaluating them in the parent context
      node[@children].each do |child|
        root child, indent + @settings[:indent]
      end

      # End block
      buffer_eval 'end' unless node[@children].empty?
    end
107235
def method_missing(method, *args, &block)
      if args.any? && args.first.is_a?(Hash)
        _links.send(method, [], &block)._expand(*args)
      elsif !Array.method_defined?(method)
        %i[_attributes _embedded _links].each do |target|
          target = send(target)
          return target.send(method, *args, &block) if target.respond_to?(method.to_s)
        end
        super
      end
    end
774225
def put(self, method, params):
        
        # Prepare the params, first by adding a custom command to
        # simulate a PUT request even though we are actually POSTing.
        # This is something DocumentCloud expects.
        params['_method'] = 'put'
        # Some special case handling of the document_ids list, if it exists
        if params.get("document_ids", None):
            # Pull the document_ids out of the params
            document_ids = params.get("document_ids")
            del params['document_ids']
            params = urllib.parse.urlencode(params, doseq=True)
            # These need to be specially formatted in the style documentcloud
            # expects arrays. The example they provide is:
            # ?document_ids[]=28-boumediene&document_ids[]=\
            # 207-academy&document_ids[]=30-insider-trading
            params += "".join([
                '&document_ids[]=%s' % id for id in document_ids
            ])
        # More special case handler of key/value data tags, if they exist
        elif params.get("data", None):
            # Pull them out of the dict
            data = params.get("data")
            del params['data']
            params = urllib.parse.urlencode(params, doseq=True)
            # Format them in the style documentcloud expects
            # ?data['foo']=bar&data['tit']=tat
            params += "".join([
                '&data[%s]=%s' % (
                    urllib.parse.quote_plus(key.encode("utf-8")),
                    urllib.parse.quote_plus(value.encode("utf-8"))
                ) for key, value in
                data.items()
            ])
        else:
            # Otherwise, we can just use the vanilla urllib prep method
            params = urllib.parse.urlencode(params, doseq=True)

        # Make the request
        self._make_request(
            self.BASE_URI + method,
            params.encode("utf-8"),
        )
1131185
public void executeMethod(final HttpMethod method) throws IOException, HttpException {
        if (method == null) {
            throw new IllegalArgumentException("Method may not be null");
        }
        // Link all parameter collections to form the hierarchy:
        // Global -> HttpClient -> HostConfiguration -> HttpMethod
        this.hostConfiguration.getParams().setDefaults(this.params);
        method.getParams().setDefaults(this.hostConfiguration.getParams());
        
        // Generate default request headers
        Collection<?> defaults = (Collection<?>)this.hostConfiguration.getParams().
			getParameter(HostParams.DEFAULT_HEADERS);
        if (defaults != null) {
        	Iterator<?> i = defaults.iterator();
        	while (i.hasNext()) {
        		method.addRequestHeader((Header)i.next());
        	}
        }
        
        try {
            int maxRedirects = this.params.getIntParameter(HttpClientParams.MAX_REDIRECTS, 100);

            for (int redirectCount = 0;;) {

                // make sure the connection we have is appropriate
                if (this.conn != null && !hostConfiguration.hostEquals(this.conn)) {
                    this.conn.setLocked(false);
                    this.conn.releaseConnection();
                    this.conn = null;
                }
        
                // get a connection, if we need one
                if (this.conn == null) {
                    this.conn = connectionManager.getConnectionWithTimeout(
                        hostConfiguration,
                        this.params.getConnectionManagerTimeout() 
                    );
                    this.conn.setLocked(true);
                    if (this.params.isAuthenticationPreemptive()
                     || this.state.isAuthenticationPreemptive()) 
                    {
                        LOG.debug("Preemptively sending default basic credentials");
                        method.getHostAuthState().setPreemptive();
                        method.getHostAuthState().setAuthAttempted(true);
                        if (this.conn.isProxied() && !this.conn.isSecure()) {
                            method.getProxyAuthState().setPreemptive();
                            method.getProxyAuthState().setAuthAttempted(true);
                        }
                    }
                }
                authenticate(method);
                executeWithRetry(method);
                if (this.connectMethod != null) {
                    fakeResponse(method);
                    break;
                }
                
                boolean retry = false;
                if (isRedirectNeeded(method)) {
                    if (processRedirectResponse(method)) {
                        retry = true;
                        ++redirectCount;
                        if (redirectCount >= maxRedirects) {
                            LOG.error("Narrowly avoided an infinite loop in execute");
                            throw new RedirectException("Maximum redirects ("
                                + maxRedirects + ") exceeded");
                        }
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("Execute redirect " + redirectCount + " of " + maxRedirects);
                        }
                    }
                }
                if (isAuthenticationNeeded(method)) {
                    if (processAuthenticationResponse(method)) {
                        LOG.debug("Retry authentication");
                        retry = true;
                    }
                }
                if (!retry) {
                    break;
                }
                // retry - close previous stream.  Caution - this causes
                // responseBodyConsumed to be called, which may also close the
                // connection.
                if (method.getResponseBodyAsStream() != null) {
                    method.getResponseBodyAsStream().close();
                }

            } //end of retry loop
        } finally {
            if (this.conn != null) {
                this.conn.setLocked(false);
            }
            // If the response has been fully processed, return the connection
            // to the pool.  Use this flag, rather than other tests (like
            // responseStream == null), as subclasses, might reset the stream,
            // for example, reading the entire response into a file and then
            // setting the file as the stream.
            if (
                (releaseConnection || method.getResponseBodyAsStream() == null) 
                && this.conn != null
            ) {
                this.conn.releaseConnection();
            }
        }

    }
1226109
def method_missing(method)
      method = method.to_s
      raise NoMethodError, "No such method: #{method}" unless @args.keys.include? method
      @args[method]
    end
239011
function execute_(callback) {
    var self = this;
    self.migrate(function(err) {
        if (err) { callback(err); return; }
        try {
            var event = { model:self.model, query:self.query, type:'select' };
            var flatten = self.$flatten || (self.getLevels()===0);
            if (!flatten) {
                //get expandable fields
                var expandables = self.model.attributes.filter(function(x) { return x.expandable; });
                //get selected fields
                var selected = self.query.$select[self.model.viewAdapter];
                if (_.isArray(selected)) {
                    //remove hidden fields
                    var hiddens = self.model.attributes.filter(function(x) { return x.hidden; });
                    if (hiddens.length>0) {
                        for (var i = 0; i < selected.length; i++) {
                            /**
                             * @type {QueryField}
                             */
                            var x = selected[i] instanceof QueryField ? selected[i] : new QueryField(selected[i]);
                            var hiddenField = hiddens.find(function(y) {
                                return x.getName() === y.name;
                            });
                            if (hiddenField) {
                                selected.splice(i, 1);
                                i-=1;
                            }
                        }
                    }
                    //expand fields
                    if (expandables.length>0) {
                        selected.forEach(function(x) {
                            //get field
                            var field = expandables.find(function(y) {
                                var f = x instanceof QueryField ? x : new QueryField(x);
                                return f.getName() === y.name;
                            });
                            //add expandable models
                            if (field) {
                                var mapping = self.model.inferMapping(field.name);
                                if (mapping) {
                                    self.$expand = self.$expand || [ ];
                                    var expand1 = self.$expand.find(function(x) {
                                        return x.name === field.name;
                                    });
                                    if (typeof expand1 === 'undefined') {
                                        self.expand(mapping);
                                    }
                                }

                            }
                        });
                    }
                }
            }
        }
        catch(err) {
            return callback(err);
        }

        //merge view filter. if any
        if (self.$view) {
            return self.model.filter({ $filter: self.$view.filter, $order:self.$view.order, $group:self.$view.group }, function(err, q) {
                if (err) {
                    if (err) { callback(err); }
                }
                else {
                    //prepare current filter
                    if (q.query.$prepared) {
                        if (event.query.$where)
                            event.query.prepare();
                        event.query.$where = q.query.$prepared;
                    }
                    if (q.query.$group)
                    //replace group fields
                        event.query.$group = q.query.$group;
                    //add order fields
                    if (q.query.$order) {
                        if (_.isArray(event.query.$order)) {
                            q.query.$order.forEach(function(x) { event.query.$order.push(x); });
                        }
                        else {
                            event.query.$order = q.query.$order;
                        }
                    }
                    //execute query
                    return finalExecuteInternal_.call(self, event, callback);
                }
            });
        }
        else {
            //execute query
            return finalExecuteInternal_.call(self, event, callback);
        }
    });
}
26450
def method_missing(method_name, *_args)
      if attrs.key?(method_name.to_s)
        attrs[method_name.to_s]
      else
        super(method_name)
      end
    end
902175
def execute(self, method, args, ref):
        

        response = {'result': None, 'error': None, 'ref': ref}
        fun = self.methods.get(method)
        if not fun:
            response['error'] = 'Method `{}` not found'.format(method)
        else:
            try:
                response['result'] = fun(*args)
            except Exception as exception:
                logging.error(exception, exc_info=1)
                response['error'] = str(exception)
        return response