<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def insert_before(sequence, offset, new_residues):
 """Mutate the given sequence by inserting the string `new_residues` before `offset`. Parameters sequence : sequence String of amino acids or DNA bases offset : int Base 0 offset from start of sequence, after which we should insert `new_residues`. new_residues : sequence """

    assert 0 < offset <= len(sequence), \
        "Invalid position %d for sequence of length %d" % (
            offset, len(sequence))
    prefix = sequence[:offset]
    suffix = sequence[offset:]
    return prefix + new_residues + suffix