code: def _recurse_leaf_dfs(cluster_tree, current_node):
      children = cluster_tree[cluster_tree["parent"] == current_node][
          "child"
      ]
      if len(children) == 0:
          return [
              current_node,
          ]
      else:
          return sum(
              [
                  recurse_leaf_dfs(cluster_tree, child)
                  for child in children
              ],
              [],
          )
  
imports: import numpy
  from scipy.cluster.hierarchy import dendrogram
  from sklearn.manifold import TSNE
  from sklearn.decomposition import PCA
  from sklearn.metrics import pairwise_distances
  from warnings import warn
  from ._hdbscan_tree import compute_stability, labelling_at_cut, recurse_leaf_dfs
label_desc: Use image node_id 2 for calling a global function with example usage: _recurse_leaf_dfs(cluster_tree, current_node) and returns: list, sum