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