<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rnd_ins_seq(ins_len, C_R, CP_first_nt):
 """Generate a random insertion nucleotide sequence of length ins_len. Draws the sequence identity (for a set length) from the distribution defined by the dinucleotide markov model of transition matrix R. Parameters ins_len : int Length of nucleotide sequence to be inserted. C_R : ndarray (4, 4) array of the cumulative transition probabilities defined by the Markov transition matrix R CP_first_nt : ndarray (4,) array of the cumulative probabilities for the first inserted nucleotide Returns ------- seq : str Randomly generated insertion sequence of length ins_len. Examples -------- 'GATGGAC' 'ACCCCCG' 'GCC' """

    nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
    num2nt = 'ACGT'

    if ins_len == 0:
        return ''

    seq = num2nt[CP_first_nt.searchsorted(np.random.random())]
    ins_len += -1

    while ins_len > 0:
        seq += num2nt[C_R[nt2num[seq[-1]], :].searchsorted(np.random.random())]
        ins_len += -1

    return seq