code: def _is_valid_path(path: Optional[str]) -> bool:
      return isinstance(path, str) and (
          os.path.isfile(path) or os.path.isdir(path)
      )
  
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 5 for calling a global function with example usage: _is_valid_path(path) and returns: unknown