def copy_within(ol,target, start=None, end=None):
length = ol.__len__()<EOL>if(start==None):<EOL><INDENT>start = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>if(end==None):<EOL><INDENT>end = length<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>target = uniform_index(target,length)<EOL>start = uniform_index(start,length)<EOL>end = uniform_index(end,length)<EOL>cplen = end - start<EOL>cpend = target+cplen<EOL>if(target+cplen > length):<EOL><INDENT>cpend = length<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>shift = start - target<EOL>if(shift>=<NUM_LIT:0>):<EOL><INDENT>for i in range(target,cpend):<EOL><INDENT>ol[i] = ol[i+shift]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for i in range(cpend-<NUM_LIT:1>,target-<NUM_LIT:1>,-<NUM_LIT:1>):<EOL><INDENT>ol[i] = ol[i+shift]<EOL><DEDENT><DEDENT>return(ol)<EOL>
from elist.elist import *
ol = [1, 2, 3, 4, 5]
id(ol)
rslt = copyWithin(ol,0,3,4)
rslt
id(rslt)
####
ol = [1, 2, 3, 4, 5]
id(ol)
rslt = copyWithin(ol,0,3)
rslt
id(rslt)
####
ol = [1, 2, 3, 4, 5]
id(ol)
rslt = copyWithin(ol,-2)
rslt
id(rslt)
####copyWithin is the same as copy_within