generateGFunction is the factory method of the g(_, _) function.

@param name the name of the g(_, _) function, can be "g", "g2", ..
@param rm the role manager used by the function.
@return the function.
356730
public static AviatorFunction generateGFunction(String name, RoleManager rm) {
        return new AbstractFunction() {
            public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2) {
                String name1 = FunctionUtils.getStringValue(arg1, env);
                String name2 = FunctionUtils.getStringValue(arg2, env);

                if (rm == null) {
                    return AviatorBoolean.valueOf(name1.equals(name2));
                } else {
                    boolean res = rm.hasLink(name1, name2);
                    return AviatorBoolean.valueOf(res);
                }
            }

            public AviatorObject call(Map<String, Object> env, AviatorObject arg1, AviatorObject arg2, AviatorObject arg3) {
                String name1 = FunctionUtils.getStringValue(arg1, env);
                String name2 = FunctionUtils.getStringValue(arg2, env);

                if (rm == null) {
                    return AviatorBoolean.valueOf(name1.equals(name2));
                } else {
                    String domain = FunctionUtils.getStringValue(arg3, env);
                    boolean res = rm.hasLink(name1, name2, domain);
                    return AviatorBoolean.valueOf(res);
                }
            }

            public String getName() {
                return name;
            }
        };
    }
229898
public Optional<Double> doubleArg(final String name) {
		return arg(name)
			.flatMap(s -> parse(s, Double::valueOf));
	}
1366078
public static <T> Parameters.Builder<T> logger(String name) {
        return Parameters.<T> builder().name(name);
    }
465253
public static MessageBatcher getBatcher(String name) {
		MessageBatcher batcher = batcherMap.get(name);
		return batcher;
	}
501255
private static String createSig(Method m) {
        return m.getName() + ':' + MethodDesc.forMethod(m).getDescriptor();
    }
532490
public static final Nature create(String name)
    {
        Nature nature = fromString(name);
        if (nature == null)
            return new Nature(name);
        return nature;
    }
257912
@SuppressWarnings("unchecked")
    public static <T> T getBean(String name) {
        BeanManager bm = getBeanManager();
        Bean<?> bean = bm.getBeans(name).iterator().next();
        CreationalContext<?> ctx = bm.createCreationalContext(bean);
        return (T) bm.getReference(bean, bean.getBeanClass(), ctx);
    }
1034277
public static SerializationFormat getOutputFormat(String name) {
        for (SerializationFormat ft : Instance.serializationFormats) {
            if (ft.isAcceptedAsOutput(name)) {
                return ft;
            }
        }
        return null;
    }
460446
function(context, name) {

                    var method = typeof name === "string" ? context[name] : name;

                    if (!isFunction(method)) {
                        method = context[method];
                    }

                    return function() {
                        context.called = name;
                        return method.apply(context, [this.nodeName ? can.$(this) : this].concat(slice.call(arguments, 0)));
                    };
                }
361519
@SuppressWarnings("unchecked")
    public <T> T getArgument(String name) {
        return (T) arguments.get(name);
    }
1020971
public List<String> getUsersForRole(String name) {
        try {
            return model.model.get("g").get("g").rm.getUsers(name);
        } catch (Error e) {
            if (!e.getMessage().equals("error: name does not exist")) {
                throw e;
            }
        }
        return null;
    }
1047363
public FunctionInputDef getFunctionInputDef( String name)
    {
    int i = findFunctionInputDef( name);
    return i >= 0? functionInputDefs_.get(i) : null;
    }
1223978
public static Method getFunction(String functionName) {
    Method method = FUNCTION_MAP.get(functionName);
    if (method != null) {
      return method;
    }
    String nameLower = functionName.toLowerCase(Locale.US);
    if (nameLower == functionName) {
      // Input name was in lower case, the function is not there
      return null;
    }
    method = FUNCTION_MAP.get(nameLower);
    if (method != null && FUNCTION_MAP.size() < 1000) {
      // Avoid OutOfMemoryError in case input function names are randomized
      // The number of methods is finite, however the number of upper-lower case combinations
      // is quite a few (e.g. substr, Substr, sUbstr, SUbstr, etc).
      FUNCTION_MAP.putIfAbsent(functionName, method);
    }
    return method;
  }
717783
private String getRDN(String name) {
        if (name == null) {
            return name;
        }
        int indexOfEqual = name.indexOf('=');
        if (indexOfEqual < 0) {
            return name;
        }
        String rdnValue = name.substring(0, indexOfEqual);
        return rdnValue;
    }
547722
public ISarlArtifactBuilder addSarlArtifact(String name) {
		ISarlArtifactBuilder builder = this.sarlArtifactProvider.get();
		builder.eInit(getScript(), name, getTypeResolutionContext());
		return builder;
	}
1253910
public double optDouble(String name, double fallback) {
		Object object = opt(name);
		Double result = JSON.toDouble(object);
		return result != null ? result : fallback;
	}
1279076
public ISarlBehaviorUnitBuilder addSarlBehaviorUnit(String name) {
		ISarlBehaviorUnitBuilder builder = this.iSarlBehaviorUnitBuilderProvider.get();
		builder.eInit(getSarlBehavior(), name, getTypeResolutionContext());
		return builder;
	}