docs: def _wait_for_save(nb_name, timeout=5):
      """Waits for nb_name to update, waiting up to TIMEOUT seconds.
      Returns True if a save was detected, and False otherwise.
      """
      modification_time = os.path.getmtime(nb_name)
      start_time = time.time()
      while time.time() < start_time + timeout:
          if (
              os.path.getmtime(nb_name) > modification_time
              and os.path.getsize(nb_name) > 0
          ):
              return True
          time.sleep(0.2)
      return False