def processFasta(fi, headless=False):
    """
    Provides a generator to the contents of a Fasta file.
    The function can handle single seq/multi seq, formatted/unformatted Fasta.

    Input: a file/stream handle
    Output: a generator object providing identifier and sequence information
    for each record in the Fastq file
    """
    seq, identifier = [], ''
    for line in fi:
        line = line.strip()
        if not line:
            continue
        if line.startswith('>'):
            if headless:
                line = line.lstrip('>')
            if seq:
                yield identifier, ''.join(seq)
                seq = []
            identifier = line
        else:
            seq.append(line)
    if seq:
        yield identifier, ''.join(seq)
