code: def listify(func=None, wrapper=list):
      
  
      def _listify_return(func):
          @functools.wraps(func)
          def _listify_helper(*args, **kw):
              return wrapper(func(*args, **kw))
  
          return _listify_helper
  
      if func is None:
          return _listify_return
      return _listify_return(func)
docs: A decorator which wraps a function's return value in ``list(...)``.
      Useful when an algorithm can be expressed more cleanly as a generator but
      the function should return an list.
      Example::
          >>> @listify
          ... def get_lengths(iterable):
          ...     for i in iterable:
          ...         yield len(i)
          >>> get_lengths(["spam", "eggs"])
          [4, 4]
          >>>
          >>> @listify(wrapper=tuple)
          ... def get_lengths_tuple(iterable):
          ...     for i in iterable:
          ...         yield len(i)
          >>> get_lengths_tuple(["foo", "bar"])
          (3, 3)