def gen_seqlib(sequence, pos, lib):
    '\n        Generates sequences, mutating at pos[x] to all as in lib[x]\n        Generates sequences, mutating at pos[x] if len(lib)==1,\n        the same lib will be used for all\n        Return sequences\n    '
    if isinstance(lib, str):
        lib = [lib]
    if (len(lib) == 1):
        while range(1, len(pos)):
            lib.append(lib[0])
    if (len(pos) != len(lib)):
        msg = 'Bad Input: Dimensions of pos and lib must be equal: '
        msg += 'found: #pos: {0}, #lib {1}'.format(len(pos), len(lib))
        raise (Exception, msg)
    seqlib = combine(lib, pos)
    sequences_1d = {}
    for i in range(0, len(seqlib)):
        nfa = list(sequence)
        for (j, posj) in pos:
            if (nfa[posj].upper() != seqlib[i][j].upper()):
                nfa[posj] = seqlib[i][j]
        modseq = ''.join(nfa)
        sequences_1d[modseq] = 1
    return sequences_1d
Generates sequences, mutating at pos[x] to all as in lib[x]
Generates sequences, mutating at pos[x] if len(lib)==1,
the same lib will be used for all
Return sequences
def gen_seqlib(sequence, pos, lib):
    '\n        Generates sequences, mutating at pos[x] to all as in lib[x]\n        Generates sequences, mutating at pos[x] if len(lib)==1,\n        the same lib will be used for all\n        Return sequences\n    '
    if isinstance(lib, str):
        lib = [lib]
    if (len(lib) == 1):
        while range(1, len(pos)):
            lib.append(lib[0])
    if (len(pos) != len(lib)):
        msg = 'Bad Input: Dimensions of pos and lib must be equal: '
        msg += 'found: #pos: {0}, #lib {1}'.format(len(pos), len(lib))
        raise (Exception, msg)
    seqlib = combine(lib, pos)
    sequences_1d = {}
    for i in range(0, len(seqlib)):
        nfa = list(sequence)
        for (j, posj) in pos:
            if (nfa[posj].upper() != seqlib[i][j].upper()):
                nfa[posj] = seqlib[i][j]
        modseq = .join(nfa)
        sequences_1d[modseq] = 1
    return sequences_1d