def generator_to_list ( fn ) : def wrapper ( * args , * * kw ) : return list ( fn ( * args , * * kw ) ) return wrapper
python def funciton that return list
This decorator is for flat_list function . It converts returned generator to list .
def generator_to_list(fn):
    """This decorator is for flat_list function.
    It converts returned generator to list.
    """
    def wrapper(*args, **kw):
        return list(fn(*args, **kw))
    return wrapper