Creates a const function that evaluates it's argument to given {@code value}.

@param arg a const value

@return a closure object that does {@code _}
4857
public static MatrixFunction asConstFunction(final double arg) {
        return new MatrixFunction() {
            @Override
            public double evaluate(int i, int j, double value) {
                return arg;
            }
        };
    }
1282292
public void add(final String arg) {
        if (arg != null) {
            final Argument argument = parse(arg);
            add(argument);
        }
    }
519790
protected R execute(A... arg) throws E
   {
      if (arg == null || arg.length == 0)
      {
         return execute((A)null);
      }
      return execute(arg[0]);
   }
1122638
public final Promise set(String key, byte[] value, SetArgs args) {
		byte[] binaryKey = key.getBytes(StandardCharsets.UTF_8);
		if (client != null) {
			if (args == null) {
				return new Promise(client.set(binaryKey, value));
			}
			return new Promise(client.set(binaryKey, value, args));
		}
		if (clusteredClient != null) {
			if (args == null) {
				return new Promise(clusteredClient.set(binaryKey, value));
			}
			return new Promise(clusteredClient.set(binaryKey, value, args));
		}
		return Promise.resolve();
	}
653523
@Override
   public Closure<V> trampoline(final Object... args) {
        return new TrampolineClosure<V>(original.curry(args));
    }
40933
public Groundy arg(String key, String value) {
    mArgs.putString(key, value);
    return this;
  }
1283289
function get(object, key, ...args) {
  if (object) {
    const value = object[key];
    if (typeof value === 'function') {
      return value(...args);
    } else {
      return value;
    }
  }
}
127758
public static MatrixFunction asMinusFunction(final double arg) {
        return new MatrixFunction() {
            @Override
            public double evaluate(int i, int j, double value) {
                return value - arg;
            }
        };
    }
812297
function(args) {
  var argsMap = {};
  var mainPos = 1;

  while (args[mainPos].indexOf('--') > 0) {
    mainPos++;
  }
  argsMap.main = args[mainPos];

  for (var i = (mainPos + 1); i < args.length; i++) {
    var arg = args[i];
    var sep = arg.indexOf('=');
    var key = arg.slice(0, sep);
    var value = arg.slice(sep + 1);
    if (!isNaN(Number(value)) && (value.indexOf('.') < 0)) {
      value = Number(value);
    }
    argsMap[key] = value;
  }

  return argsMap;
}
544112
private void evalPlural(MessageArg arg, boolean cardinal) {
    tag.skip(COMMA_WS);
    if (!arg.resolve()) {
      return;
    }

    String value = arg.asString();
    String offsetValue = value;

    // Look for optional "offset:<number>" argument. This modifies the argument value,
    // changing the plural operands calculation.
    long offset = 0;
    if (tag.seek(PLURAL_OFFSET, choice)) {
      tag.jump(choice);
      tag.skip(COMMA_WS);

      // Parse the offset digits and the argument value.
      offset = toLong(format, choice.pos + 7, choice.end);
      long newValue = toLong(value, 0, value.length()) - offset;

      // Operands are evaluated based on the offset-adjusted value.
      offsetValue = Long.toString(newValue);
      operands.set(offsetValue);
    } else {
      operands.set(value);
    }

    // Evaluate the plural operands for the current argument.
    String language = locale.language();
    PluralCategory category = cardinal 
        ? PLURAL_RULES.evalCardinal(language, operands) 
        : PLURAL_RULES.evalOrdinal(language, operands);
        
    Recognizer matcher = PLURAL_MATCHERS[category.ordinal()];

    // Scan over the potential choices inside this tag. We will evaluate
    // the first choice that matches our plural category.
    char ch;
    while ((ch = tag.peek()) != Chars.EOF) {
      // First look for explicit match, falling back to a plural category.
      if (ch == '=' && tag.seek(PLURAL_EXPLICIT, choice)) {
        tag.jump(choice);

        // Skip the '=' character.
        choice.pos++;

        // If our argument matches the exact value, recurse and then return.
        String repr = choice.token().toString();
        if (repr.equals(value) && tag.seekBounds(choice, '{', '}')) {
          recurse(choice, offsetValue);
          return;
        }

      } else if (tag.seek(matcher, choice)) {
        // Jump over the plural category.
        tag.jump(choice);
        tag.skipWs();

        // If the choice format is valid, recurse and then return.
        if (tag.peek() == '{' && tag.seekBounds(choice, '{', '}')) {
          recurse(choice, offsetValue);
        }
        return;
      }

      // Skip over this choice and any trailing whitespace, or bail out if no match.
      if (!tag.seekBounds(choice, '{', '}')) {
        return;
      }
      tag.jump(choice);
      tag.skip(COMMA_WS);
    }
  }
1174982
private void initCompilerClosureArgumentsFromConfig(List<String> args, JawrConfig config) {
		Set<Entry<Object, Object>> entrySet = config.getConfigProperties().entrySet();
		for (Entry<Object, Object> propEntry : entrySet) {
			String key = (String) propEntry.getKey();
			if (key.startsWith(JAWR_JS_CLOSURE_PREFIX) && !JAWR_JS_CLOSURE_SPECIFIC_PROPERTIES.contains(key)) {

				String compilerArgName = key.substring(JAWR_JS_CLOSURE_PREFIX.length());
				checkCompilerArgumentName(compilerArgName);
				String compilerArgValue = (String) propEntry.getValue();
				compilerArgValue = getCompilerArgValue(compilerArgName, compilerArgValue);
				args.add(CLOSURE_ARGUMENT_NAME_PREFIX + compilerArgName);
				args.add(propEntry.getValue().toString());
			}
		}

		// Add default compilation level argument
		if (!args.contains(COMPILATION_LEVEL_ARG)) {
			args.add(COMPILATION_LEVEL_ARG);
			args.add(WHITESPACE_ONLY_COMPILATION_LEVEL);
		}

		// Add default level warning argument if not defined
		if (!args.contains(WARNING_LEVEL_ARG)) {
			args.add(WARNING_LEVEL_ARG);
			args.add(VERBOSE_WARNING_LEVEL);
		}
	}
387272
public static VectorFunction asMinusFunction(final double arg) {
        return new VectorFunction() {
            @Override
            public double evaluate(int i, double value) {
                return value - arg;
            }
        };
    }
425704
function wrapArgs (args, visited = new Set()) {
  const valueToMeta = (value) => {
    // Check for circular reference.
    if (visited.has(value)) {
      return {
        type: 'value',
        value: null
      }
    }

    if (Array.isArray(value)) {
      visited.add(value)
      const meta = {
        type: 'array',
        value: wrapArgs(value, visited)
      }
      visited.delete(value)
      return meta
    } else if (bufferUtils.isBuffer(value)) {
      return {
        type: 'buffer',
        value: bufferUtils.bufferToMeta(value)
      }
    } else if (value instanceof Date) {
      return {
        type: 'date',
        value: value.getTime()
      }
    } else if ((value != null) && typeof value === 'object') {
      if (isPromise(value)) {
        return {
          type: 'promise',
          then: valueToMeta(function (onFulfilled, onRejected) {
            value.then(onFulfilled, onRejected)
          })
        }
      } else if (v8Util.getHiddenValue(value, 'atomId')) {
        return {
          type: 'remote-object',
          id: v8Util.getHiddenValue(value, 'atomId')
        }
      }

      const meta = {
        type: 'object',
        name: value.constructor ? value.constructor.name : '',
        members: []
      }
      visited.add(value)
      for (const prop in value) {
        meta.members.push({
          name: prop,
          value: valueToMeta(value[prop])
        })
      }
      visited.delete(value)
      return meta
    } else if (typeof value === 'function' && v8Util.getHiddenValue(value, 'returnValue')) {
      return {
        type: 'function-with-return-value',
        value: valueToMeta(value())
      }
    } else if (typeof value === 'function') {
      return {
        type: 'function',
        id: callbacksRegistry.add(value),
        location: v8Util.getHiddenValue(value, 'location'),
        length: value.length
      }
    } else {
      return {
        type: 'value',
        value: value
      }
    }
  }
  return args.map(valueToMeta)
}
36912
function (...args) {
  let value = false;
  args.forEach((arg) => {
    if (value === false) {
      if (arg === true || (typeof arg === 'string' && arg.toLowerCase() === 'true') || arg === 1) {
        value = true;
      }
    }
  });
  return value;
}
1362033
private Map<String, Object> handleParameterArg(final String arg, final Deque<String> args, final Argument argument) {
        final Map.Entry<String, String> entry = parse(arg, args);
        if (entry.getValue() == null) {
            throw new BuildException("Missing value for property " + entry.getKey());
        }
        return ImmutableMap.of(argument.property, argument.getValue(entry.getValue()));
    }
1093858
@Override
    public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
        log.debug("In evaluate() of DEFINE function. Args = {}", Arrays.toString(args));
        
        return new StringEval(DefineFunction.class.getAnnotation(CustomFunctionMeta.class).value());
    }
700375
public Object invoke( Object[] args )
  {
    Object value = getValue();
    if( value instanceof ISymbol )
    {
      return ((Symbol)value).invoke( args );
    }
    if( value instanceof IBlock )
    {
      return ((IBlock) value).invokeWithArgs( args );
    }

    Method method = (Method)value;
    Object ret;
    try
    {
      ret = method.invoke( null, args );
    }
    catch( Exception e )
    {
      throw GosuExceptionUtil.forceThrow( e );
    }
    return ret;
  }