code: def make_tree(cls, root, parent=None, is_last=False, criteria=None):
      root = Path(str(root))
      criteria = criteria or cls._default_criteria
  
      displayable_root = cls(root, parent, is_last)
      yield displayable_root
  
      children = sorted(
          list(path for path in root.iterdir() if criteria(path)),
          key=lambda s: str(s).lower(),
      )
      count = 1
      for path in children:
          is_last = count == len(children)
          if path.is_dir():
              yield from cls.make_tree(
                  path,
                  parent=displayable_root,
                  is_last=is_last,
                  criteria=criteria,
              )
          else:
              yield cls(path, displayable_root, is_last)
          count += 1
  
file_path: underthesea/underthesea/corpus/util.py
imports: from os import listdir
  from os.path import join
  from pathlib import Path
label_desc: Use image node_id 3 for calling the DisplayablePath obj's underlying member method code with example usage: obj.make_tree(cls, root, parent, is_last, criteria) without return types