code: def exclude_folders(folders: List[str]) -> Callable[[str], bool]:
      """
      Predicate for list_config_files allowing to list all files
      but the ones in specific list of invalid folders
      """
  
      def is_path_allowed(path: str) -> bool:
          if exclude_folders and any(x in path for x in folders):
              return False
          return True
  
      return is_path_allowed
  
file_path: vissl/tests/utils.py
imports: import logging
  import os
  import re
  import sys
  from typing import Any, Callable, List
  import pkg_resources
  from omegaconf import OmegaConf
  from vissl.utils.hydra_config import compose_hydra_configuration
label_desc: Use image node_id 2 for calling a global function with example usage: exclude_folders(folders) and returns: is_path_allowed, True, False