code: def timer(message):
      "Context manager for timing snippets of code."
      tick = time.time()
      yield
      tock = time.time()
      print("%s: %.3f seconds" % (message, (tock - tick))f timer(message):
      "Context manager for timing snippets of code."
      tick = time.time()
      yield
      tock = time.time()
      print("%s: %.3f seconds" % (message, (tock - tick)))
docs: Context manager for timing snippets of code.