code: def get_all_folders(models, exclude) -> dict:
      folders = dict()
      if isinstance(models, str):
          model_list = models.split(",")
          models = [m.lower().strip("[ ]") for m in model_list]
      elif isinstance(models, list):
          models = [m.lower() for m in models]
      elif models is None:
          models = [f.name.lower() for f in os.scandir("benchmarks")]
      else:
          raise ValueError(
              "Input models type is not supported. Please provide str or list without space."
          )
      for f in os.scandir("benchmarks"):
          add = xor(bool(f.name.lower() in models), bool(exclude))
          if add:
              path = Path("benchmarks") / f.name
              folders[f.name] = str(path.resolve())
      return folders
  
imports: import os
  import sys
  import fire
  import time
  import glob
  import yaml
  import shutil
  import signal
  import inspect
  import tempfile
  import functools
  import statistics
  import subprocess
  from datetime import datetime
  from pathlib import Path
  from operator import xor
  from pprint import pprint
  import qlib
  from qlib.workflow import R
  from qlib.tests.data import GetData
label_desc: Use image node_id 6 for calling a global function with example usage: get_all_folders(models, exclude) and returns: folders