#NEWLINE# @ jit . unroll_safe #NEWLINE# def splice_array( array , index , insertion ) : #NEWLINE# #INDENT# array_len = len ( array ) #NEWLINE# insertion_len = len ( insertion ) #NEWLINE# new_array = ( [ None ] * ( array_len + insertion_len ) ) #NEWLINE# for pre_index in range ( index ) : #NEWLINE# #INDENT# new_array [ pre_index ] = array [ pre_index ] #NEWLINE# #UNINDENT# for insert_index in range ( insertion_len ) : #NEWLINE# #INDENT# new_array [ ( index + insert_index ) ] = insertion [ insert_index ] #NEWLINE# #UNINDENT# for post_index in range ( index , array_len ) : #NEWLINE# #INDENT# new_array [ ( post_index + insertion_len ) ] = array [ post_index ] #NEWLINE# #UNINDENT# return new_array