from typing import Optional


def get_probability(row: dict) -> Optional[int]:
    """
    Estimate confidence percentage based on the `ambiguity_score`.
    Per pangolin docs, this is basically the number of lineage-defining sites
    that had to be imputed from the reference sequence.
    Round and multiply by 100 --> percentage for easier user comprehension.
    """
    if row["ambiguity_score"]:
        return round(float(row["ambiguity_score"]) * 100)
    elif "Assigned using designation hash" in row["note"]:
        return 100
    else:
        return None