Turns an argument list obtained from AstUtil.getArguments() into an Object[] array
suitable to be passed to InvokerHelper or SpockRuntime. The main challenge is
to handle SpreadExpression's correctly.
171591
public static Expression toArgumentArray(List<Expression> argList, IRewriteResources resources) {
    List<Expression> normalArgs = new ArrayList<>();
    List<Expression> spreadArgs = new ArrayList<>();
    List<Expression> spreadPositions = new ArrayList<>();

    for (int i = 0; i < argList.size(); i++) {
      Expression arg = argList.get(i);
      if (arg instanceof SpreadExpression) {
        spreadArgs.add(((SpreadExpression) arg).getExpression());
        spreadPositions.add(new ConstantExpression(i));
      } else {
        normalArgs.add(arg);
      }
    }

    if (spreadArgs.isEmpty())
      return new ArrayExpression(ClassHelper.OBJECT_TYPE, argList);

    return new MethodCallExpression(
        new ClassExpression(resources.getAstNodeCache().SpockRuntime),
        new ConstantExpression(SpockRuntime.DESPREAD_LIST),
        new ArgumentListExpression(
            new ArrayExpression(ClassHelper.OBJECT_TYPE, normalArgs),
            new ArrayExpression(ClassHelper.OBJECT_TYPE, spreadArgs),
            new ArrayExpression(ClassHelper.int_TYPE, spreadPositions)
        ));
  }
298040
public static List<String> getArgumentNames(MethodCallExpression methodCall) {
        ArrayList<String> result = new ArrayList<String>();

        Expression arguments = methodCall.getArguments();
        List<Expression> argExpressions = null;
        if (arguments instanceof ArrayExpression) {
            argExpressions = ((ArrayExpression) arguments).getExpressions();
        } else if (arguments instanceof ListExpression) {
            argExpressions = ((ListExpression) arguments).getExpressions();
        } else if (arguments instanceof TupleExpression) {
            argExpressions = ((TupleExpression) arguments).getExpressions();
        } else {
            LOG.warn("getArgumentNames arguments is not an expected type");
        }

        if (argExpressions != null) {
            for (Expression exp : argExpressions) {
                if (exp instanceof VariableExpression) {
                    result.add(((VariableExpression) exp).getName());
                }
            }
        }
        return result;
    }
28902
function from(arg){
		if(!_.isArray(arg) && !_.isArguments(arg))
			arg = [arg];
		
		return _.toArray(arg);
	}
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;
	}
1362131
def parse_analyzer_arguments(arguments):
    

    rets = []

    for argument in arguments:
        args = argument.split(argument_splitter)

        # The first one is the function name
        func_name = args[0]

        # The rest is the args
        func_args = {}

        for arg in args[1:]:
            key, value = parse_arg(arg)

            func_args[key] = value

        rets.append(FunctionArguments(function=func_name, arguments=func_args))

    return rets
214646
public Object[] getArgs() {
		Object[] values = new Object[list.size()];
		for (int i = 0; i < values.length; i++) {
			values[i] = this.getArg(i);
		}
		return values;
	}
226354
List<String> getArgumentsType(ExecutableElement methodElement) {
		ExecutableType methodType = (ExecutableType) methodElement.asType();
		List<String> res = new ArrayList<>();
		for (TypeMirror argumentType : methodType.getParameterTypes()) {
			res.add(argumentType.toString());
		}
		return res;
	}
970012
protected Object[] getArguments(IQueryContext context) {
        List<Object> args = new ArrayList<>();
        createArgumentList(args, context);
        return args.toArray();
    }
161811
public static InputMapping<?>[] createArrayMapping( Object[] arguments ){
        if( arguments == null || arguments.length == 0 ){
            return null;
        }
        List<InputMapping<?>> list = new ArrayList<>();
        for( Object argument : arguments ){
            list.add( createInputMapping( argument ) );
        }
        return list.toArray( new InputMapping<?>[arguments.length] );

    }
1056735
public static Type[] getActualTypeArguments(Class<?> clazz) {
        Type type = Types.getCanonicalType(clazz);
        if (type instanceof ParameterizedType) {
            return ((ParameterizedType) type).getActualTypeArguments();
        } else {
            return EMPTY_TYPES;
        }
    }
627421
List<String> argDecls(List<String> types, List<String> args) {
        List<String> argNames = new ArrayList<>();
        for (int i = 0 ; i < types.size() ; i++) {
            argNames.add(types.get(i) + " " + args.get(i));
        }
        return argNames;
    }
1163402
public static Array toArray(Argument arg) {
	ArrayImpl trg = new ArrayImpl();
	int[] keys = arg.intKeys();
	for (int i = 0; i < keys.length; i++) {
	    trg.setEL(keys[i], arg.get(keys[i], null));
	}
	return trg;
    }
376377
def _get_args(self, kwargs):
        '''
        
        '''
        _args = list()
        _kwargs = salt.utils.args.clean_kwargs(**kwargs)

        return _args, _kwargs
684441
@SuppressWarnings(
	{ "unchecked" })
	public static <T> List<T> toList(T...args)
	{
		if(args == null || args.length ==0)
			return null;
		
		ArrayList<T> list = new ArrayList<>(args.length);
		for (T t : args)
		{
			list.add(t);
		}
		
		return list;
	}
368382
def _parse_field_arguments(arg, faces, edges, coords):
    ''''''
    if not hasattr(arg, '__iter__'):
        raise RuntimeError('field argument must be a list-like collection of instructions')
    pot = [_parse_field_argument(instruct, faces, edges, coords) for instruct in arg]
    # make a new Potential sum unless the length is 1
    if len(pot) <= 1:
        return pot[0]
    else:
        sp = java_link().jvm.nben.mesh.registration.Fields.newSum()
        for field in pot: sp.addField(field)
        return sp
340196
def format_args(self):
        
        result = []
        if self.args:
            result.append(
                _format_args(
                    self.args, self.defaults, getattr(self, "annotations", None)
                )
            )
        if self.vararg:
            result.append("*%s" % self.vararg)
        if self.kwonlyargs:
            if not self.vararg:
                result.append("*")
            result.append(
                _format_args(
                    self.kwonlyargs, self.kw_defaults, self.kwonlyargs_annotations
                )
            )
        if self.kwarg:
            result.append("**%s" % self.kwarg)
        return ", ".join(result)
883645
function getArgs(userArgs, defaultArgs, userCallback) {
  let args = { };
  let callback = userCallback || function() { };
  defaultArgs.unshift(args);
  _.assign.apply(null, defaultArgs);

  if (_.isPlainObject(userArgs)) {
    _.merge(args, userArgs);
  } else {
    callback = userArgs;
  }

  return {
    options: args,
    callback,
  };
}