code: def _tree_to_labels(X, single_linkage_tree, min_cluster_size=10,
                      cluster_selection_method='eom',
                      allow_single_cluster=False,
                      match_reference_implementation=False):
      
      condensed_tree = condense_tree(single_linkage_tree,
                                     min_cluster_size)
      stability_dict = compute_stability(condensed_tree)
      labels, probabilities, stabilities = get_clusters(condensed_tree,
                                                        stability_dict,
                                                        cluster_selection_method,
                                                        allow_single_cluster,
                                                        match_reference_implementation)
  
      return (labels, probabilities, stabilities, condensed_tree,
              single_linkage_tree)
docs: Converts a pretrained tree and cluster size into a
      set of labels and probabilities.