<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stock2fa(stock):
 """ convert stockholm to fasta """

    seqs = {}
    for line in stock:
        if line.startswith('#') is False and line.startswith(' ') is False and len(line) > 3:
            id, seq = line.strip().split()
            id = id.rsplit('/', 1)[0]
            id = re.split('[0-9]\|', id, 1)[-1]
            if id not in seqs:
                seqs[id] = []
            seqs[id].append(seq)
        if line.startswith('//'):
            break
    return seqs