def replace_seqs(ol,value,indexes,**kwargs):
if('<STR_LIT>' in kwargs):<EOL><INDENT>mode = kwargs["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>mode = "<STR_LIT>"<EOL><DEDENT>indexes = list(indexes)<EOL>new = []<EOL>length = ol.__len__()<EOL>cpol = copy.deepcopy(ol)<EOL>for i in range(<NUM_LIT:0>,length):<EOL><INDENT>if(i in indexes):<EOL><INDENT>new.append(value)<EOL><DEDENT>else:<EOL><INDENT>new.append(cpol[i])<EOL><DEDENT><DEDENT>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,'a',3,'a',5,'a',6,'a']
id(ol)
new = replace_seqs(ol,'AAA',[1,3,7])
ol
new
id(ol)
id(new)
####
ol = [1,'a',3,'a',5,'a',6,'a']
id(ol)
rslt = replace_seqs(ol,'AAA',[1,3,7],mode="original")
ol
rslt
id(ol)
id(rslt)
#replace_indexes = replace_seqs