code: def datagen_driver(script_directory, impl, **kwargs):
      names = []
      for i in kwargs.values():
          if type(i) == dict:
              names.append(list(i.items())[0][1])
          elif type(i) == list:
              pass
          else:
              names.append(i)
  
      dataFile = f"{str(impl.__name__)}_{'_'.join([str(i) for i in names])}.txt"
      with open(os.path.join(script_directory, dataFile), "w") as f:
          impl(f, **kwargs)
      return os.path.join(script_directory, dataFile)
  
file_path: vowpal_wabbit/python/tests/e2e_v2/test_helper.py
imports: import json
  import importlib
  import os
  import itertools
  import inspect
  import shutil
label_desc: Use image node_id 9 for calling a global function with example usage: datagen_driver(script_directory, impl) and returns: os