code: def load_generator(
      sample_generator: pathlib.Path,
  ) -> Callable[[], List[int]]:
      api_dir = str(sample_generator.parent)
  
      sys.path.append(api_dir)
      sample_generator_module = importlib.import_module(
          str(pathlib.Path(sample_generator).stem)
      )
      sys.path.pop()
  
      validate_module(sample_generator_module)
  
      return sample_generator_module.generate_sample
  
file_path: cortex/test/e2e/e2e/generator.py
imports: import importlib
  import pathlib
  from typing import Any, Callable, List
  import sys
  import inspect
  from e2e.exceptions import GeneratorValidationException
label_desc: Use image node_id 1 for calling a global function with example usage: load_generator(sample_generator) and returns: sample_generator_module