code: def assert_prediction_with_generated_data(job, **kwargs):
      assert (
          job.status == ExecutionStatus.Success
      ), "job should be successful"
      expected_class = []
      trained_model = vw.Workspace(
          f"-i {job[0].model9('-f').path} --quiet"
      )
      predictions = []
      folder_path = os.path.dirname(os.path.realpath(__file__))
      subdirectories = [
          os.path.join(folder_path, name)
          for name in os.listdir(folder_path)
          if os.path.isdir(os.path.join(folder_path, name))
      ]
      for subdir in subdirectories:
          try:
              subdir_name = subdir.replace("\\", "/").split("/")[-1]
              data_func_obj = get_function_object(
                  f"{subdir_name}.data_generation",
                  kwargs["data_func"]["name"],
              )
              if data_func_obj:
                  break
          except:
              pass
      script_directory = os.path.dirname(os.path.realpath(__file__))
      dataFile = datagen_driver(
          os.path.join(script_directory, subdir_name),
          data_func_obj,
          **kwargs["data_func"]["params"],
      )
      with open(dataFile, "r") as f:
          for line in f.readlines():
              expected_class.append(line.split("|")[0].strip())
              predicted_class = trained_model.predict(line.strip())
              predictions.append(predicted_class)
      accuracy = sum(
          [
              1 if int(yp) == int(ye) else 0
              for yp, ye in zip(predictions, expected_class)
          ]
      ) / len(expected_class)
      assert (
          accuracy >= kwargs["accuracy_threshold"]
      ), f"Accuracy is {accuracy} and Threshold is {kwargs['accuracy_threshold']}"
  
file_path: vowpal_wabbit/python/tests/e2e_v2/assert_job.py
imports: import numpy
  import os
  from numpy.testing import assert_allclose, assert_almost_equal
  from vw_executor.vw import ExecutionStatus
  import vowpalwabbit
  from test_helper import get_function_object, datagen_driver
label_desc: Use image node_id 8 for calling a global function with example usage: assert_prediction_with_generated_data(job) without return types