code: def profile(func, stream=None):
      
      def wrapper(*args, **kwargs):
          prof = LineProfiler()
          val = prof(func)(*args, **kwargs)
          show_results(prof, stream=stream)
          return val
      return wrapper
docs: Decorator that will run the function and print a line-by-line profile