code: def dir_tree_find(tree, kind):
      """Find nodes of the given kind from a directory tree structure.
  
      Parameters
      ----------
      tree : dict
          Directory tree.
      kind : int
          Kind to find.
  
      Returns
      -------
      nodes : list
          List of matching nodes.
      """
      nodes = []
  
      if isinstance(tree, list):
          for t in tree:
              nodes += dir_tree_find(t, kind)
      else:
          #   Am I desirable myself?
          if tree["block"] == kind:
              nodes.append(tree)
  
          #   Search the subtrees
          for child in tree["children"]:
              nodes += dir_tree_find(child, kind)
      return nodes
  
imports: from ..utils import logger, verbose
  from .constants import FIFF
  from .tag import read_tag
label_desc: Use image node_id 1 for calling a global function with example usage: dir_tree_find(tree, kind) and returns: nodes