def _aln_identity(a, b):
    """Compute identity of alignment between two sequences.

    Args:
        a, b: two aligned sequences

    Returns:
        float representing the fraction of the alignment that is
        identical between a and b
    """
    assert len(a) == len(b)
    identical_count = sum(1 for i in range(len(a)) if a[i] == b[i])
    return identical_count / float(len(a))