code: def helper_getting_started_example(which_cb):
      train_df, test_df = helper_get_data()
  
      vw = vowpalwabbit.Workspace(
          which_cb + " 4 --log_level off --cb_type mtr",
          enable_logging=True,
      )
  
      for i in train_df.index:
          action = train_df.loc[i, "action"]
          cost = train_df.loc[i, "cost"]
          probability = train_df.loc[i, "probability"]
          feature1 = train_df.loc[i, "feature1"]
          feature2 = train_df.loc[i, "feature2"]
          feature3 = train_df.loc[i, "feature3"]
  
          learn_example = (
              str(action)
              + ":"
              + str(cost)
              + ":"
              + str(probability)
              + " | "
              + str(feature1)
              + " "
              + str(feature2)
              + " "
              + str(feature3)
          )
          vw.learn(learn_example)
  
      assert (
          vw.get_prediction_type() == vw.pMULTICLASS
      ), "prediction_type should be multiclass"
  
      for j in test_df.index:
          feature1 = test_df.loc[j, "feature1"]
          feature2 = test_df.loc[j, "feature2"]
          feature3 = test_df.loc[j, "feature3"]
          choice = vw.predict(
              "| "
              + str(feature1)
              + " "
              + str(feature2)
              + " "
              + str(feature3)
          )
          assert isinstance(choice, int), "choice should be int"
          assert (
              choice == 3
          ), "predicted action should be 3 instead of " + str(choice)
  
      # test that metrics is empty since "--extra_metrics filename" was not supplied
      assert len(vw.get_learner_metrics()) == 0
  
      vw.finish()
  
      output = vw.get_log()
  
      if which_cb.find("legacy") != -1:
          test_file = "test-sets/ref/python_test_cb_legacy.stderr"
      else:
          test_file = "test-sets/ref/python_test_cb.stderr"
  
      print("Output received:")
      print("----------------")
      print("\n".join(output))
      print("----------------")
  
      with open(
          path.join(helper_get_test_dir(), test_file), "r"
      ) as file:
          expected = file.readlines()
          for expected_line, output_line in zip(expected, output):
              output_line = output_line.replace("...", "").strip()
              expected_line = expected_line.replace("...", "").strip()
              assert not is_line_different(
                  output_line, expected_line, 0.001
              )
  
file_path: vowpal_wabbit/python/tests/test_cb.py
imports: import pandas
  from os import path
  import vowpalwabbit
  import unittest
  import platform
  import math
  import re
label_desc: Use image node_id 8 for calling a global function with example usage: helper_getting_started_example(which_cb) without return types