docs: def __ensure_directory_in_path(filename: Path) -> None:
      """Ensures that a file's directory is in the Python path.
      """
      directory = Path(filename).parent.resolve()
      if directory not in sys.path:
          logger.debug(f"Adding {directory} to sys.path")
          sys.path.insert(0, str(directory))