code: def listify(fn=None, wrapper=list):
      
      def listify_return(fn):
          @wraps(fn)
          def listify_helper(*args, **kw):
              return wrapper(fn(*args, **kw))
          return listify_helper
      if fn is None:
          return listify_return
      return listify_return(fn)
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)