code: def _scan_dirs(dirname) -> List[str]:
      """Scans a directory for subfolders
  
      Args:
          dirname: directory name
  
      Returns:
          List of subfolders
  
      """
  
      subfolders = [f.path for f in os.scandir(dirname) if f.is_dir()]
      for dirname in list(subfolders):
          subfolders.extend(_scan_dirs(dirname))
      subfolders = [x + "/" if x[-1] != "/" else x for x in subfolders]
      return subfolders
  
imports: import os
  from abc import abstractmethod
  from dataclasses import dataclass
  from typing import Any, Callable, List, Optional, Sequence, Set, Tuple, Union
  from llm_studio.src.nesting import Dependency
label_desc: Use image node_id 1 for calling a global function with example usage: _scan_dirs(dirname) and returns: subfolders