code: def subdirs(
      folder: str,
      join: bool = True,
      prefix: str = None,
      suffix: str = None,
      sort: bool = True,
  ) -> List[str]:
      if join:
          l = join_paths
      else:
          l = lambda x, y: y
      res = [
          l(folder, i)
          for i in os.listdir(folder)
          if os.path.isdir(join_paths(folder, i))
          and (prefix is None or i.startswith(prefix))
          and (suffix is None or i.endswith(suffix))
      ]
      if sort:
          res.sort()
      return res
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/preprocess_utils/file_and_folder_operations.py
imports: import os
  import pickle
  import json
  from typing import List
  from .path_utils import join_paths
label_desc: Use image node_id 1 for calling a global function with example usage: subdirs(folder, join, prefix, suffix, sort) and returns: res