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