from typing import Dict


def read_fasta(fname: str) -> Dict[str, str]:
    """Read fa file, returning a dict of seq names to seqs"""
    retval = {}
    curr_key, curr_seq = "", ""
    with open(fname) as source:
        for line in source:
            line = line.strip()
            if line.startswith(">"):
                if curr_key:  # Previous record
                    assert curr_seq
                    retval[curr_key] = curr_seq
                curr_key = line.strip(">").strip()
                curr_seq = ""  # Reset
            else:
                curr_seq += line.strip()
    if curr_key:  # Store trailing record
        assert curr_seq
        retval[curr_key] = curr_seq
    return retval