code: def load_modules_in_path(path, filter_function=None):
      """
      Load all modules inside `path` and return a list of those
      fitting the filter function.
      """
      this_module = __import__(path, fromlist=[""])
      file_path = this_module.__path__[0]
  
      files = list(
          map(
              lambda f: f.split(".")[0],
              filter(
                  lambda f2: f2.endswith("py"), os.listdir(file_path)
              ),
          )
      )
  
      modules = map(
          lambda f: __import__(path + "." + f, fromlist=[""]), files
      )
  
      if filter_function is not None:
          modules = filter(filter_function, modules)
  
      return list(modules)
  
file_path: orion/src/orion/core/utils/module_import.py
imports: from __future__ import annotations
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: load_modules_in_path(path, filter_function) and returns: list