class_docstr: A util class for displaying the tree structure of root path.
  
  Example:
  
  >>> paths = _DisplayablePath.make_tree(Path('doc'))
  >>> for path in paths:
  >>>    print(path.displayable())
  
  Parameters
  ----------
  path : str
      The path.
  parent_path : str
      The parent parth.
  is_last : bool
      Whether it's the last node in this depth.
class_docstr_tok: ["A","util","class","for","displaying","the","tree","structure","of","root","path",".","Example",":",">",">",">","paths","=","_DisplayablePath.make_tree","(","Path","(","'doc","'",")",")",">",">",">","for","path","in","paths",":",">",">",">","print","(","path.displayable","(",")",")","Parameters","--","--","--","--","--","path",":","str","The","path",".","parent_path",":","str","The","parent","parth",".","is_last",":","bool","Whether","it","'s","the","last","node","in","this","depth","."]
docstr: Make tree structure from root.
  
  Parameters
  ----------
  root : str
      The root dir.
  parent : _DisplayablePath
      The parent displayable path.
  is_last : bool
      Whether it's the last in this level.
  criteria : function
      The criteria used to filter dir/path.
  max_depth : int
      Maximum depth for search.
docstr_tok: ["Make","tree","structure","from","root",".","Parameters","--","--","--","--","--","root",":","str","The","root","dir",".","parent",":","_DisplayablePath","The","parent","displayable","path",".","is_last",":","bool","Whether","it","'s","the","last","in","this","level",".","criteria",":","function","The","criteria","used","to","filter","dir\/path",".","max_depth",":","int","Maximum","depth","for","search","."]
code: def make_tree(
      cls, root, parent=None, is_last=False, criteria=None, max_depth=1
  ):
      """Make tree structure from root.
  
      Parameters
      ----------
      root : str
          The root dir.
      parent : _DisplayablePath
          The parent displayable path.
      is_last : bool
          Whether it's the last in this level.
      criteria : function
          The criteria used to filter dir/path.
      max_depth : int
          Maximum depth for search.
  
      """
      root = Path(str(root))
      criteria = criteria or cls._default_criteria
  
      displayable_root = cls(root, parent, is_last)
      if displayable_root.depth > max_depth:
          return displayable_root
      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() and displayable_root.depth < max_depth - 1:
              yield from cls.make_tree(
                  path,
                  parent=displayable_root,
                  is_last=is_last,
                  criteria=criteria,
                  max_depth=max_depth,
              )
          else:
              yield cls(path, displayable_root, is_last)
          count += 1
  
imports: import os
  import errno
  import contextlib
  from pathlib import Path
  import tarfile
  import zipfile
label_desc: Use image node_id 2 for calling the _DisplayablePath obj's underlying member method code with example usage: obj.make_tree(cls, root, parent, is_last, criteria, max_depth) and returns: displayable_root