code: def file_is_in_folder_glob(filepath, folderpath_glob) -> bool:
      """Test whether a file is in some folder with globbing support.
  
      Parameters
      ----------
      filepath : str
          A file path.
      folderpath_glob: str
          A path to a folder that may include globbing.
  
      """
      # Make the glob always end with "/*" so we match files inside subfolders of
      # folderpath_glob.
      if not folderpath_glob.endswith("*"):
          if folderpath_glob.endswith("/"):
              folderpath_glob += "*"
          else:
              folderpath_glob += "/*"
  
      file_dir = os.path.dirname(filepath) + "/"
      return fnmatch.fnmatch(file_dir, folderpath_glob)
  
file_path: gradio/js/wasm/src/webworker/py/unload_modules.py
imports: import logging
  import fnmatch
  import os
  import sys
  import types
  from typing import Optional, Set
label_desc: Use image node_id 1 for calling a global function with example usage: file_is_in_folder_glob(filepath, folderpath_glob) and returns: fnmatch