code: def list_config_files(
      dir_path: str,
      is_valid_file: Callable[[str], bool] = lambda x: True,
  ):
      """
      Recursively list all YAML files under the folder "configs / dir_path"
      excluding all paths in which one of the terms in "exclude_folders" appear
      """
      resource_name = "configs"
      assert pkg_resources.resource_isdir(resource_name, dir_path)
      all_items = pkg_resources.resource_listdir(
          resource_name, dir_path
      )
      config_files = []
  
      for item in all_items:
          subpath = f"{dir_path}/{item}"
          if pkg_resources.resource_isdir(resource_name, subpath):
              config_files.extend(
                  list_config_files(subpath, is_valid_file)
              )
          elif subpath.endswith(".yaml") and is_valid_file(subpath):
              config_files.append(subpath)
      return config_files
  
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 1 for calling a global function with example usage: list_config_files(dir_path, is_valid_file) and returns: config_files