code: def test_progressbar():
      """Test functionality for the progress bar."""
      ProgressBar().execute(progress_generator(4))
      ProgressBar("With file_mode", file_mode=True).execute(
          progress_generator(4)
      )
      ProgressBar(
          widgets=[
              PBWString(
                  "Clowncopterization in progress, stand WAY back!"
              ),
              PBWBar(),
              PBWPercentage(),
          ]
      ).execute(progress_generator(3))
  
      g = progress_fast()
      ProgressBar().execute(g)
      curr_progress = next(g)[0]
      assert curr_progress == 1, (
          "Progress bar finished but the progress is %f" % curr_progress
      )
  
      ProgressBar("Super-fast").execute(super_fast())
      ProgressBar("Super-duper-fast").execute(super_fast(0.3))
      ProgressBar("Super-duper-mega-fast").execute(super_fast(0.9))
      ProgressBar("Lightning").execute(lambda: 1)
      ProgressBar("Not so fast...").execute(not_so_fast())
  
      ProgressBar("Random 1s").execute(random_progress_generator(1))
      ProgressBar("Random 5s").execute(random_progress_generator(5))
      ProgressBar("Random 10s").execute(random_progress_generator(10))
      ProgressBar("Hope this one works").execute(
          random_progress_generator(5, True)
      )
  
      gen = pybooklet_progress()
      ProgressBar("Pybooklet progress").execute(gen)
      assert next(gen) == 1
  
imports: from io import StringIO
  import math
  import random
  import time
  from h2o.utils.progressbar import ProgressBar, ProgressBarWidget, PBWBar, PBWPercentage, PBWString, RenderResult
label_desc: Use image node_id 7 for calling a global function with example usage: test_progressbar() without return types