public Instance expand(SerializationContext context, List<ExpressionNode> argumentValues, Deque<String> path) {
        Map<String, String> argumentBindings = new HashMap<>();
        for (int i = 0; i < arguments.size() && i < argumentValues.size(); ++i) {
            String key = arguments.get(i);
            ExpressionNode expr = argumentValues.get(i);
            String binding = expr.toString(new StringBuilder(), context, path, null).toString();

            if (shouldGenerateFeature(expr)) {
                String funcName = "autogenerated_ranking_feature@" + Long.toHexString(symbolCode(key + "=" + binding));
                context.addFunctionSerialization(RankingExpression.propertyName(funcName), binding);
                binding = wrapInRankingExpression(funcName);
            }
            argumentBindings.put(key, binding);
        }
        context = argumentBindings.isEmpty() ? context.withoutBindings() : context.withBindings(argumentBindings);
        String symbol = toSymbol(argumentBindings);
        String expressionString = body.getRoot().toString(new StringBuilder(), context, path, null).toString();
        return new Instance(symbol, expressionString);
    }
Creates and returns an instance of this function based on the given
arguments. If function calls are nested, this call may produce
additional functions.

@param context the context used to expand this
@param argumentValues the arguments to instantiate on.
@param path the expansion path leading to this.
@return the script function instance created.
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/ExpressionFunction.java