def _find_best(dblist, query, threshold_bp):
    """
    Search for the best containment, return precisely one match.
    """
    best_cont = 0.0
    best_match = None
    best_filename = None
    for obj, filename, filetype in dblist:
        for cont, match, fname in obj.gather(query, threshold_bp=threshold_bp):
            assert cont
            if cont == best_cont and match.name() < best_match.name(
                ) or cont > best_cont:
                best_cont = cont
                best_match = match
                best_filename = fname or filename
    if not best_match:
        return None, None, None
    return best_cont, best_match, best_filename
