def count(fasta):
    """Counts sequences in an open FASTA file handle.

    Iterates file and counts header lines. Then, seeks to start
    of the file and returns the count.

    Parameters:
        fasta (file pointer): An open file handle corresponding to a FASTA file.
    Returns:
        count (int): Total number of sequences in the file.
    """
    count = 0
    for line in fasta:
        if line.startswith(">"):
            count += 1
    fasta.seek(0)
    return count