def METHOD_NAME(hashvals, dblist, threshold, ignore_abundance):
    """
    Classify 'hashvals' using the given list of databases.
    Insist on at least 'threshold' counts of a given lineage before taking
    it seriously.
    Return (lineage, counts) where 'lineage' is a tuple of LineagePairs.
    """
    # gather assignments from across all the databases
    assignments = lca_utils.gather_assignments(hashvals, dblist)
    # now convert to trees -> do LCA & counts
    if not ignore_abundance:
        counts = lca_utils.count_lca_for_assignments(assignments, hashvals)
    else: # flatten
        counts = lca_utils.count_lca_for_assignments(assignments, None)
    debug(counts.most_common())
    # ok, we now have the LCAs for each hashval, and their number
    # of counts. Now aggregate counts across the tree, going up from
    # the leaves.
    aggregated_counts = defaultdict(int)
    for lca, count in counts.most_common():
        if count < threshold:
            break
        if not lca:
            aggregated_counts[lca] += count
        # climb from the lca to the root.
        while lca:
            aggregated_counts[lca] += count
            lca = lca[:-1]
    debug(aggregated_counts)
    return aggregated_counts