'Returns a wrapper for the one-dimensional function that can handle
multidimensional arguments.'

def __call__(self, f):

    @wraps(f)
    def wrapper(*args, **kwargs):
        if self.mdargs:
            mdargs = self.mdargs
        else:
            mdargs = (range(len(args)) + kwargs.keys())
        arglength = len(args)
        for n in mdargs:
            if isinstance(n, int):
                if (n >= arglength):
                    continue
                entry = args[n]
                is_arg = True
            elif isinstance(n, str):
                try:
                    entry = kwargs[n]
                except KeyError:
                    continue
                is_arg = False
            if hasattr(entry, '__iter__'):
                if is_arg:
                    args = list(args)
                    args[n] = structure_copy(entry)
                else:
                    kwargs[n] = structure_copy(entry)
                result = apply_on_element(wrapper, args, kwargs, n)
                return result
        return f(*args, **kwargs)
    return wrapper
