def _applymanyargs(args, f):
    """Apply arguments to a function.

    Args can be any of the following.
    arg
    (arg1, arg2, ...)
    ((arg1a, arg1b, ...), ...)
    """
    if not hasattr(args, '__iter__'):
        f(args)
        return
    for arg in args:
        if hasattr(arg, '__iter__'):
            f(*arg)
        else:
            f(arg)
    return
