Approves specific callables by their names.
420246
@RequirePOST
    public HttpResponse doApprove(@QueryParameter String value) throws IOException {
        whitelisted.append(value);
        return HttpResponses.ok();
    }
181466
function callnTimes (object, methodName, count) {
    let returnValue
    while (count--) returnValue = object[methodName]()
    return returnValue
  }
312450
def _call_with_selection(func):
    """"""
    wrapped_kwonly_params = [
        param for param in inspect.signature(func).parameters.values()
        if param.kind == param.KEYWORD_ONLY]
    sel_sig = inspect.signature(Selection)
    default_sel_sig = sel_sig.replace(
        parameters=[param.replace(default=None) if param.default is param.empty
                    else param
                    for param in sel_sig.parameters.values()])

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        extra_kw = {param.name: kwargs.pop(param.name)
                    for param in wrapped_kwonly_params if param.name in kwargs}
        ba = default_sel_sig.bind(*args, **kwargs)
        # apply_defaults
        ba.arguments = ChainMap(
            ba.arguments,
            {name: param.default
             for name, param in default_sel_sig.parameters.items()
             if param.default is not param.empty})
        sel = Selection(*ba.args, **ba.kwargs)
        return func(sel, **extra_kw)

    wrapper.__signature__ = Signature(
        list(sel_sig.parameters.values()) + wrapped_kwonly_params)
    return wrapper
701859
function(jid, name, node, call_back)
    {
        if (node && !call_back)
            return false;
        this._items.push({jid: jid, name: name, node: node, call_back: call_back});
        return true;
    }
240442
private void updateRingingAgents(String channelCalling, AsteriskAgentImpl agent)
    {
        synchronized (ringingAgents)
        {
            if (ringingAgents.containsKey(channelCalling))
            {
                updateAgentState(ringingAgents.get(channelCalling), AgentState.AGENT_IDLE);
            }
            ringingAgents.put(channelCalling, agent);
        }
    }
1135660
public function approve( $args, $assoc_args ) {
		$this->check_server_name();
		foreach ( $args as $id ) {
			$this->set_status( $id, 'approve', 'Approved' );
		}
	}
1014168
def call_name_is(siter, name):
    """"""
    return (
        isinstance(siter, ast.Call)
        and hasattr(siter.func, 'attr')
        and siter.func.attr == name
    )
1047524
protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) {
		String nameAsPropertyName = tryGetAsPropertyName(name.toString());
		if (nameAsPropertyName != null) {
			if (featureCall == null || featureCall instanceof XAssignment) {
				String aliasedSetter = "set" + nameAsPropertyName;
				acceptor.accept(aliasedSetter, 2);
			}
			if (!(featureCall instanceof XAssignment)) {
				if (featureCall == null || !getFeatureCall().isExplicitOperationCallOrBuilderSyntax()) {
					String aliasedGetter = "get" + nameAsPropertyName;
					acceptor.accept(aliasedGetter, 2);
					String aliasedBooleanGetter = "is" + nameAsPropertyName;
					acceptor.accept(aliasedBooleanGetter, 2);
				}
			}
		}
	}
1249143
def can_approve(self, user, **data):
        
        is_org_admin = user.is_org_admin(self.organisation_id)

        is_reseller_preverifying = user.is_reseller() and data.get('pre_verified', False)

        raise Return(is_org_admin or is_reseller_preverifying)
1032503
public function wasCalledAtLeastOnce(): bool
    {
        if (count($this->invocations) < 1) {
            throw new CallAmountViolation(sprintf(
                    '%s was expected to be called at least once,'
                    . ' but was never called.',
                    $this->invocations->name()
            ));
        }

        return true;
    }
606101
def _compute_am_i_approver(self):
        """"""
        for rec in self:
            rec.am_i_approver = rec.can_user_approve_this_page(self.env.user)
687505
def select_scheme(self, name):
        """"""
        # it's the caller's problem if they supply a bad name!
        scheme = INSTALL_SCHEMES[name]
        for key in SCHEME_KEYS:
            attrname = 'install_' + key
            if getattr(self, attrname) is None:
                setattr(self, attrname, scheme[key])
249536
def _compile_callable(self, schema):
        
        # Prepare self
        self.compiled_type = const.COMPILED_TYPE.CALLABLE
        self.name = get_callable_name(schema)

        # Error utils
        enrich_exception = lambda e, value: e.enrich(
            expected=self.name,
            provided=get_literal_name(value),
            path=self.path,
            validator=schema)

        # Validator
        def validate_with_callable(v):
            try:
                # Try this callable
                return schema(v)
            except Invalid as e:
                # Enrich & re-raise
                enrich_exception(e, v)
                raise
            except const.transformed_exceptions as e:
                message = _(u'{message}').format(
                    Exception=type(e).__name__,
                    message=six.text_type(e))
                e = Invalid(message)
                raise enrich_exception(e, v)

        # Matcher
        if self.matcher:
            def match_with_callable(v):
                try:
                    return True, validate_with_callable(v)
                except Invalid:
                    return False, v
            return match_with_callable

        return validate_with_callable
1133150
def addCallSet(self, callSet):
        
        callSetId = callSet.getId()
        self._callSetIdMap[callSetId] = callSet
        self._callSetNameMap[callSet.getLocalId()] = callSet
        self._callSetIds.append(callSetId)
        self._callSetIdToIndex[callSet.getId()] = len(self._callSetIds) - 1
778922
public void listAlternatives(ILexNameToken name)
	{
		for (PDefinition possible : findMatches(name))
		{
			if (af.createPDefinitionAssistant().isFunctionOrOperation(possible))
			{
				TypeChecker.detail("Possible", possible.getName());
			}
		}
	}
419885
def resolve_name_with_call_id(caller_id, ns, name, remappings)
      name = canonicalize_name(expand_local_name(caller_id, name))
      if remappings
        remappings.each_pair do |key, value|
          if name == canonicalize_name(key)
            name = value
          end
        end
      end
      if ns
        name = ns + SEP + name
      end
      return canonicalize_name(name)
    end
1080948
def apply_if_callable(maybe_callable, obj, **kwargs):
    

    if callable(maybe_callable):
        return maybe_callable(obj, **kwargs)

    return maybe_callable