Explode a list of argument values for invoking the specified method with all combinations of
its parameters.
514857
public static Enum<?>[][] explodeArguments(Method method) {
    checkNotNull(method, "method");

    return explodeParameters(method.getParameterTypes(),
        method.getDeclaringClass().getName() + '.' + method.getName() + " method");
  }
1260810
function explode(obj) {
		var arg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ",";

		return obj.replace(/^(\s+|\t+)|(\s+|\t+)$/g, "").split(new RegExp("\\s*" + arg + "\\s*"));
	}
800604
protected function prepareArguments($reflection_parameter, $arguments) {
		$array_type = $this->getArrayType($arguments);
		$prepared = array();

		if ($array_type == self::ARRAY_TYPE_LIST) {
			$prepared = $arguments;
		} elseif ($array_type == self::ARRAY_TYPE_DICT) {
			foreach ($reflection_parameter as $parameter) {
				$name = $parameter->getName();

				if (isset($arguments[$name])) {
					$value = $arguments[$name];
				} else if ($parameter->isDefaultValueAvailable()) {
					$value = $parameter->getDefaultValue();
				} else {
					throw new InvalidParameterException("Missing parameter '$name' on position {$parameter->getPosition()}");
				}

				$prepared[] = $value;
			}
		} else {
			throw new InvalidParameterException('Unable to handle mixed arrays');
		}

		return $prepared;
	}
783851
def split_func_name_args_params_handle(tokens):
    """"""
    internal_assert(len(tokens) == 2, "invalid function definition splitting tokens", tokens)
    func_name = tokens[0]
    func_args = []
    func_params = []
    for arg in tokens[1]:
        if len(arg) > 1 and arg[0] in ("*", "**"):
            func_args.append(arg[1])
        elif arg[0] != "*":
            func_args.append(arg[0])
        func_params.append("".join(arg))
    return [
        func_name,
        ", ".join(func_args),
        "(" + ", ".join(func_params) + ")",
    ]
69813
private function explodeCallable(callable $method)
    {
        if (is_array($method)) {
            return $method;
        }

        if (is_string($method)) {
            return explode('::', $method);
        }

        return [$method];
    }
143549
def splitarg(args):
    '''
    
    '''
    if not args:
        return args
    split = list()
    for arg in args:
        if ',' in arg:
            split.extend([x for x in arg.split(',') if x])
        elif arg:
            split.append(arg)
    return split
1153958
function invoke(array, method) {
    var args = slice.call(arguments, 2), result = [ ];
    for (var i = 0, len = array.length; i < len; i++) {
      result[i] = args.length ? array[i][method].apply(array[i], args) : array[i][method].call(array[i]);
    }
    return result;
  }
317328
protected Object invoke(Method method, Object[] arguments)
	throws InvocationTargetException, IllegalAccessException {
		logger.trace("Lookup for call {}", method);
		Object bean = spring.getBean(beanType);

		try {
			return method.invoke(bean, arguments);
		} catch (IllegalArgumentException e) {
			StringBuilder msg = new StringBuilder(method.toGenericString());
			msg.append(" invoked with incompatible arguments:");
			for (Object a : arguments) {
				msg.append(' ');
				if (a == null)
					msg.append("null");
				else
					msg.append(a.getClass().getName());
			}
			logger.error(msg.toString());
			throw e;
		}
	}
1369234
public static <T> T invokeMethodByName(final Object target, final String name, final Object[] parameterValues) {
		Method method = getAccessibleMethodByName(target, name);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + name + "] on target [" + target + ']');
		}

		try {
			return (T) method.invoke(target, parameterValues);
		} catch (ReflectiveOperationException e) {
			throw new ReflectionRuntimeException(e);
		}
	}
692448
def pack_args(self, obj, *args, **kwargs):
        
        signature = self.__signature__
        #: No arguments expected
        if not signature:
            return (self.name, [])

        #: Build args, first is a string, subsequent are dictionaries
        method_name = [self.name]
        bridge_args = []
        for i, sig in enumerate(signature):
            if i == 0:
                method_name.append(":")
                bridge_args.append(msgpack_encoder(sig, args[0]))
                continue

            #: Sig is a dict so we must pull out the matching kwarg
            found = False
            for k in sig:
                if k in kwargs:
                    method_name.append("{}:".format(k))
                    bridge_args.append(msgpack_encoder(sig[k], kwargs[k]))
                    found = True
                    break
            if not found:
                #: If we get here something is wrong
                raise ValueError("Unexpected or missing argument at index {}. "
                                 "Expected {}".format(i, sig))

        return ("".join(method_name), bridge_args)
130110
def _format_arg_list(args, variadic=False):
    
    def sugar(s):
        """Shorten strings that are too long for decency."""
        s = s.replace("{", "{{").replace("}", "}}")
        if len(s) > 50:
            return s[:20] + " ... " + s[-20:]
        else:
            return s

    def arg_to_str(arg):
        """Convert argument to a string."""
        if isinstance(arg, str):
            return sugar(repr(arg))
        elif arg is Parameter.empty:
            return '\u2014'
        else:
            return sugar(str(arg))

    if not args:
        if variadic:
            return "(\u2026)"
        else:
            return "()"

    return "(" + ", ".join(map(arg_to_str, args)) + ")"
867642
protected final void parse(List<String> args) {
    Pattern eqSeparatedOpt = Pattern.compile("(--[^=]+)=(.+)");

    int idx = 0;
    for (idx = 0; idx < args.size(); idx++) {
      String arg = args.get(idx);
      String value = null;

      Matcher m = eqSeparatedOpt.matcher(arg);
      if (m.matches()) {
        arg = m.group(1);
        value = m.group(2);
      }

      // Look for options with a value.
      String name = findCliOption(arg, opts);
      if (name != null) {
        if (value == null) {
          if (idx == args.size() - 1) {
            throw new IllegalArgumentException(
                String.format("Missing argument for option '%s'.", arg));
          }
          idx++;
          value = args.get(idx);
        }
        if (!handle(name, value)) {
          break;
        }
        continue;
      }

      // Look for a switch.
      name = findCliOption(arg, switches);
      if (name != null) {
        if (!handle(name, null)) {
          break;
        }
        continue;
      }

      if (!handleUnknown(arg)) {
        break;
      }
    }

    if (idx < args.size()) {
      idx++;
    }
    handleExtraArgs(args.subList(idx, args.size()));
  }
521976
def _namify_arguments(mapping):
    
    result = []
    for name, parameter in mapping.iteritems():
        parameter.name = name
        result.append(parameter)
    return result
1321585
@Override
	public Object invokeMethod(Object... args) {
		Assert.state(this.parameterTypes.length == args.length,
				"Wrong number of arguments, expected no more than: ["
						+ this.parameterTypes.length + "]");

		try {
			// Extract the target from an Advised as late as possible
			// in case it contains a lazy initialization
			Object target = extractTarget(this.object, this.method);
			return method.invoke(target, args);
		}
		catch (Exception e) {
			throw new IllegalArgumentException("Unable to invoke method: [" + this.method
					+ "] on object: [" + this.object + "] with arguments: ["
					+ Arrays.toString(args) + "]", e);
		}
	}
1021664
@SuppressWarnings("unchecked")
    public static <E> List<E> invoke(final Iterable<E> iterable, final String methodName,
                                  final List<Object> args) {
        final List<E> result = newArrayList();
        final List<Class<?>> argTypes = map(args, new Function<Object, Class<?>>() {
            public Class<?> apply(Object input) {
                return input.getClass();
            }
        });
        try {
            final Method method = iterable.iterator().next().getClass().getMethod(methodName, argTypes.toArray(
                new Class[argTypes.size()]));
            for (E arg : iterable) {
                try {
                    result.add((E) method.invoke(arg, args.toArray(new Object[args.size()])));
                } catch (Exception e) {
                    throw new IllegalArgumentException(e);
                }
            }
        } catch (NoSuchMethodException e) {
            throw new IllegalArgumentException(e);
        }
        return result;
    }
844293
def split_kwargs_by_func(kwargs, func):
    ""
    args = func_args(func)
    func_kwargs = {a:kwargs.pop(a) for a in args if a in kwargs}
    return func_kwargs, kwargs
914265
def arg_strings(parsed_args, name=None):
    """"""
    name = name or 'arg_strings'
    value = getattr(parsed_args, name, [])
    if isinstance(value, str):
        return [value]
    try:
        return [v for v in value if isinstance(v, str)]
    except TypeError:
        return []