def count_allele(genotype_alleles, allele):
    """Count occurrence of an allele in a genotype.

    Parameters
    ----------
    genotype_alleles : ndarray, int, shape (ploidy, )
        Genotype alleles encoded as integers
    allele : int
        Allele to count.

    Returns:
    count : int
        Count of allele.
    """
    count = 0
    for i in range(len(genotype_alleles)):
        if genotype_alleles[i] == allele:
            count += 1
    return count