(func)
return wrapper
Convert LazyLoader class to numpy array if required.
Convert LazyLoader class to numpy array if required.
Convert LazyLoader class to numpy array if required .
def process_numpy_array(func):
    """Convert LazyLoader class to numpy array if required."""
    @wraps(func)
    def wrapper(*args, **kwargs):
        try:
            array = kwargs.pop('array')
        except KeyError:
            array = args[0]
            args = args[1:]
        if isinstance(array, LazyLoader):
            array = array.array
        return func(array, *args, **kwargs)
    return wrapper
def process_numpy_array ( func ) : @ wraps ( func ) def wrapper ( * args , * * kwargs ) : try : array = kwargs . pop ( 'array' ) except KeyError : array = args [ 0 ] args = args [ 1 : ] if isinstance ( array , LazyLoader ) : array = array . array return func ( array , * args , * * kwargs ) return wrapper