def insert_many(ol,eles,locs,**kwargs):
if('<STR_LIT>' in kwargs):<EOL><INDENT>mode = kwargs["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>mode = "<STR_LIT>"<EOL><DEDENT>eles = copy.deepcopy(eles)<EOL>locs = copy.deepcopy(locs)<EOL>new = []<EOL>length = ol.__len__()<EOL>cpol = copy.deepcopy(ol)<EOL>for i in range(<NUM_LIT:0>,locs.__len__()):<EOL><INDENT>if(locs[i]>=length):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>locs[i] = uniform_index(locs[i],length)<EOL><DEDENT><DEDENT>tmp = sorted_refer_to(eles,locs)<EOL>eles = tmp['<STR_LIT:list>']<EOL>locs = tmp['<STR_LIT>']<EOL>label = eles.__len__()<EOL>si = <NUM_LIT:0><EOL>ei = <NUM_LIT:0><EOL>for i in range(<NUM_LIT:0>,locs.__len__()):<EOL><INDENT>if(locs[i]>=length):<EOL><INDENT>label = i<EOL>break<EOL><DEDENT>else:<EOL><INDENT>ei = locs[i]<EOL>new.extend(cpol[si:ei])<EOL>new.append(eles[i])<EOL>si = ei<EOL><DEDENT><DEDENT>for i in range(label,locs.__len__()):<EOL><INDENT>new.append(eles[i])<EOL><DEDENT>new.extend(cpol[ei:])<EOL>if(mode == "<STR_LIT>"):<EOL><INDENT>return(new)<EOL><DEDENT>else:<EOL><INDENT>ol.clear()<EOL>ol.extend(new)<EOL>return(ol)<EOL><DEDENT>
from elist.elist import *
ol = [1,2,3,4,5]
eles = [7,77,777]
locs = [0,2,4]
id(ol)
new = insert_many(ol,eles,locs)
ol
new
id(new)
####
ol = [1,2,3,4,5]
eles = [7,77,777]
locs = [0,2,4]
id(ol)
rslt = insert_many(ol,eles,locs,mode="original")
ol
rslt
id(rslt)