Translates a multi-argument context.report() call into a single object argument call
@param {...*} arguments A list of arguments passed to `context.report`
@returns {MessageDescriptor} A normalized object containing report information
424887
function normalizeMultiArgReportCall() {
  // If there is one argument, it is considered to be a new-style call already.
  if (arguments.length === 1) {
    return arguments[0];
  }

  // If the second argument is a string, the arguments are interpreted as [node, message, data, fix].
  if (typeof arguments[1] === 'string') {
    return {
      node: arguments[0],
      message: arguments[1],
      data: arguments[2],
      fix: arguments[3],
    };
  }

  // Otherwise, the arguments are interpreted as [node, loc, message, data, fix].
  return {
    node: arguments[0],
    loc: arguments[1],
    message: arguments[2],
    data: arguments[3],
    fix: arguments[4],
  };
}
592760
function _normalizeArguments(obj) {
    var args = arguments;

    if (!obj || Utils.isFunction(obj)) {
      args = Array.prototype.slice.call(arguments, 0);
      args.unshift({});
    }

    return args;
  }
1147010
function resolveArgs(argumentsObject, nameMap, rightToLeft) {
  var result = {};

  var takeFromRight = rightToLeft;
  var args = Array.prototype.slice.call(argumentsObject);

  while (nameMap.length) {
    var value = null;
    var name = take(nameMap, takeFromRight);

    if (args.length > 0) {
      value = take(args, takeFromRight);
      takeFromRight = !takeFromRight;
    }

    result[name] = value;
  }

  return result;
}
1165833
function(context, descriptor, args) {
		var ok, condition = args[0],
			successTempl = args[1],
			failTempl = args[2];
		if (condition && condition.__interpolable__)
			ok = condition.output(context);
		else if (typeof condition === 'function')
			ok = condition.call(this, context);
		var sod = new SOD();
		if (ok)
			successTempl.toHTMLString(context, sod);
		else if (failTempl)
			failTempl.toHTMLString(context, sod);
		if (sod.children)
			descriptor.children += sod.children;
	}
785598
function create(context) {
    const options = Array.isArray(context.options) ? context.options : [];
    const isPathAndPatternsObject =
        typeof options[0] === "object" &&
        (Object.prototype.hasOwnProperty.call(options[0], "paths") ||
            Object.prototype.hasOwnProperty.call(options[0], "patterns"));

    const restrictedPaths =
        (isPathAndPatternsObject ? options[0].paths : options) || [];
    const restrictedPatterns =
        (isPathAndPatternsObject ? options[0].patterns : []) || [];

    const restrictedPathMessages = restrictedPaths.reduce(
        (memo, importName) => {
            if (typeof importName === "string") {
                memo[importName] = null;
            } else {
                memo[importName.name] = importName.message;
            }
            return memo;
        },
        {}
    );

    // if no modules are restricted we don"t need to check
    if (
        Object.keys(restrictedPaths).length === 0 &&
        restrictedPatterns.length === 0
    ) {
        return {};
    }

    const ig = ignore().add(restrictedPatterns);

    /**
     * Report a restricted path.
     * @param {node} node representing the restricted path reference
     * @returns {void}
     * @private
     */
    function reportPath(node) {
        const moduleName = node.value.trim();
        const customMessage = restrictedPathMessages[moduleName];
        const message = customMessage
            ? CUSTOM_MESSAGE_TEMPLATE
            : DEFAULT_MESSAGE_TEMPLATE;

        context.report({
            node,
            message,
            data: {
                moduleName,
                customMessage
            }
        });
    }

    /**
     * Check if the given name is a restricted path name
     * @param {string} name name of a variable
     * @returns {boolean} whether the variable is a restricted path or not
     * @private
     */
    function isRestrictedPath(name) {
        return Object.prototype.hasOwnProperty.call(
            restrictedPathMessages,
            name
        );
    }

    return {
        CallExpression(node) {
            if (!isAmdDefine(node) && !isAmdRequire(node)) return;

            const paths = getDependencyStringNodes(node);

            for (let i = 0; i < paths.length; i++) {
                const nodeCurrent = paths[i];
                const moduleName = nodeCurrent.value.trim();

                // check if argument value is in restricted modules array
                if (isRestrictedPath(moduleName)) {
                    reportPath(nodeCurrent);
                }

                if (restrictedPatterns.length > 0 && ig.ignores(moduleName)) {
                    context.report({
                        node,
                        message:
                            "'{{moduleName}}' module is restricted from being used by a pattern.",
                        data: { moduleName }
                    });
                    break;
                }
            }
        }
    };
}
637372
function(context, descriptor, args) {
		var xpr = args[0],
			index = args[1],
			templ = args[2],
			val = xpr.__interpolable__ ? xpr.output(context) : xpr,
			rest = new Template(templ._queue.slice(index));
		if (val)
			rest.toHTMLString(context, descriptor);
	}
112712
function callMethod(target, parseArgs, args) {

    // The first argument should be a function or an array.
    var func = args[0],
        funcArgs = [],
        modifiedArgs = [];

    // Handles [func, arg1, arg2, arg3], ...
    if (isArray(func) && isFunction(func[0])) {
        funcArgs = func.splice(1);
        func = func[0];
        modifiedArgs = args.splice(1);

    } else if (isFunction(func)) {
        funcArgs = args.splice(1);

    } else {
        errorManager.illegalArgument(args,
            'first argument must be a function');
    }

    // The source properties will be added here.
    var Scope = function() {};

    // Ensure the function has access to the target's current properties,
    // so that it can make function calls for example.
    Scope.prototype = target;

    // Apply with scope.
    var scope = new Scope();
    fastApply(func, scope, funcArgs);

    // Copy the non-prototype properties to source.
    var source = {};
    for (var key in scope) {
        if (scope.hasOwnProperty(key)) {
            source[key] = scope[key];
        }
    }

    // Reconstruct the method args with the new source object.
    modifiedArgs.unshift(source);

    return parseArgs(modifiedArgs);
}
1185525
function argumentFilter(args){
		var ret;
		if (typeof args[0] == 'object') {
			args=args[0];
			ret={};
			for (var i in args) if (args.hasOwnProperty(i) && typeof args[i] == 'function') {
				ret[i]=args[i];
			}
			return ret;
		}
		ret=[];
		for (var i=0,ii=args.length;i<ii;i++) if (typeof args[i] == 'function') {
			ret.push(args[i]);
		}
		return ret;
	}
1083088
private V8Array convertArguments(Object[] args, Set<V8Value> newValues) {
		//create the array
		V8Array result = new V8Array(runtime);
		newValues.add(result);
		
		//convert the values
		for (int i = 0; i < args.length; ++i) {
			Object o = args[i];
			if (o == null) {
				result.push(V8Value.NULL);
			} else if (o instanceof JsonObject || o instanceof Collection ||
					o.getClass().isArray() || o instanceof Map) {
				V8Object v = runtime.executeObjectScript("(" +
						createJsonBuilder().toJson(o).toString() + ")");
				newValues.add(v);
				result.push(v);
			} else if (o instanceof String) {
				result.push((String)o);
			} else if (o instanceof Integer) {
				result.push((Integer)o);
			} else if (o instanceof Boolean) {
				result.push((Boolean)o);
			} else if (o instanceof Double) {
				result.push((Double)o);
			} else if (o instanceof ItemDataProvider) {
				o = new ItemDataProviderWrapper((ItemDataProvider)o);
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof AbbreviationProvider) {
				o = new AbbreviationProviderWrapper((AbbreviationProvider)o);
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof VariableWrapper) {
				o = new VariableWrapperWrapper((VariableWrapper)o);
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof V8ScriptRunner || o instanceof LocaleProvider) {
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof V8Value) {
				//already converted
				V8Value v = (V8Value)o;
				result.push(v);
			} else {
				throw new IllegalArgumentException("Unsupported argument: " +
						o.getClass());
			}
		}
		return result;
	}
772273
function(context, descriptor, args) {
		var path = args[0],
			values = (typeof path === 'string') ? context.get(path) : path;
		if (values && values.length) {
			var template = args[1];
			for (var i = 0, len = values.length; i < len; ++i)
				template.toHTMLString(new Context(values[i], context), descriptor);
		} else if (args[2])
			args[2].toHTMLString(context, descriptor);
	}
557497
public Map<SkbShellArgument, Object> getArgMap(SkbShellArgument[] arguments){
		Map<SkbShellArgument, Object> ret = new LinkedHashMap<SkbShellArgument, Object>();
		if(arguments!=null){
			for(Entry<String, String> entry : this.getArgMap().entrySet()){
				for(SkbShellArgument ssa : arguments){
					if(ssa.getKey().equals(entry.getKey())){
						switch(ssa.getType()){
							case Boolean:
								ret.put(ssa, Boolean.valueOf(entry.getValue()));
								break;
							case Double:
								ret.put(ssa, Double.valueOf(entry.getValue()));
								break;
							case Integer:
								ret.put(ssa, Integer.valueOf(entry.getValue()));
								break;
							case String:
								ret.put(ssa, entry.getValue());
								break;
							case ListString:
								String[] ar = StringUtils.split(entry.getValue(), ';');
								if(ar!=null){
									List<String> val = new ArrayList<>();
									for(String s : ar){
										val.add(s);
									}
									ret.put(ssa, val);
								}
								break;
							case ListInteger:
								String[] arInt = StringUtils.split(entry.getValue(), ';');
								if(arInt!=null){
									List<Integer> valInt = new ArrayList<>();
									for(String s : arInt){
										valInt.add(Integer.valueOf(s));
									}
									ret.put(ssa, valInt);
								}
								break;
							default:
								System.err.println("parser.getArgMap --> argument type not yet supported: " + ssa.getType());//TODO do not use syserr prints
								break;
						}
					}
				}
			}
		}
		return ret;
	}
707793
function convertArgumentsToFromJSONG(args, remoteMessage, boundPath) {
    var newArgs = [];
    for (var i = 0, len = args.length; i < len; i++) {
        var argI = args[i];
        var paths;
        if (isJSONG(argI)) {
            paths = argI.paths;
        } else if (isPathOrPathValue(argI)) {
            paths = [argI.path || argI];
        } else {
            paths = collapse(argI);
        }
        newArgs[newArgs.length] = {
            jsong: remoteMessage.jsong,
            paths: paths,
            boundPath: boundPath && boundPath.length && boundPath || undefined
        };
    }
    

    return newArgs;
}
1237417
function argsObject(val) {
  return _.object(val.split('|').map(function(pair) {
    return pair.split(':').map(function(v) {
      return v.trim();
    });
  }));
}
498891
function (arguments) {
                var argData = ArgumentHelpers.prepareCallback(arguments);
                var callback = argData.callback;
                var args = argData.arguments;
                if (callback) {
                    args.pop();
                }
                return args;
            }
911595
function(args, defaults) {
        var args = args || {};

        if (typeof defaults == 'object') {
          for (var key in defaults) {
            if (elation.utils.isNull(args[key])) {
              args[key] = defaults[key];
            }
          }
        }
        
        return args;
      }
565743
function copyArgumentsArray(args) {
	var copy = [];
	var index = 0;
	for (var i in args) {
		copy[index] = args[i];
		index++;
	}
	return copy;
}
590586
function normalizeArgs (args) {
  var path, schema, options, callback;
  args = Array.prototype.slice.call(args);

  if (typeof args[args.length - 1] === "function") {
    // The last parameter is a callback function
    callback = args.pop();
  }

  if (typeof args[0] === "string") {
    // The first parameter is the path
    path = args[0];
    if (typeof args[2] === "object") {
      // The second parameter is the schema, and the third parameter is the options
      schema = args[1];
      options = args[2];
    }
    else {
      // The second parameter is the options
      schema = undefined;
      options = args[1];
    }
  }
  else {
    // The first parameter is the schema
    path = "";
    schema = args[0];
    options = args[1];
  }

  if (!(options instanceof Options)) {
    options = new Options(options);
  }

  return {
    path: path,
    schema: schema,
    options: options,
    callback: callback
  };
}