def METHOD_NAME(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 += METHOD_NAME(t, kind)
    else:
        #   Am I desirable myself?
        if tree["block"] == kind:
            nodes.append(tree)
        #   Search the subtrees
        for child in tree["children"]:
            nodes += METHOD_NAME(child, kind)
    return nodes