(func)
return wrapper
Convert list of LazyLoader classes to numpy arrays if required.
Convert list of LazyLoader classes to numpy arrays if required.
Convert list of LazyLoader classes to numpy arrays if required .
def process_numpy_arrays(func):
    """Convert list of LazyLoader classes to numpy arrays if required."""
    @wraps(func)
    def wrapper(*args, **kwargs):
        try:
            arrays = kwargs.pop('arrays')
        except KeyError:
            arrays = args[0]
            args = args[1:]
        arrays = [array.array if isinstance(array, LazyLoader) else array for array in arrays]
        return func(arrays, *args, **kwargs)
    return wrapper
def process_numpy_arrays ( func ) : @ wraps ( func ) def wrapper ( * args , * * kwargs ) : try : arrays = kwargs . pop ( 'arrays' ) except KeyError : arrays = args [ 0 ] args = args [ 1 : ] arrays = [ array . array if isinstance ( array , LazyLoader ) else array for array in arrays ] return func ( arrays , * args , * * kwargs ) return wrapper