code: def flexible_init(
      cls: Type[Executor], folder: Union[str, Path], **kwargs: Any
  ) -> Executor:
      prefix = cls.name() + "_"
      return cls(
          folder,
          **{
              k[len(prefix) :]: val
              for k, val in kwargs.items()
              if k.startswith(prefix)
          },
      )
  
file_path: submitit/submitit/auto/auto.py
imports: import typing
  import warnings
  from pathlib import Path
  from typing import Any, List, Optional, Type, Union
  from ..core import plugins
  from ..core.core import Executor, Job
  from ..core.utils import DelayedSubmission
label_desc: Use image node_id 2 for calling a global function with example usage: flexible_init(cls, folder) and returns: cls