Returns a new function by renaming variables occurring in the {@code function}
according to the {@code attributes} lookup table
487819
private Function renameVariables(Function function, ImmutableMap<QualifiedAttributeID, Term> attributes,
                                            QuotedIDFactory idfac) throws AttributeNotFoundException {
        List<Term> terms = function.getTerms();
        List<Term> newTerms = new ArrayList<>(terms.size());

        for (Term term : terms) {
            Term newTerm;
            if (term instanceof Variable) {
                Variable var = (Variable) term;
                QuotedID attribute = idfac.createAttributeID(var.getName());
                newTerm = attributes.get(new QualifiedAttributeID(null, attribute));

                if (newTerm == null) {
                    QuotedID quotedAttribute = QuotedID.createIdFromDatabaseRecord(idfac, var.getName());
                    newTerm = attributes.get(new QualifiedAttributeID(null, quotedAttribute));

                    if (newTerm == null)
                        throw new AttributeNotFoundException("The source query does not provide the attribute " + attribute
                                + " (variable " + var.getName() + ") required by the target atom.");
                }
            }
            else if (term instanceof Function)
                newTerm = renameVariables((Function) term, attributes, idfac);
            else if (term instanceof Constant)
                newTerm = term.clone();
            else
                throw new RuntimeException("Unknown term type: " + term);

            newTerms.add(newTerm);
        }

        return termFactory.getFunction(function.getFunctionSymbol(), newTerms);
    }
1358930
public static <F, T, KeyT extends F, TestT extends F>
  Function<EvalPair<? extends KeyT, ? extends TestT>, EvalPair<T, T>> functionOnBoth(
      final Function<F, T> func) {
    return new Function<EvalPair<? extends KeyT, ? extends TestT>, EvalPair<T, T>>() {
      @Override
      public EvalPair<T, T> apply(final EvalPair<? extends KeyT, ? extends TestT> input) {
        return EvalPair.of(func.apply(input.key()), func.apply(input.test()));
      }

      @Override
      public String toString() {
        return "EvalPair.functionOnBoth(" + func + ")";
      }
    };
  }
632340
protected <T> T invokeJavascriptReturnValue(String function, Class<T> returnType, Object... args) {
        Object returnObject = invokeJavascript(function, args);
        if (returnObject != null) {
            return (T) returnObject;
        } else {
            return null;
        }
    }
934361
public static <R, C, V> Function<Table.Cell<R, C, V>, C> toColumnKeyFunction() {
    return new Function<Table.Cell<R, C, V>, C>() {
      @Override
      public C apply(final Table.Cell<R, C, V> input) {
        return input.getColumnKey();
      }
    };
  }
1058849
private FunctionType createNativeFunctionTypeWithVarArgs(
      JSType returnType, JSType... parameterTypes) {
    return createNativeFunctionType(
        returnType, createParametersWithVarArgs(parameterTypes));
  }
826653
public BytecodeNode generateCall(
            String name,
            ScalarFunctionImplementation function,
            List<BytecodeNode> arguments,
            Optional<OutputBlockVariableAndType> outputBlockVariableAndType)
    {
        Optional<BytecodeNode> instance = Optional.empty();
        if (function.getInstanceFactory().isPresent()) {
            FieldDefinition field = cachedInstanceBinder.getCachedInstance(function.getInstanceFactory().get());
            instance = Optional.of(scope.getThis().getField(field));
        }
        return generateInvocation(scope, name, function, instance, arguments, callSiteBinder, outputBlockVariableAndType);
    }
173225
public static <A, B> Mapper<A, B> fromFunction(final Function<A, B> function) {
    return new Mapper<A, B>() {
      @Override
      public B map(A item) {
        return function.apply(item);
      }
    };
  }
878432
public static PathFunction newFunction(String name) throws InvalidPathException {
        Class functionClazz = FUNCTIONS.get(name);
        if(functionClazz == null){
            throw new InvalidPathException("Function with name: " + name + " does not exist.");
        } else {
            try {
                return (PathFunction)functionClazz.newInstance();
            } catch (Exception e) {
                throw new InvalidPathException("Function of name: " + name + " cannot be created", e);
            }
        }
    }
551215
public <R> Change<R> map(Function<T, R> fn) {
        return new Change<>(
                fn.apply(getOldValue()),
                fn.apply(getNewValue())
        );
    }
1076839
public static NamedAttributeType<Object> newNamedUnknownType(final String name, final Type type) {
	return new NamedAttributeType<>(name, new AttributeType<Object>(type) {});
    }
747217
def _return_feature(self, feature_type, feature_name, new_feature_name=...):
        
        if self.new_names:
            return feature_type, feature_name, (self.rename_function(feature_name) if new_feature_name is ... else
                                                new_feature_name)
        return feature_type, feature_name
844762
function ( styleDefiniton, variables )
				{
					return function( element )
						{
							var styleDef =
									variables ?
										new CKEDITOR.style( styleDefiniton, variables )._.definition
										: styleDefiniton;
							element.name = styleDef.element;
							CKEDITOR.tools.extend( element.attributes, CKEDITOR.tools.clone( styleDef.attributes ) );
							element.addStyle( CKEDITOR.style.getStyleText( styleDef ) );
						};
				}
111591
@NonNull
    Completable overwriteUsingDiffUtil(@NonNull final List<? extends T> newContents,
                                         @NonNull final EqualityFunction<? super T> identityEqualityFunction,
                                         @NonNull final EqualityFunction<? super T> contentEqualityFunction) {
        return copyContents().switchMap(new Function<List<? extends T>, Observable<?>>() {
            @Override
            public Observable<Object> apply(List<? extends T> existingContentsCopy) throws Exception {
                return calculateDiff(existingContentsCopy, newContents, identityEqualityFunction, contentEqualityFunction)
                        .switchMap(new Function<DiffUtil.DiffResult, Observable<Object>>() {
                            @Override
                            public Observable<Object> apply(DiffUtil.DiffResult diffResult) throws Exception {
                                return applyNewContentsAndDispatchDiffNotifications(newContents, diffResult).toObservable();
                            }
                        });
            }
        }).ignoreElements();
    }
614018
public FaceletTaglibFunctionType<WebFacelettaglibraryDescriptor> getOrCreateFunction()
   {
      List<Node> nodeList = model.get("function");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FaceletTaglibFunctionTypeImpl<WebFacelettaglibraryDescriptor>(this, "function", model, nodeList.get(0));
      }
      return createFunction();
   }
619973
def attribute(getter):
    
    if isfunction(getter):
        def setter(self, value):
            name = '_' + getter.__name__
            self.__change_attribute__(name=name, value=value)

        def new_getter(self):
            name = '_' + getter.__name__
            return getattr(self, name, None)

        return property(fget=new_getter, fset=setter, doc=getter.__doc__)
    else:
        raise ProgrammingError("Expected a function, got: {}".format(repr(getter)))
1202573
function _createFunName(fun){
        var name = '';

        if(baidu.lang.isFunction(fun)){
            name = _createString();
            window[name] = function(){
                fun.apply(window, arguments);
            };

            return name;
        }else if(baidu.lang.isString){
            return fun;
        }
    }
432770
public Object getFunctionWithNamedValues(Object coll, Key key, Object[] args, Object defaultValue) {
	return variableUtil.callFunctionWithNamedValues(this, coll, key, args, false, defaultValue);
    }