Populates an ordered JSON object with one or more key/value pairs.

@param args even number of alternating keys/values.
@return ordered JSON object including the specified key/value pairs.
345810
@Trivial
    private JSONObject toJSONObject(Object... args) {
        OrderedJSONObject json = new OrderedJSONObject();
        for (int i = 0; i < args.length; i += 2)
            json.put(args[i], args[i + 1]);
        return json;
    }
686914
protected function serializeArguments(array $args)
    {
        // first we have to sort the args by key to avoid that different orders
        // lead to different cache entries!
        ksort($args);

        $result = '';
        $invalidKeys = array('userid', 'apikey', 'keyid', 'vcode');
        foreach ($args as $key => $value) {
            $key   = trim($key);
            $value = trim($value);
            if (empty($value) || in_array($key, $invalidKeys)) {
                // ignore the invalid keys...
                continue;
            }
            $result .= ';' . $key . '=' . $value;
        }

        return $result;
    }
1345203
@javax.annotation.Nonnull
  public JsonObject getJson() {
    @javax.annotation.Nonnull final JsonObject json = new JsonObject();
    json.addProperty("min", min);
    json.addProperty("max", max);
    json.addProperty("negatives", negatives);
    json.addProperty("positives", positives);
    json.addProperty("zeros", zeros);
    json.addProperty("sum0", sum0);
    json.addProperty("sum1", sum1);
    json.addProperty("sum2", sum2);
    json.addProperty("sumLog", sumLog);
    return json;
  }
859201
public JSONArray getJSONArray(K key) {
		final Object object = this.getObj(key);
		if(null == object) {
			return null;
		}
		
		if(object instanceof JSONArray) {
			return (JSONArray) object;
		}
		return new JSONArray(object);
	}
660779
public T load(Object ... args) {
        try {
            T item = target.newInstance();
            Map vals = (Map)args[0];
            
            load(item, vals);
            return item;
        }
        catch( InstantiationException e ) {
            throw new CacheManagementException(e);
        }
        catch( IllegalAccessException e ) {
            throw new CacheManagementException(e);
        }
    }
218316
function jsonCompare(arg, options) {
    var sortOrder;
    if (typeof arg === 'string') {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON([arg]);
    }
    else if (_.isArray(arg)) {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON(arg);
    }
    else {
        sortOrder = arg;
    }
    var comparator = new SortOrderComparator(sortOrder, options);
    return (_.bind(comparator.compare, comparator));
}
827293
@SuppressWarnings("unchecked")
	public T create(Object[] args)
	{
		for(int i=0, n=args.length; i<n; i++)
		{
			if(arguments[i] instanceof FactoryDefinition.InjectedArgument)
			{
				args[i] = arguments[i].getValue(null);
			}
		}

		try
		{
			return (T) raw.newInstance(args);
		}
		catch(IllegalArgumentException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InstantiationException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(IllegalAccessException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InvocationTargetException e)
		{
			throw new SerializationException("Unable to create; " + e.getCause().getMessage(), e.getCause());
		}
	}
242982
public @Nonnull JsonBuilder putArray(String key, @Nonnull Number... values) {
        JsonArray jjArray = new JsonArray();
        for (Number number : values) {
            jjArray.add(primitive(number));
        }
        object.put(key, jjArray);
        return this;
    }
977644
protected String getArguments(Object[] args) {

        if (args == null || args.length == 0) {
            return "";
        }

        StringBuilder sb = new StringBuilder();

        if (args.length == 1) {
            Object arg = args[0];
            String param = getSingleArgParameterAsString(arg);
            String displayParam = getSingleArgDisplayParameter(param);
            if (arg instanceof String) {
                sb.append("\"");
                sb.append(displayParam);
                sb.append("\"");
            } else {
                sb.append(displayParam);
            }
        } else {
            for (int i = 0; i < args.length; i++) {
                Object arg = args[i];
                boolean lastArg = i == args.length - 1;
                String param = getParameterAsString(arg);
                String displayParam = getDisplayParameter(param);
                if (arg instanceof String) {
                    sb.append("\"");
                    sb.append(displayParam);
                    sb.append("\"");
                } else {
                    sb.append(displayParam);
                }

                if (!lastArg) {
                    sb.append(",");
                }
            }
        }

        return sb.toString();
    }
316916
public static function sortArgs(array &$args) {
        ksort($args);
        foreach ($args as $key => $val) {
            if (is_array($val)) {
                ksort($val);
                $args [ $key ] = $val;
                self::sortArgs($val);
            }
        }
    }
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;
}
802070
public Serializable invoke(Serializable[] args)
   {
      if (args != null)
         return new IllegalArgumentException("Unsupported argument list: " + Arrays.toString(args));

      System.exit(0);

      return null;
   }
385414
@UsedByGeneratedCode
    public static Map mapOf(Object... values) {
        int len = values.length;
        if (len % 2 != 0) {
            throw new IllegalArgumentException("Number of arguments should be an even number representing the keys and values");
        }

        Map answer = new LinkedHashMap(len / 2);
        int i = 0;
        while (i < values.length - 1) {
            answer.put(values[i++], values[i++]);
        }
        return answer;
    }
655696
protected JSONArray callMethod(String method, Object ... args) throws Exception {
        return new QueryBuilder().retrieveResult(storedId).call(method, args).storeResult("LAST_" + getStoredId()).execute();
    }
824838
function jsify(arg) {
        if (_.isArray(arg)) {
            return _.map(arg, jsify);
        }
        else if (!_.isObject(arg)) {
            return arg;
        }
        else if (Tinkerpop.isLongValue(arg)) {
            // Represent longValue_t as string
            return arg.longValue;
        }
        else if (isType(arg, 'java.util.List')) {
            return _jsifyCollection(arg);
        }
        else if (isType(arg, 'java.util.Map')) {
            return _jsifyMap(arg);
        }
        else if (isType(arg, 'java.util.Map$Entry')) {
            return _jsifyMapEntry(arg);
        }
        else if (isType(arg, 'org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet')) {
            // BulkSet is used to hold groupCount result, so it is given special treatment.
            return _jsifyBulkSet(arg);
        }
        else if (isType(arg, 'java.util.Set')) {
            return _jsifyCollection(arg);
        }
        else if (isType(arg, 'org.apache.tinkerpop.gremlin.process.traversal.Path')) {
            return _jsifyPath(arg);
        }
        else {
            return arg;
        }
    }
1093391
public static String getOptimizedPlanAsJson(Optimizer compiler, PackagedProgram prog, int parallelism)
			throws CompilerException, ProgramInvocationException {
		PlanJSONDumpGenerator jsonGen = new PlanJSONDumpGenerator();
		return jsonGen.getOptimizerPlanAsJSON((OptimizedPlan) getOptimizedPlan(compiler, prog, parallelism));
	}
1357271
public String getOptimizedPlanAsJson(PackagedProgram prog, int parallelism) throws CompilerException, ProgramInvocationException {
		PlanJSONDumpGenerator jsonGen = new PlanJSONDumpGenerator();
		return jsonGen.getOptimizerPlanAsJSON(getOptimizedPlan(prog, parallelism));
	}