code: def example(fn):
      '''Wrap the examples so they generate readable output'''
  
      @functools.wraps(fn)
      def wrapped():
          try:
              sys.stdout.write('Running: %s\n' % fn.__name__)
              fn()
              sys.stdout.write('\n')
          except KeyboardInterrupt:
              sys.stdout.write('\nSkipping example.\n\n')
              # Sleep a bit to make killing the script easier
              time.sleep(0.2)
  
      examples.append(wrapped)
      return wrappef example(fn):
      '''Wrap the examples so they generate readable output'''
  
      @functools.wraps(fn)
      def wrapped():
          try:
              sys.stdout.write('Running: %s\n' % fn.__name__)
              fn()
              sys.stdout.write('\n')
          except KeyboardInterrupt:
              sys.stdout.write('\nSkipping example.\n\n')
              # Sleep a bit to make killing the script easier
              time.sleep(0.2)
  
      examples.append(wrapped)
      return wrapped
docs: Wrap the examples so they generate readable output