def lookup_fingerprint(conn, fp, length, good_enough_score, min_score, fast=False, max_offset=0):
    """Search for a fingerprint in the database"""
    matched = []
    best_score = 0.0
    for part_start, part_length in PARTS:
        params = dict(fp=fp, length=length, part_start=part_start,
            part_length=part_length, max_length_diff=const.FINGERPRINT_MAX_LENGTH_DIFF,
            min_score=min_score, max_offset=max_offset)
        with closing(conn.execute(PART_SEARCH_SQL, params)) as result:
            for row in result:
                matched.append(row)
                if row['score'] >= best_score:
                    best_score = row['score']
        if good_enough_score > best_score:
            break
    return matched
dataset/ETHPy150Open lalinsky/acoustid-server/acoustid/data/fingerprint.py/lookup_fingerprint/swapped operands of `>`