utils/decorators.py
def seeded(pos):
    """
    Decorator:
    Looks for the positional pos(int) or keyword name(str) argument and if
    the argument is a list calls the function once for each item

    This changes the function to always return void
    """
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            valid = lambda val: (
                val if isinstance(val, Seed)
                else (
                    Seed(val) if isinstance(val, int)
                    else Seed()
                )
            )
            if len(args) > pos:
                args = list(args)
                args[pos] = valid(args[pos])
            elif 'seed' in kwargs:
                kwargs['seed'] = valid(kwargs['seed'])
            else:
                kwargs['seed'] = Seed()
            return func(*args, **kwargs)
        return wrapper
    return decorator

    Decorator:
    Looks for the positional pos(int) or keyword name(str) argument and if
    the argument is a list calls the function once for each item

    This changes the function to always return void
    
Looks for the positional pos(int) or keyword name(str) argument and if
the argument is a list calls the function once for each item

This changes the function to always return void
Looks for the positional pos ( int ) or keyword name ( str ) argument and if the argument is a list calls the function once for each item This changes the function to always return void
def seeded(pos):
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            valid = lambda val: (
                val if isinstance(val, Seed)
                else (
                    Seed(val) if isinstance(val, int)
                    else Seed()
                )
            )
            if len(args) > pos:
                args = list(args)
                args[pos] = valid(args[pos])
            elif 'seed' in kwargs:
                kwargs['seed'] = valid(kwargs['seed'])
            else:
                kwargs['seed'] = Seed()
            return func(*args, **kwargs)
        return wrapper
    return decorator
def seeded ( pos ) : def decorator ( func ) : @ wraps ( func ) def wrapper ( * args , ** kwargs ) : valid = lambda val : ( val if isinstance ( val , Seed ) else ( Seed ( val ) if isinstance ( val , int ) else Seed ( ) ) ) if len ( args ) > pos : args = list ( args ) args [ pos ] = valid ( args [ pos ] ) elif 'seed' in kwargs : kwargs [ 'seed' ] = valid ( kwargs [ 'seed' ] ) else : kwargs [ 'seed' ] = Seed ( ) return func ( * args , ** kwargs ) return wrapper return decorator
Decorator:
Looks for the positional pos(int) or keyword name(str) argument and if
the argument is a list calls the function once for each item
Decorator : Looks for the positional pos ( int ) or keyword name ( str ) argument and if the argument is a list calls the function once for each item
"""
    Decorator:
    Looks for the positional pos(int) or keyword name(str) argument and if
    the argument is a list calls the function once for each item

    This changes the function to always return void
    """
pos