deepaugment/lib/decorators.py
def multi_element_argument(func):
    """Decorator allows the function it decorates to work with multiple element first argument.
        
    If the first argument is a multi element type (such as list, tuple, set, or
    np.array), decorated function works multiple times for each, and its returnings
    are finally returned as a list.
    
    If the first argument is a single element type, decorated function works as usual.
    """

    @wraps(func)
    def wrapper(*args, **kwargs):
        ex = [1, 2, 3]
        multi_element_types = [list, tuple, set, type(np.array(ex))]
        args_copy = list(args)
        first_arg = args_copy[0]
        if type(first_arg) in multi_element_types:
            first_arg = list(first_arg)
            result = []
            for i, val in enumerate(first_arg):
                new_args = [val] + args_copy[1:]
                result.append(func(*new_args, **kwargs))
        else:
            result = func(*args, **kwargs)
        return result

    return wrapper
Decorator allows the function it decorates to work with multiple element first argument.
        
    If the first argument is a multi element type (such as list, tuple, set, or
    np.array), decorated function works multiple times for each, and its returnings
    are finally returned as a list.
    
    If the first argument is a single element type, decorated function works as usual.
    
Decorator allows the function it decorates to work with multiple element first argument.
If the first argument is a multi element type (such as list, tuple, set, or
np.array), decorated function works multiple times for each, and its returnings
are finally returned as a list.

If the first argument is a single element type, decorated function works as usual.
Decorator allows the function it decorates to work with multiple element first argument . If the first argument is a multi element type ( such as list tuple set or np . array ) decorated function works multiple times for each and its returnings are finally returned as a list . If the first argument is a single element type decorated function works as usual .
def multi_element_argument(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        ex = [1, 2, 3]
        multi_element_types = [list, tuple, set, type(np.array(ex))]
        args_copy = list(args)
        first_arg = args_copy[0]
        if type(first_arg) in multi_element_types:
            first_arg = list(first_arg)
            result = []
            for i, val in enumerate(first_arg):
                new_args = [val] + args_copy[1:]
                result.append(func(*new_args, **kwargs))
        else:
            result = func(*args, **kwargs)
        return result
    return wrapper
def multi_element_argument ( func ) : @ wraps ( func ) def wrapper ( * args , ** kwargs ) : ex = [ 1 , 2 , 3 ] multi_element_types = [ list , tuple , set , type ( np . array ( ex ) ) ] args_copy = list ( args ) first_arg = args_copy [ 0 ] if type ( first_arg ) in multi_element_types : first_arg = list ( first_arg ) result = [ ] for i , val in enumerate ( first_arg ) : new_args = [ val ] + args_copy [ 1 : ] result . append ( func ( * new_args , ** kwargs ) ) else : result = func ( * args , ** kwargs ) return result return wrapper
Decorator allows the function it decorates to work with multiple element first argument.
Decorator allows the function it decorates to work with multiple element first argument .
"""Decorator allows the function it decorates to work with multiple element first argument.
        
    If the first argument is a multi element type (such as list, tuple, set, or
    np.array), decorated function works multiple times for each, and its returnings
    are finally returned as a list.
    
    If the first argument is a single element type, decorated function works as usual.
    """
func