code: def get_function_obj_with_dirs(dirs, module_name, function_name):
      obj = None
      for dir in dirs:
          try:
              obj = get_function_object(
                  dir + module_name,
                  function_name,
              )
              if obj:
                  return obj
          except Exception as error:
              if type(error) not in [ModuleNotFoundError]:
                  raise error
      if not obj:
          raise ModuleNotFoundError(
              f"Module '{module_name}' not found in any of the directories {dirs}."
          )
  
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 8 for calling a global function with example usage: get_function_obj_with_dirs(dirs, module_name, function_name) and returns: obj