body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
a5ea42ef616a08f5c522232f46d186c3a04de7a3f0d77a24bf0bb8455f7bea0d
def findv(ol, cond_func, cond_func_args=[]): '\n #mapv i不作为map_func参数,共享相同的f,共享相同的o\n # NOT take index as a param for map_func\n # share common other_args\n # share common cond_func\n # common_func(value,*common_args)\n\n ' rslt = [] for i in range(ol.__len__()): cond = cond_func(ol[i], *cond_func_args) if cond: rslt.append((i, ol[i])) else: pass return rslt
#mapv i不作为map_func参数,共享相同的f,共享相同的o # NOT take index as a param for map_func # share common other_args # share common cond_func # common_func(value,*common_args)
elist/elist.py
findv
ihgazni2/elist
0
python
def findv(ol, cond_func, cond_func_args=[]): '\n #mapv i不作为map_func参数,共享相同的f,共享相同的o\n # NOT take index as a param for map_func\n # share common other_args\n # share common cond_func\n # common_func(value,*common_args)\n\n ' rslt = [] for i in range(ol.__len__()): cond = cond_func(ol[i], *cond_func_args) if cond: rslt.append((i, ol[i])) else: pass return rslt
def findv(ol, cond_func, cond_func_args=[]): '\n #mapv i不作为map_func参数,共享相同的f,共享相同的o\n # NOT take index as a param for map_func\n # share common other_args\n # share common cond_func\n # common_func(value,*common_args)\n\n ' rslt = [] for i in range(ol.__len__()): cond = cond_func(ol[i], *cond_func_args) if cond: rslt.append((i, ol[i])) else: pass return rslt<|docstring|>#mapv i不作为map_func参数,共享相同的f,共享相同的o # NOT take index as a param for map_func # share common other_args # share common cond_func # common_func(value,*common_args)<|endoftext|>
bee6e302cd68f65085d1845dde95d4e0e56090998582583943d06934c9f897d1
def cond_select_all(ol, **kwargs): '\n from elist.elist import *\n from elist.jprint import pobj\n def test_func(ele,x):\n cond = (ele > x)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_all(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['value'])) return rslt
from elist.elist import * from elist.jprint import pobj def test_func(ele,x): cond = (ele > x) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_all(ol,cond_func = test_func,cond_func_args = [3]) pobj(rslt)
elist/elist.py
cond_select_all
ihgazni2/elist
0
python
def cond_select_all(ol, **kwargs): '\n from elist.elist import *\n from elist.jprint import pobj\n def test_func(ele,x):\n cond = (ele > x)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_all(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['value'])) return rslt
def cond_select_all(ol, **kwargs): '\n from elist.elist import *\n from elist.jprint import pobj\n def test_func(ele,x):\n cond = (ele > x)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_all(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['value'])) return rslt<|docstring|>from elist.elist import * from elist.jprint import pobj def test_func(ele,x): cond = (ele > x) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_all(ol,cond_func = test_func,cond_func_args = [3]) pobj(rslt)<|endoftext|>
7f6efeb3e84eb4d99f3f1d4357acdb9b4e8e80fe84233ebbad3b249d0978e04c
def cond_select_all2(ol, **kwargs): '\n from elist.elist import *\n from xdict.jprint import pobj\n def test_func(ele,index,x):\n cond1 = (ele > x)\n cond2 = (index %2 == 0)\n cond =(cond1 & cond2)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_all2(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all2(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['value'])) return rslt
from elist.elist import * from xdict.jprint import pobj def test_func(ele,index,x): cond1 = (ele > x) cond2 = (index %2 == 0) cond =(cond1 & cond2) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_all2(ol,cond_func = test_func,cond_func_args = [3]) pobj(rslt)
elist/elist.py
cond_select_all2
ihgazni2/elist
0
python
def cond_select_all2(ol, **kwargs): '\n from elist.elist import *\n from xdict.jprint import pobj\n def test_func(ele,index,x):\n cond1 = (ele > x)\n cond2 = (index %2 == 0)\n cond =(cond1 & cond2)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_all2(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all2(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['value'])) return rslt
def cond_select_all2(ol, **kwargs): '\n from elist.elist import *\n from xdict.jprint import pobj\n def test_func(ele,index,x):\n cond1 = (ele > x)\n cond2 = (index %2 == 0)\n cond =(cond1 & cond2)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_all2(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all2(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['value'])) return rslt<|docstring|>from elist.elist import * from xdict.jprint import pobj def test_func(ele,index,x): cond1 = (ele > x) cond2 = (index %2 == 0) cond =(cond1 & cond2) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_all2(ol,cond_func = test_func,cond_func_args = [3]) pobj(rslt)<|endoftext|>
62b2570b45511afb8d1b339ca1cb949541fb73e7f3aa983c64cb35da30536ac5
def cond_select_indexes_all(ol, **kwargs): '\n from elist.elist import *\n from elist.jprint import pobj\n def test_func(ele,x):\n cond = (ele > x)\n return(cond)\n \n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_indexes_all(ol,cond_func = test_func, cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['index'])) return rslt
from elist.elist import * from elist.jprint import pobj def test_func(ele,x): cond = (ele > x) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_indexes_all(ol,cond_func = test_func, cond_func_args = [3]) pobj(rslt)
elist/elist.py
cond_select_indexes_all
ihgazni2/elist
0
python
def cond_select_indexes_all(ol, **kwargs): '\n from elist.elist import *\n from elist.jprint import pobj\n def test_func(ele,x):\n cond = (ele > x)\n return(cond)\n \n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_indexes_all(ol,cond_func = test_func, cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['index'])) return rslt
def cond_select_indexes_all(ol, **kwargs): '\n from elist.elist import *\n from elist.jprint import pobj\n def test_func(ele,x):\n cond = (ele > x)\n return(cond)\n \n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_indexes_all(ol,cond_func = test_func, cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['index'])) return rslt<|docstring|>from elist.elist import * from elist.jprint import pobj def test_func(ele,x): cond = (ele > x) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_indexes_all(ol,cond_func = test_func, cond_func_args = [3]) pobj(rslt)<|endoftext|>
bb4dd16e7717d7790f38cb4b8704312dffff9a6c17046db50e4f41fe07e9ef6f
def cond_select_indexes_all2(ol, **kwargs): '\n from elist.elist import *\n from xdict.jprint import pobj\n def test_func(ele,index,x):\n cond1 = (ele > x)\n cond2 = (index %2 == 0)\n cond =(cond1 & cond2)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_indexes_all2(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all2(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['index'])) return rslt
from elist.elist import * from xdict.jprint import pobj def test_func(ele,index,x): cond1 = (ele > x) cond2 = (index %2 == 0) cond =(cond1 & cond2) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_indexes_all2(ol,cond_func = test_func,cond_func_args = [3]) pobj(rslt)
elist/elist.py
cond_select_indexes_all2
ihgazni2/elist
0
python
def cond_select_indexes_all2(ol, **kwargs): '\n from elist.elist import *\n from xdict.jprint import pobj\n def test_func(ele,index,x):\n cond1 = (ele > x)\n cond2 = (index %2 == 0)\n cond =(cond1 & cond2)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_indexes_all2(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all2(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['index'])) return rslt
def cond_select_indexes_all2(ol, **kwargs): '\n from elist.elist import *\n from xdict.jprint import pobj\n def test_func(ele,index,x):\n cond1 = (ele > x)\n cond2 = (index %2 == 0)\n cond =(cond1 & cond2)\n return(cond)\n\n ol = [1,2,3,4,5,6,7]\n rslt = cond_select_indexes_all2(ol,cond_func = test_func,cond_func_args = [3])\n pobj(rslt)\n ' cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] founded = find_all2(ol, cond_func, *cond_func_args) rslt = array_map(founded, (lambda ele: ele['index'])) return rslt<|docstring|>from elist.elist import * from xdict.jprint import pobj def test_func(ele,index,x): cond1 = (ele > x) cond2 = (index %2 == 0) cond =(cond1 & cond2) return(cond) ol = [1,2,3,4,5,6,7] rslt = cond_select_indexes_all2(ol,cond_func = test_func,cond_func_args = [3]) pobj(rslt)<|endoftext|>
4f56f67c27db8657aac13921bffbd64cb8694076c0875cc813f246513a5e8457
def vildict(l): "\n >>> l\n [1, 'a', 'a', 2, 2, 'a', 1, 'a', 'b', 'a', 5, 'b', 'b', 'b']\n >>> vildict(l)\n {1: [0, 6], 'a': [1, 2, 5, 7, 9], 2: [3, 4], 'b': [8, 11, 12, 13], 5: [10]}\n >>>\n " st = set({}) rslt = {} for i in range(len(l)): v = l[i] if (v in st): rslt[v].append(i) else: st.add(v) rslt[v] = [i] return rslt
>>> l [1, 'a', 'a', 2, 2, 'a', 1, 'a', 'b', 'a', 5, 'b', 'b', 'b'] >>> vildict(l) {1: [0, 6], 'a': [1, 2, 5, 7, 9], 2: [3, 4], 'b': [8, 11, 12, 13], 5: [10]} >>>
elist/elist.py
vildict
ihgazni2/elist
0
python
def vildict(l): "\n >>> l\n [1, 'a', 'a', 2, 2, 'a', 1, 'a', 'b', 'a', 5, 'b', 'b', 'b']\n >>> vildict(l)\n {1: [0, 6], 'a': [1, 2, 5, 7, 9], 2: [3, 4], 'b': [8, 11, 12, 13], 5: [10]}\n >>>\n " st = set({}) rslt = {} for i in range(len(l)): v = l[i] if (v in st): rslt[v].append(i) else: st.add(v) rslt[v] = [i] return rslt
def vildict(l): "\n >>> l\n [1, 'a', 'a', 2, 2, 'a', 1, 'a', 'b', 'a', 5, 'b', 'b', 'b']\n >>> vildict(l)\n {1: [0, 6], 'a': [1, 2, 5, 7, 9], 2: [3, 4], 'b': [8, 11, 12, 13], 5: [10]}\n >>>\n " st = set({}) rslt = {} for i in range(len(l)): v = l[i] if (v in st): rslt[v].append(i) else: st.add(v) rslt[v] = [i] return rslt<|docstring|>>>> l [1, 'a', 'a', 2, 2, 'a', 1, 'a', 'b', 'a', 5, 'b', 'b', 'b'] >>> vildict(l) {1: [0, 6], 'a': [1, 2, 5, 7, 9], 2: [3, 4], 'b': [8, 11, 12, 13], 5: [10]} >>><|endoftext|>
6a0b96047a32229642ba7db0f472b702fd876138be97a862ef66485b5b84f518
def select_seqs(ol, seqs): "\n from elist.elist import *\n ol = ['a','b','c','d']\n select_seqs(ol,[1,2])\n " rslt = copy.deepcopy(ol) rslt = itemgetter(*seqs)(ol) if (seqs.__len__() == 0): rslt = [] elif (seqs.__len__() == 1): rslt = [rslt] else: rslt = list(rslt) return rslt
from elist.elist import * ol = ['a','b','c','d'] select_seqs(ol,[1,2])
elist/elist.py
select_seqs
ihgazni2/elist
0
python
def select_seqs(ol, seqs): "\n from elist.elist import *\n ol = ['a','b','c','d']\n select_seqs(ol,[1,2])\n " rslt = copy.deepcopy(ol) rslt = itemgetter(*seqs)(ol) if (seqs.__len__() == 0): rslt = [] elif (seqs.__len__() == 1): rslt = [rslt] else: rslt = list(rslt) return rslt
def select_seqs(ol, seqs): "\n from elist.elist import *\n ol = ['a','b','c','d']\n select_seqs(ol,[1,2])\n " rslt = copy.deepcopy(ol) rslt = itemgetter(*seqs)(ol) if (seqs.__len__() == 0): rslt = [] elif (seqs.__len__() == 1): rslt = [rslt] else: rslt = list(rslt) return rslt<|docstring|>from elist.elist import * ol = ['a','b','c','d'] select_seqs(ol,[1,2])<|endoftext|>
a5eb269fc3db951b578a0e4124635db1a5cca4d60e58cb7248424220643c71cf
def seqs_not(seqs, *args): '\n >>> seqs_not([1,2,5])\n [0, 3, 4]\n >>>\n >>> seqs_not([1,2,5],7)\n [0, 3, 4, 6]\n >>>\n ' if (len(args) == 0): lngth = (seqs[(- 1)] + 1) else: lngth = args[0] st = init_range(0, lngth, 1) st = set(st) st0 = set(seqs) st1 = st.difference(st0) nseqs = list(st1) nseqs.sort() return nseqs
>>> seqs_not([1,2,5]) [0, 3, 4] >>> >>> seqs_not([1,2,5],7) [0, 3, 4, 6] >>>
elist/elist.py
seqs_not
ihgazni2/elist
0
python
def seqs_not(seqs, *args): '\n >>> seqs_not([1,2,5])\n [0, 3, 4]\n >>>\n >>> seqs_not([1,2,5],7)\n [0, 3, 4, 6]\n >>>\n ' if (len(args) == 0): lngth = (seqs[(- 1)] + 1) else: lngth = args[0] st = init_range(0, lngth, 1) st = set(st) st0 = set(seqs) st1 = st.difference(st0) nseqs = list(st1) nseqs.sort() return nseqs
def seqs_not(seqs, *args): '\n >>> seqs_not([1,2,5])\n [0, 3, 4]\n >>>\n >>> seqs_not([1,2,5],7)\n [0, 3, 4, 6]\n >>>\n ' if (len(args) == 0): lngth = (seqs[(- 1)] + 1) else: lngth = args[0] st = init_range(0, lngth, 1) st = set(st) st0 = set(seqs) st1 = st.difference(st0) nseqs = list(st1) nseqs.sort() return nseqs<|docstring|>>>> seqs_not([1,2,5]) [0, 3, 4] >>> >>> seqs_not([1,2,5],7) [0, 3, 4, 6] >>><|endoftext|>
467541a1b560bc03b305b2c93b2be341b44b89b04a7ba88536c414304a0925c7
def select_some(ol, *seqs): "\n from elist.elist import *\n ol = ['a','b','c','d']\n select_some(ol,1,2)\n " seqs = list(seqs) return select_seqs(ol, seqs)
from elist.elist import * ol = ['a','b','c','d'] select_some(ol,1,2)
elist/elist.py
select_some
ihgazni2/elist
0
python
def select_some(ol, *seqs): "\n from elist.elist import *\n ol = ['a','b','c','d']\n select_some(ol,1,2)\n " seqs = list(seqs) return select_seqs(ol, seqs)
def select_some(ol, *seqs): "\n from elist.elist import *\n ol = ['a','b','c','d']\n select_some(ol,1,2)\n " seqs = list(seqs) return select_seqs(ol, seqs)<|docstring|>from elist.elist import * ol = ['a','b','c','d'] select_some(ol,1,2)<|endoftext|>
b405b7172f755ea82aee4c39eea1b77951954b124b707f4a0a68984ea4d2194f
def append(ol, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n append(ol,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = append(ol,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.append(ele) return new else: ol.append(ele) return ol
from elist.elist import * ol = [1,2,3,4] ele = 5 id(ol) append(ol,ele,mode="original") ol id(ol) #### ol = [1,2,3,4] ele = 5 id(ol) new = append(ol,ele) new id(new)
elist/elist.py
append
ihgazni2/elist
0
python
def append(ol, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n append(ol,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = append(ol,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.append(ele) return new else: ol.append(ele) return ol
def append(ol, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n append(ol,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = append(ol,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.append(ele) return new else: ol.append(ele) return ol<|docstring|>from elist.elist import * ol = [1,2,3,4] ele = 5 id(ol) append(ol,ele,mode="original") ol id(ol) #### ol = [1,2,3,4] ele = 5 id(ol) new = append(ol,ele) new id(new)<|endoftext|>
5367f4c08e7e72a166a8c3aef77fdfcf8d1f1326b9e0137b96a86042f14ad75d
def append_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n append_some(ol,5,6,7,8,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = append_some(ol,5,6,7,8)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return extend(ol, list(eles), mode=mode)
from elist.elist import * ol = [1,2,3,4] id(ol) append_some(ol,5,6,7,8,mode="original") ol id(ol) #### ol = [1,2,3,4] id(ol) new = append_some(ol,5,6,7,8) new id(new)
elist/elist.py
append_some
ihgazni2/elist
0
python
def append_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n append_some(ol,5,6,7,8,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = append_some(ol,5,6,7,8)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return extend(ol, list(eles), mode=mode)
def append_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n append_some(ol,5,6,7,8,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = append_some(ol,5,6,7,8)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return extend(ol, list(eles), mode=mode)<|docstring|>from elist.elist import * ol = [1,2,3,4] id(ol) append_some(ol,5,6,7,8,mode="original") ol id(ol) #### ol = [1,2,3,4] id(ol) new = append_some(ol,5,6,7,8) new id(new)<|endoftext|>
920ff80b2ede9ddd55ad81246eb4cc32a61bcdb10924ac5ff806569f58fbf9c5
def prepend(ol, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n prepend(ol,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = prepend(ol,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = [ele] cpol = copy.deepcopy(ol) new.extend(cpol) return new else: length = ol.__len__() ol.append(None) for i in range((length - 1), (- 1), (- 1)): ol[(i + 1)] = ol[i] ol[0] = ele return ol
from elist.elist import * ol = [1,2,3,4] ele = 5 id(ol) prepend(ol,ele,mode="original") ol id(ol) #### ol = [1,2,3,4] ele = 5 id(ol) new = prepend(ol,ele) new id(new)
elist/elist.py
prepend
ihgazni2/elist
0
python
def prepend(ol, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n prepend(ol,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = prepend(ol,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = [ele] cpol = copy.deepcopy(ol) new.extend(cpol) return new else: length = ol.__len__() ol.append(None) for i in range((length - 1), (- 1), (- 1)): ol[(i + 1)] = ol[i] ol[0] = ele return ol
def prepend(ol, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n prepend(ol,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = prepend(ol,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = [ele] cpol = copy.deepcopy(ol) new.extend(cpol) return new else: length = ol.__len__() ol.append(None) for i in range((length - 1), (- 1), (- 1)): ol[(i + 1)] = ol[i] ol[0] = ele return ol<|docstring|>from elist.elist import * ol = [1,2,3,4] ele = 5 id(ol) prepend(ol,ele,mode="original") ol id(ol) #### ol = [1,2,3,4] ele = 5 id(ol) new = prepend(ol,ele) new id(new)<|endoftext|>
52899557dfdd57d74205e9d1d489f6a58f68e455486f466983625b9683e083c7
def prepend_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n prepend_some(ol,5,6,7,8,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = prepend_some(ol,5,6,7,8)\n new\n id(new)\n #####unshift is the same as prepend_some\n >>> unshift(ol,9,10,11,12)\n [9, 10, 11, 12, 1, 2, 3, 4]\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return prextend(ol, list(eles), mode=mode)
from elist.elist import * ol = [1,2,3,4] id(ol) prepend_some(ol,5,6,7,8,mode="original") ol id(ol) #### ol = [1,2,3,4] id(ol) new = prepend_some(ol,5,6,7,8) new id(new) #####unshift is the same as prepend_some >>> unshift(ol,9,10,11,12) [9, 10, 11, 12, 1, 2, 3, 4]
elist/elist.py
prepend_some
ihgazni2/elist
0
python
def prepend_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n prepend_some(ol,5,6,7,8,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = prepend_some(ol,5,6,7,8)\n new\n id(new)\n #####unshift is the same as prepend_some\n >>> unshift(ol,9,10,11,12)\n [9, 10, 11, 12, 1, 2, 3, 4]\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return prextend(ol, list(eles), mode=mode)
def prepend_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n prepend_some(ol,5,6,7,8,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = prepend_some(ol,5,6,7,8)\n new\n id(new)\n #####unshift is the same as prepend_some\n >>> unshift(ol,9,10,11,12)\n [9, 10, 11, 12, 1, 2, 3, 4]\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return prextend(ol, list(eles), mode=mode)<|docstring|>from elist.elist import * ol = [1,2,3,4] id(ol) prepend_some(ol,5,6,7,8,mode="original") ol id(ol) #### ol = [1,2,3,4] id(ol) new = prepend_some(ol,5,6,7,8) new id(new) #####unshift is the same as prepend_some >>> unshift(ol,9,10,11,12) [9, 10, 11, 12, 1, 2, 3, 4]<|endoftext|>
968bd445ff0700de02fa3e61c6c376cc88f333389ef87fd9712ef8c482302555
def extend(ol, nl, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n extend(ol,nl,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n new = extend(ol,nl)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) cpnl = copy.deepcopy(nl) new.extend(cpnl) return new else: ol.extend(nl) return ol
from elist.elist import * ol = [1,2,3,4] nl = [5,6,7,8] id(ol) extend(ol,nl,mode="original") ol id(ol) #### ol = [1,2,3,4] nl = [5,6,7,8] id(ol) new = extend(ol,nl) new id(new)
elist/elist.py
extend
ihgazni2/elist
0
python
def extend(ol, nl, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n extend(ol,nl,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n new = extend(ol,nl)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) cpnl = copy.deepcopy(nl) new.extend(cpnl) return new else: ol.extend(nl) return ol
def extend(ol, nl, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n extend(ol,nl,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n new = extend(ol,nl)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) cpnl = copy.deepcopy(nl) new.extend(cpnl) return new else: ol.extend(nl) return ol<|docstring|>from elist.elist import * ol = [1,2,3,4] nl = [5,6,7,8] id(ol) extend(ol,nl,mode="original") ol id(ol) #### ol = [1,2,3,4] nl = [5,6,7,8] id(ol) new = extend(ol,nl) new id(new)<|endoftext|>
4a6fe500c461dc1021d884835c70733fad440972dce8d725ce834ae1cd60eb9f
def push(ol, *eles, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = push(ol,5,6,7)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = push(ol,5,6,7,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' eles = list(eles) return extend(ol, eles, mode=mode)
from elist.elist import * ol=[1,2,3,4] id(ol) new = push(ol,5,6,7) new id(new) #### ol=[1,2,3,4] id(ol) rslt = push(ol,5,6,7,mode="original") rslt id(rslt)
elist/elist.py
push
ihgazni2/elist
0
python
def push(ol, *eles, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = push(ol,5,6,7)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = push(ol,5,6,7,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' eles = list(eles) return extend(ol, eles, mode=mode)
def push(ol, *eles, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = push(ol,5,6,7)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = push(ol,5,6,7,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' eles = list(eles) return extend(ol, eles, mode=mode)<|docstring|>from elist.elist import * ol=[1,2,3,4] id(ol) new = push(ol,5,6,7) new id(new) #### ol=[1,2,3,4] id(ol) rslt = push(ol,5,6,7,mode="original") rslt id(rslt)<|endoftext|>
4eac2bf3402788eaa315b64466a3c0d10159d00123374c2d94101f282cc6f10d
def prextend(ol, nl, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n id(nl)\n prextend(ol,nl,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n id(nl)\n new = prextend(ol,nl)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(nl) cpol = copy.deepcopy(ol) new.extend(cpol) return new else: length = ol.__len__() nl_len = nl.__len__() for i in range(0, nl_len): ol.append(None) for i in range((length - 1), (- 1), (- 1)): ol[(i + nl_len)] = ol[i] for i in range(0, nl_len): ol[i] = nl[i] return ol
from elist.elist import * ol = [1,2,3,4] nl = [5,6,7,8] id(ol) id(nl) prextend(ol,nl,mode="original") ol id(ol) #### ol = [1,2,3,4] nl = [5,6,7,8] id(ol) id(nl) new = prextend(ol,nl) new id(new)
elist/elist.py
prextend
ihgazni2/elist
0
python
def prextend(ol, nl, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n id(nl)\n prextend(ol,nl,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n id(nl)\n new = prextend(ol,nl)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(nl) cpol = copy.deepcopy(ol) new.extend(cpol) return new else: length = ol.__len__() nl_len = nl.__len__() for i in range(0, nl_len): ol.append(None) for i in range((length - 1), (- 1), (- 1)): ol[(i + nl_len)] = ol[i] for i in range(0, nl_len): ol[i] = nl[i] return ol
def prextend(ol, nl, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n id(nl)\n prextend(ol,nl,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n nl = [5,6,7,8]\n id(ol)\n id(nl)\n new = prextend(ol,nl)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(nl) cpol = copy.deepcopy(ol) new.extend(cpol) return new else: length = ol.__len__() nl_len = nl.__len__() for i in range(0, nl_len): ol.append(None) for i in range((length - 1), (- 1), (- 1)): ol[(i + nl_len)] = ol[i] for i in range(0, nl_len): ol[i] = nl[i] return ol<|docstring|>from elist.elist import * ol = [1,2,3,4] nl = [5,6,7,8] id(ol) id(nl) prextend(ol,nl,mode="original") ol id(ol) #### ol = [1,2,3,4] nl = [5,6,7,8] id(ol) id(nl) new = prextend(ol,nl) new id(new)<|endoftext|>
615a4b3f7742abf91536211c6b0b6d8d6d4e6f8a84737a5082a941b6121fb9c6
def concat(*arrays): '\n from elist.elist import *\n l1 = [1,2,3]\n l2 = ["a","b","c"]\n l3 = [100,200]\n id(l1)\n id(l2)\n id(l3)\n arrays = [l1,l2,l3]\n new = concat(arrays)\n new\n id(new)\n ' new = [] length = arrays.__len__() for i in range(0, length): array = copy.deepcopy(arrays[i]) new.extend(array) return new
from elist.elist import * l1 = [1,2,3] l2 = ["a","b","c"] l3 = [100,200] id(l1) id(l2) id(l3) arrays = [l1,l2,l3] new = concat(arrays) new id(new)
elist/elist.py
concat
ihgazni2/elist
0
python
def concat(*arrays): '\n from elist.elist import *\n l1 = [1,2,3]\n l2 = ["a","b","c"]\n l3 = [100,200]\n id(l1)\n id(l2)\n id(l3)\n arrays = [l1,l2,l3]\n new = concat(arrays)\n new\n id(new)\n ' new = [] length = arrays.__len__() for i in range(0, length): array = copy.deepcopy(arrays[i]) new.extend(array) return new
def concat(*arrays): '\n from elist.elist import *\n l1 = [1,2,3]\n l2 = ["a","b","c"]\n l3 = [100,200]\n id(l1)\n id(l2)\n id(l3)\n arrays = [l1,l2,l3]\n new = concat(arrays)\n new\n id(new)\n ' new = [] length = arrays.__len__() for i in range(0, length): array = copy.deepcopy(arrays[i]) new.extend(array) return new<|docstring|>from elist.elist import * l1 = [1,2,3] l2 = ["a","b","c"] l3 = [100,200] id(l1) id(l2) id(l3) arrays = [l1,l2,l3] new = concat(arrays) new id(new)<|endoftext|>
d8e8c950f2d0fb6dd7ffb327ee05410faf340458e4e065491fc05c9e583df5ff
def concat_seqs(arrays): '\n from elist.elist import *\n l1 = [1,2,3]\n l2 = ["a","b","c"]\n l3 = [100,200]\n id(l1)\n id(l2)\n id(l3)\n arrays = [l1,l2,l3]\n new = concat_seqs(arrays)\n new\n id(new)\n ' return concat(*tuple(arrays))
from elist.elist import * l1 = [1,2,3] l2 = ["a","b","c"] l3 = [100,200] id(l1) id(l2) id(l3) arrays = [l1,l2,l3] new = concat_seqs(arrays) new id(new)
elist/elist.py
concat_seqs
ihgazni2/elist
0
python
def concat_seqs(arrays): '\n from elist.elist import *\n l1 = [1,2,3]\n l2 = ["a","b","c"]\n l3 = [100,200]\n id(l1)\n id(l2)\n id(l3)\n arrays = [l1,l2,l3]\n new = concat_seqs(arrays)\n new\n id(new)\n ' return concat(*tuple(arrays))
def concat_seqs(arrays): '\n from elist.elist import *\n l1 = [1,2,3]\n l2 = ["a","b","c"]\n l3 = [100,200]\n id(l1)\n id(l2)\n id(l3)\n arrays = [l1,l2,l3]\n new = concat_seqs(arrays)\n new\n id(new)\n ' return concat(*tuple(arrays))<|docstring|>from elist.elist import * l1 = [1,2,3] l2 = ["a","b","c"] l3 = [100,200] id(l1) id(l2) id(l3) arrays = [l1,l2,l3] new = concat_seqs(arrays) new id(new)<|endoftext|>
48fae4f88f47becb79a5805743007d3e9233fa987759e8c649d9e4b9e2bf35f2
def car(ol): '\n from elist.elist import *\n ol=[1,2,3,4]\n car(ol)\n ' return ol[0]
from elist.elist import * ol=[1,2,3,4] car(ol)
elist/elist.py
car
ihgazni2/elist
0
python
def car(ol): '\n from elist.elist import *\n ol=[1,2,3,4]\n car(ol)\n ' return ol[0]
def car(ol): '\n from elist.elist import *\n ol=[1,2,3,4]\n car(ol)\n ' return ol[0]<|docstring|>from elist.elist import * ol=[1,2,3,4] car(ol)<|endoftext|>
dc804c8c5ab756bb8ea14b01c0753cce28c4ddc66d3197f00ebe660742786117
def cdr(ol, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = cdr(ol)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = cdr(ol,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) return cpol[1:] else: ol.pop(0) return ol
from elist.elist import * ol=[1,2,3,4] id(ol) new = cdr(ol) new id(new) #### ol=[1,2,3,4] id(ol) rslt = cdr(ol,mode="original") rslt id(rslt)
elist/elist.py
cdr
ihgazni2/elist
0
python
def cdr(ol, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = cdr(ol)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = cdr(ol,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) return cpol[1:] else: ol.pop(0) return ol
def cdr(ol, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = cdr(ol)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = cdr(ol,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) return cpol[1:] else: ol.pop(0) return ol<|docstring|>from elist.elist import * ol=[1,2,3,4] id(ol) new = cdr(ol) new id(new) #### ol=[1,2,3,4] id(ol) rslt = cdr(ol,mode="original") rslt id(rslt)<|endoftext|>
6775fa56c0a458220f3d855014d49d6770a977003c6beeda7d9549960e006199
def cons(head_ele, l, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = cons(5,ol)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = cons(5,ol,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return prepend(l, head_ele, mode=mode)
from elist.elist import * ol=[1,2,3,4] id(ol) new = cons(5,ol) new id(new) #### ol=[1,2,3,4] id(ol) rslt = cons(5,ol,mode="original") rslt id(rslt)
elist/elist.py
cons
ihgazni2/elist
0
python
def cons(head_ele, l, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = cons(5,ol)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = cons(5,ol,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return prepend(l, head_ele, mode=mode)
def cons(head_ele, l, **kwargs): '\n from elist.elist import *\n ol=[1,2,3,4]\n id(ol)\n new = cons(5,ol)\n new\n id(new)\n ####\n ol=[1,2,3,4]\n id(ol)\n rslt = cons(5,ol,mode="original")\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' return prepend(l, head_ele, mode=mode)<|docstring|>from elist.elist import * ol=[1,2,3,4] id(ol) new = cons(5,ol) new id(new) #### ol=[1,2,3,4] id(ol) rslt = cons(5,ol,mode="original") rslt id(rslt)<|endoftext|>
c03611a51f0735b90cd6d77a18473c5e92772814c47d1b8e1f2ecbd611a9ada5
def uniform_index(index, length): '\n uniform_index(0,3)\n uniform_index(-1,3)\n uniform_index(-4,3)\n uniform_index(-3,3)\n uniform_index(5,3)\n ' if (index < 0): rl = (length + index) if (rl < 0): index = 0 else: index = rl elif (index >= length): index = length else: index = index return index
uniform_index(0,3) uniform_index(-1,3) uniform_index(-4,3) uniform_index(-3,3) uniform_index(5,3)
elist/elist.py
uniform_index
ihgazni2/elist
0
python
def uniform_index(index, length): '\n uniform_index(0,3)\n uniform_index(-1,3)\n uniform_index(-4,3)\n uniform_index(-3,3)\n uniform_index(5,3)\n ' if (index < 0): rl = (length + index) if (rl < 0): index = 0 else: index = rl elif (index >= length): index = length else: index = index return index
def uniform_index(index, length): '\n uniform_index(0,3)\n uniform_index(-1,3)\n uniform_index(-4,3)\n uniform_index(-3,3)\n uniform_index(5,3)\n ' if (index < 0): rl = (length + index) if (rl < 0): index = 0 else: index = rl elif (index >= length): index = length else: index = index return index<|docstring|>uniform_index(0,3) uniform_index(-1,3) uniform_index(-4,3) uniform_index(-3,3) uniform_index(5,3)<|endoftext|>
056291014fb0a0f0e01065d522d2284e2779117e87b23392b4c29012b03c3ec2
def insert(ol, start_index, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n insert(ol,2,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = insert(ol,2,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): length = ol.__len__() cpol = copy.deepcopy(ol) si = uniform_index(start_index, length) new = copy.deepcopy(cpol[0:si]) new.append(ele) new.extend(cpol[si:]) return new else: ol.insert(start_index, ele) return ol
from elist.elist import * ol = [1,2,3,4] ele = 5 id(ol) insert(ol,2,ele,mode="original") ol id(ol) #### ol = [1,2,3,4] ele = 5 id(ol) new = insert(ol,2,ele) new id(new)
elist/elist.py
insert
ihgazni2/elist
0
python
def insert(ol, start_index, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n insert(ol,2,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = insert(ol,2,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): length = ol.__len__() cpol = copy.deepcopy(ol) si = uniform_index(start_index, length) new = copy.deepcopy(cpol[0:si]) new.append(ele) new.extend(cpol[si:]) return new else: ol.insert(start_index, ele) return ol
def insert(ol, start_index, ele, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n insert(ol,2,ele,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n ele = 5\n id(ol)\n new = insert(ol,2,ele)\n new\n id(new)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): length = ol.__len__() cpol = copy.deepcopy(ol) si = uniform_index(start_index, length) new = copy.deepcopy(cpol[0:si]) new.append(ele) new.extend(cpol[si:]) return new else: ol.insert(start_index, ele) return ol<|docstring|>from elist.elist import * ol = [1,2,3,4] ele = 5 id(ol) insert(ol,2,ele,mode="original") ol id(ol) #### ol = [1,2,3,4] ele = 5 id(ol) new = insert(ol,2,ele) new id(new)<|endoftext|>
90516408fe805a10fff5bbaabbb0827bfff51219b5cfec4ec325c485a3b89a43
def insert_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n insert_some(ol,5,6,7,8,index=2,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = insert_some(ol,5,6,7,8,index=2)\n new\n id(new)\n ' start_index = kwargs['index'] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() cpol = copy.deepcopy(ol) if (mode == 'new'): si = uniform_index(start_index, length) new = copy.deepcopy(cpol[0:si]) new.extend(list(eles)) new.extend(cpol[si:]) return new else: si = uniform_index(start_index, length) new = cpol[0:si] new.extend(list(eles)) new.extend(cpol[si:]) ol.clear() for i in range(0, new.__len__()): ol.append(new[i]) return ol
from elist.elist import * ol = [1,2,3,4] id(ol) insert_some(ol,5,6,7,8,index=2,mode="original") ol id(ol) #### ol = [1,2,3,4] id(ol) new = insert_some(ol,5,6,7,8,index=2) new id(new)
elist/elist.py
insert_some
ihgazni2/elist
0
python
def insert_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n insert_some(ol,5,6,7,8,index=2,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = insert_some(ol,5,6,7,8,index=2)\n new\n id(new)\n ' start_index = kwargs['index'] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() cpol = copy.deepcopy(ol) if (mode == 'new'): si = uniform_index(start_index, length) new = copy.deepcopy(cpol[0:si]) new.extend(list(eles)) new.extend(cpol[si:]) return new else: si = uniform_index(start_index, length) new = cpol[0:si] new.extend(list(eles)) new.extend(cpol[si:]) ol.clear() for i in range(0, new.__len__()): ol.append(new[i]) return ol
def insert_some(ol, *eles, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n insert_some(ol,5,6,7,8,index=2,mode="original")\n ol\n id(ol)\n ####\n ol = [1,2,3,4]\n id(ol)\n new = insert_some(ol,5,6,7,8,index=2)\n new\n id(new)\n ' start_index = kwargs['index'] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() cpol = copy.deepcopy(ol) if (mode == 'new'): si = uniform_index(start_index, length) new = copy.deepcopy(cpol[0:si]) new.extend(list(eles)) new.extend(cpol[si:]) return new else: si = uniform_index(start_index, length) new = cpol[0:si] new.extend(list(eles)) new.extend(cpol[si:]) ol.clear() for i in range(0, new.__len__()): ol.append(new[i]) return ol<|docstring|>from elist.elist import * ol = [1,2,3,4] id(ol) insert_some(ol,5,6,7,8,index=2,mode="original") ol id(ol) #### ol = [1,2,3,4] id(ol) new = insert_some(ol,5,6,7,8,index=2) new id(new)<|endoftext|>
a32ce845a139e6f6d94066d15d2e69f641e304640feb9fe01d4a7f952c07c84f
def insert_many(ol, eles, locs, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4,5]\n eles = [7,77,777]\n locs = [0,2,4]\n id(ol)\n new = insert_many(ol,eles,locs)\n ol\n new\n id(new)\n ####\n ol = [1,2,3,4,5]\n eles = [7,77,777]\n locs = [0,2,4]\n id(ol)\n rslt = insert_many(ol,eles,locs,mode="original")\n ol\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' eles = copy.deepcopy(eles) locs = copy.deepcopy(locs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, locs.__len__()): if (locs[i] >= length): pass else: locs[i] = uniform_index(locs[i], length) tmp = sorted_refer_to(eles, locs) eles = tmp['list'] locs = tmp['referer'] label = eles.__len__() si = 0 ei = 0 for i in range(0, locs.__len__()): if (locs[i] >= length): label = i break else: ei = locs[i] new.extend(cpol[si:ei]) new.append(eles[i]) si = ei for i in range(label, locs.__len__()): new.append(eles[i]) new.extend(cpol[ei:]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
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)
elist/elist.py
insert_many
ihgazni2/elist
0
python
def insert_many(ol, eles, locs, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4,5]\n eles = [7,77,777]\n locs = [0,2,4]\n id(ol)\n new = insert_many(ol,eles,locs)\n ol\n new\n id(new)\n ####\n ol = [1,2,3,4,5]\n eles = [7,77,777]\n locs = [0,2,4]\n id(ol)\n rslt = insert_many(ol,eles,locs,mode="original")\n ol\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' eles = copy.deepcopy(eles) locs = copy.deepcopy(locs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, locs.__len__()): if (locs[i] >= length): pass else: locs[i] = uniform_index(locs[i], length) tmp = sorted_refer_to(eles, locs) eles = tmp['list'] locs = tmp['referer'] label = eles.__len__() si = 0 ei = 0 for i in range(0, locs.__len__()): if (locs[i] >= length): label = i break else: ei = locs[i] new.extend(cpol[si:ei]) new.append(eles[i]) si = ei for i in range(label, locs.__len__()): new.append(eles[i]) new.extend(cpol[ei:]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def insert_many(ol, eles, locs, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4,5]\n eles = [7,77,777]\n locs = [0,2,4]\n id(ol)\n new = insert_many(ol,eles,locs)\n ol\n new\n id(new)\n ####\n ol = [1,2,3,4,5]\n eles = [7,77,777]\n locs = [0,2,4]\n id(ol)\n rslt = insert_many(ol,eles,locs,mode="original")\n ol\n rslt\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' eles = copy.deepcopy(eles) locs = copy.deepcopy(locs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, locs.__len__()): if (locs[i] >= length): pass else: locs[i] = uniform_index(locs[i], length) tmp = sorted_refer_to(eles, locs) eles = tmp['list'] locs = tmp['referer'] label = eles.__len__() si = 0 ei = 0 for i in range(0, locs.__len__()): if (locs[i] >= length): label = i break else: ei = locs[i] new.extend(cpol[si:ei]) new.append(eles[i]) si = ei for i in range(label, locs.__len__()): new.append(eles[i]) new.extend(cpol[ei:]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>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)<|endoftext|>
b8b0a2bc2cf8dcc945e9e76ee016697577c91f7eb25a9cf9c453ae6ff1ed5410
def insert_sections_some(ol, *secs, **kwargs): "\n ol = initRange(0,20,1)\n ol\n loc = 6\n rslt = insert_sections_some(ol,['a','a','a'],['c','c','c','c'],index=loc)\n rslt\n ####\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' loc = kwargs['index'] secs = list(secs) secs = [concat(*secs)] locs = [loc] return insert_sections_many(ol, secs, locs, mode=mode)
ol = initRange(0,20,1) ol loc = 6 rslt = insert_sections_some(ol,['a','a','a'],['c','c','c','c'],index=loc) rslt ####
elist/elist.py
insert_sections_some
ihgazni2/elist
0
python
def insert_sections_some(ol, *secs, **kwargs): "\n ol = initRange(0,20,1)\n ol\n loc = 6\n rslt = insert_sections_some(ol,['a','a','a'],['c','c','c','c'],index=loc)\n rslt\n ####\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' loc = kwargs['index'] secs = list(secs) secs = [concat(*secs)] locs = [loc] return insert_sections_many(ol, secs, locs, mode=mode)
def insert_sections_some(ol, *secs, **kwargs): "\n ol = initRange(0,20,1)\n ol\n loc = 6\n rslt = insert_sections_some(ol,['a','a','a'],['c','c','c','c'],index=loc)\n rslt\n ####\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' loc = kwargs['index'] secs = list(secs) secs = [concat(*secs)] locs = [loc] return insert_sections_many(ol, secs, locs, mode=mode)<|docstring|>ol = initRange(0,20,1) ol loc = 6 rslt = insert_sections_some(ol,['a','a','a'],['c','c','c','c'],index=loc) rslt ####<|endoftext|>
3b4bb8fcc7ffa9d16b3c9ad6cb046f3c17a0d9e838024292201846be251797b5
def insert_section(ol, sec, loc, **kwargs): "\n ol = initRange(0,20,1)\n ol\n loc = 6\n sec = ['a','b','c','d']\n rslt = insert_section(ol,sec,loc)\n rslt\n ####\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' secs = [sec] locs = [loc] return insert_sections_many(ol, secs, locs, mode=mode)
ol = initRange(0,20,1) ol loc = 6 sec = ['a','b','c','d'] rslt = insert_section(ol,sec,loc) rslt ####
elist/elist.py
insert_section
ihgazni2/elist
0
python
def insert_section(ol, sec, loc, **kwargs): "\n ol = initRange(0,20,1)\n ol\n loc = 6\n sec = ['a','b','c','d']\n rslt = insert_section(ol,sec,loc)\n rslt\n ####\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' secs = [sec] locs = [loc] return insert_sections_many(ol, secs, locs, mode=mode)
def insert_section(ol, sec, loc, **kwargs): "\n ol = initRange(0,20,1)\n ol\n loc = 6\n sec = ['a','b','c','d']\n rslt = insert_section(ol,sec,loc)\n rslt\n ####\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' secs = [sec] locs = [loc] return insert_sections_many(ol, secs, locs, mode=mode)<|docstring|>ol = initRange(0,20,1) ol loc = 6 sec = ['a','b','c','d'] rslt = insert_section(ol,sec,loc) rslt ####<|endoftext|>
94f9d7f267f3c1051d0a5469c1a87f2d4e9226cdb504007387f7d962e6393ba7
def insert_sections_many(ol, secs, locs, **kwargs): "\n ol = initRange(0,20,1)\n ol\n locs = [1,6,14,9]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d']\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n ####\n ol\n locs = [0,3,6,9,12,15,16]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d']\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n ####\n ol\n locs = [1,6,14,9]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d'],\n ['e'],\n ['f','f','f','f'],\n [777,777,777,777]\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' secs = copy.deepcopy(secs) locs = copy.deepcopy(locs) brked = broken_seqs(ol, locs) seclen = secs.__len__() brklen = brked.__len__() if (locs[0] == 0): new = secs[0] length = (seclen - 1) if (length < brklen): for i in range(0, length): new.extend(brked[i]) new.extend(secs[(i + 1)]) for i in range(length, brklen): new.extend(brked[i]) elif (length == brklen): for i in range(0, length): new.extend(brked[i]) new.extend(secs[(i + 1)]) else: for i in range(0, brklen): new.extend(brked[i]) new.extend(secs[(i + 1)]) for i in range(brklen, length): new.extend(secs[i]) else: new = brked[0] length = (brklen - 1) if (length < seclen): for i in range(0, length): new.extend(secs[i]) new.extend(brked[(i + 1)]) for i in range(length, seclen): new.extend(secs[i]) elif (length == seclen): for i in range(0, length): new.extend(secs[i]) new.extend(brked[(i + 1)]) else: for i in range(0, seclen): new.extend(secs[i]) new.extend(brked[(i + 1)]) for i in range(seclen, length): new.extend(brked[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
ol = initRange(0,20,1) ol locs = [1,6,14,9] secs = [ ['a','a','a'], ['b','b'], ['c','c','c','c'], ['d','d'] ] rslt = insert_sections_many(ol,secs,locs) rslt #### ol locs = [0,3,6,9,12,15,16] secs = [ ['a','a','a'], ['b','b'], ['c','c','c','c'], ['d','d'] ] rslt = insert_sections_many(ol,secs,locs) rslt #### ol locs = [1,6,14,9] secs = [ ['a','a','a'], ['b','b'], ['c','c','c','c'], ['d','d'], ['e'], ['f','f','f','f'], [777,777,777,777] ] rslt = insert_sections_many(ol,secs,locs) rslt
elist/elist.py
insert_sections_many
ihgazni2/elist
0
python
def insert_sections_many(ol, secs, locs, **kwargs): "\n ol = initRange(0,20,1)\n ol\n locs = [1,6,14,9]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d']\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n ####\n ol\n locs = [0,3,6,9,12,15,16]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d']\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n ####\n ol\n locs = [1,6,14,9]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d'],\n ['e'],\n ['f','f','f','f'],\n [777,777,777,777]\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' secs = copy.deepcopy(secs) locs = copy.deepcopy(locs) brked = broken_seqs(ol, locs) seclen = secs.__len__() brklen = brked.__len__() if (locs[0] == 0): new = secs[0] length = (seclen - 1) if (length < brklen): for i in range(0, length): new.extend(brked[i]) new.extend(secs[(i + 1)]) for i in range(length, brklen): new.extend(brked[i]) elif (length == brklen): for i in range(0, length): new.extend(brked[i]) new.extend(secs[(i + 1)]) else: for i in range(0, brklen): new.extend(brked[i]) new.extend(secs[(i + 1)]) for i in range(brklen, length): new.extend(secs[i]) else: new = brked[0] length = (brklen - 1) if (length < seclen): for i in range(0, length): new.extend(secs[i]) new.extend(brked[(i + 1)]) for i in range(length, seclen): new.extend(secs[i]) elif (length == seclen): for i in range(0, length): new.extend(secs[i]) new.extend(brked[(i + 1)]) else: for i in range(0, seclen): new.extend(secs[i]) new.extend(brked[(i + 1)]) for i in range(seclen, length): new.extend(brked[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def insert_sections_many(ol, secs, locs, **kwargs): "\n ol = initRange(0,20,1)\n ol\n locs = [1,6,14,9]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d']\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n ####\n ol\n locs = [0,3,6,9,12,15,16]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d']\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n ####\n ol\n locs = [1,6,14,9]\n secs = [\n ['a','a','a'],\n ['b','b'],\n ['c','c','c','c'],\n ['d','d'],\n ['e'],\n ['f','f','f','f'],\n [777,777,777,777]\n ]\n rslt = insert_sections_many(ol,secs,locs)\n rslt\n " if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' secs = copy.deepcopy(secs) locs = copy.deepcopy(locs) brked = broken_seqs(ol, locs) seclen = secs.__len__() brklen = brked.__len__() if (locs[0] == 0): new = secs[0] length = (seclen - 1) if (length < brklen): for i in range(0, length): new.extend(brked[i]) new.extend(secs[(i + 1)]) for i in range(length, brklen): new.extend(brked[i]) elif (length == brklen): for i in range(0, length): new.extend(brked[i]) new.extend(secs[(i + 1)]) else: for i in range(0, brklen): new.extend(brked[i]) new.extend(secs[(i + 1)]) for i in range(brklen, length): new.extend(secs[i]) else: new = brked[0] length = (brklen - 1) if (length < seclen): for i in range(0, length): new.extend(secs[i]) new.extend(brked[(i + 1)]) for i in range(length, seclen): new.extend(secs[i]) elif (length == seclen): for i in range(0, length): new.extend(secs[i]) new.extend(brked[(i + 1)]) else: for i in range(0, seclen): new.extend(secs[i]) new.extend(brked[(i + 1)]) for i in range(seclen, length): new.extend(brked[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>ol = initRange(0,20,1) ol locs = [1,6,14,9] secs = [ ['a','a','a'], ['b','b'], ['c','c','c','c'], ['d','d'] ] rslt = insert_sections_many(ol,secs,locs) rslt #### ol locs = [0,3,6,9,12,15,16] secs = [ ['a','a','a'], ['b','b'], ['c','c','c','c'], ['d','d'] ] rslt = insert_sections_many(ol,secs,locs) rslt #### ol locs = [1,6,14,9] secs = [ ['a','a','a'], ['b','b'], ['c','c','c','c'], ['d','d'], ['e'], ['f','f','f','f'], [777,777,777,777] ] rslt = insert_sections_many(ol,secs,locs) rslt<|endoftext|>
f929c66eb9aea42ce10ca8bdc3d0b213cac1403158d350947a96e8c3f60412bb
def reorder_sub(ol, sub): "\n sub = ['query', 'params', 'fragment', 'path']\n ol = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment']\n reorder_sub(ol,sub)\n " def cond_func(ele, ol): index = ol.index(ele) return index indexes = array_map(sub, cond_func, ol) nsub = sorted_refer_to(sub, indexes)['list'] return nsub
sub = ['query', 'params', 'fragment', 'path'] ol = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment'] reorder_sub(ol,sub)
elist/elist.py
reorder_sub
ihgazni2/elist
0
python
def reorder_sub(ol, sub): "\n sub = ['query', 'params', 'fragment', 'path']\n ol = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment']\n reorder_sub(ol,sub)\n " def cond_func(ele, ol): index = ol.index(ele) return index indexes = array_map(sub, cond_func, ol) nsub = sorted_refer_to(sub, indexes)['list'] return nsub
def reorder_sub(ol, sub): "\n sub = ['query', 'params', 'fragment', 'path']\n ol = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment']\n reorder_sub(ol,sub)\n " def cond_func(ele, ol): index = ol.index(ele) return index indexes = array_map(sub, cond_func, ol) nsub = sorted_refer_to(sub, indexes)['list'] return nsub<|docstring|>sub = ['query', 'params', 'fragment', 'path'] ol = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment'] reorder_sub(ol,sub)<|endoftext|>
54da2e5be3df99fd23a357827517f139a115fbf8da7204e8de1c9b8fae7352c6
def sort(ol, **kwargs): '\n from elist.elist import *\n ol = [1,3,4,2]\n id(ol)\n new = sort(ol)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,3,4,2]\n id(ol)\n rslt = sort(ol,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.sort() return new else: ol.sort() return ol
from elist.elist import * ol = [1,3,4,2] id(ol) new = sort(ol) ol new id(ol) id(new) #### ol = [1,3,4,2] id(ol) rslt = sort(ol,mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
sort
ihgazni2/elist
0
python
def sort(ol, **kwargs): '\n from elist.elist import *\n ol = [1,3,4,2]\n id(ol)\n new = sort(ol)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,3,4,2]\n id(ol)\n rslt = sort(ol,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.sort() return new else: ol.sort() return ol
def sort(ol, **kwargs): '\n from elist.elist import *\n ol = [1,3,4,2]\n id(ol)\n new = sort(ol)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,3,4,2]\n id(ol)\n rslt = sort(ol,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.sort() return new else: ol.sort() return ol<|docstring|>from elist.elist import * ol = [1,3,4,2] id(ol) new = sort(ol) ol new id(ol) id(new) #### ol = [1,3,4,2] id(ol) rslt = sort(ol,mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
e55a34d0c2b483c74326f0a7022f889e55489fadd9af4cd520057de5a2823d5f
def sorted_refer_to(l, referer, reverse=False, **kwargs): '\n from elist.elist import *\n l = ["a","b","c"]\n referer = [7,8,6]\n sorted_refer_to(l,referer)\n {\'list\': [\'c\', \'a\', \'b\'], \'referer\': [6, 7, 8]}\n l\n referer\n >>>\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'both' tl = [] length = l.__len__() for i in range(0, length): ele = (l[i], referer[i]) tl.append(ele) tl = sorted(tl, key=itemgetter(1), reverse=reverse) sorted_l = [] sorted_r = [] for i in range(0, length): sorted_l.append(tl[i][0]) sorted_r.append(tl[i][1]) if (mode == 'only-list'): return sorted_l elif (mode == 'only-referer'): return referer else: return {'list': sorted_l, 'referer': sorted_r}
from elist.elist import * l = ["a","b","c"] referer = [7,8,6] sorted_refer_to(l,referer) {'list': ['c', 'a', 'b'], 'referer': [6, 7, 8]} l referer >>>
elist/elist.py
sorted_refer_to
ihgazni2/elist
0
python
def sorted_refer_to(l, referer, reverse=False, **kwargs): '\n from elist.elist import *\n l = ["a","b","c"]\n referer = [7,8,6]\n sorted_refer_to(l,referer)\n {\'list\': [\'c\', \'a\', \'b\'], \'referer\': [6, 7, 8]}\n l\n referer\n >>>\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'both' tl = [] length = l.__len__() for i in range(0, length): ele = (l[i], referer[i]) tl.append(ele) tl = sorted(tl, key=itemgetter(1), reverse=reverse) sorted_l = [] sorted_r = [] for i in range(0, length): sorted_l.append(tl[i][0]) sorted_r.append(tl[i][1]) if (mode == 'only-list'): return sorted_l elif (mode == 'only-referer'): return referer else: return {'list': sorted_l, 'referer': sorted_r}
def sorted_refer_to(l, referer, reverse=False, **kwargs): '\n from elist.elist import *\n l = ["a","b","c"]\n referer = [7,8,6]\n sorted_refer_to(l,referer)\n {\'list\': [\'c\', \'a\', \'b\'], \'referer\': [6, 7, 8]}\n l\n referer\n >>>\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'both' tl = [] length = l.__len__() for i in range(0, length): ele = (l[i], referer[i]) tl.append(ele) tl = sorted(tl, key=itemgetter(1), reverse=reverse) sorted_l = [] sorted_r = [] for i in range(0, length): sorted_l.append(tl[i][0]) sorted_r.append(tl[i][1]) if (mode == 'only-list'): return sorted_l elif (mode == 'only-referer'): return referer else: return {'list': sorted_l, 'referer': sorted_r}<|docstring|>from elist.elist import * l = ["a","b","c"] referer = [7,8,6] sorted_refer_to(l,referer) {'list': ['c', 'a', 'b'], 'referer': [6, 7, 8]} l referer >>><|endoftext|>
fe918b35a5ecb21f061d67a163aafa5ce017031e0550d4f5288b1ca659201070
def batsorted(referer, *lists, **kwargs): "\n from elist.elist import *\n referer = [4,2,3,1]\n l1 = ['a','b','c','d']\n l2 = [100,200,300,400]\n l3 = ['A','B','A','B']\n nl1,nl2,nl3 = batsorted(referer,l1,l2,l3)\n nl1\n nl2\n nl3\n nl1,nl2,nl3 = batsorted(referer,l1,l2,l3,reverse=True)\n nl1\n nl2\n nl3\n ####the batsorted will not modify the original lists\n l1\n l2\n l3\n " if ('reverse' in kwargs): reverse = kwargs['reverse'] else: reverse = False length = referer.__len__() indexes = list(range(0, length)) rslt = sorted_refer_to(indexes, referer, reverse=reverse) referer = rslt['referer'] indexes = rslt['list'] rslt = [] lists = copy.deepcopy(list(lists)) for i in range(0, lists.__len__()): l = lists[i] nl = [] for j in range(0, length): loc = indexes[j] nl.append(l[loc]) rslt.append(nl) return tuple(rslt)
from elist.elist import * referer = [4,2,3,1] l1 = ['a','b','c','d'] l2 = [100,200,300,400] l3 = ['A','B','A','B'] nl1,nl2,nl3 = batsorted(referer,l1,l2,l3) nl1 nl2 nl3 nl1,nl2,nl3 = batsorted(referer,l1,l2,l3,reverse=True) nl1 nl2 nl3 ####the batsorted will not modify the original lists l1 l2 l3
elist/elist.py
batsorted
ihgazni2/elist
0
python
def batsorted(referer, *lists, **kwargs): "\n from elist.elist import *\n referer = [4,2,3,1]\n l1 = ['a','b','c','d']\n l2 = [100,200,300,400]\n l3 = ['A','B','A','B']\n nl1,nl2,nl3 = batsorted(referer,l1,l2,l3)\n nl1\n nl2\n nl3\n nl1,nl2,nl3 = batsorted(referer,l1,l2,l3,reverse=True)\n nl1\n nl2\n nl3\n ####the batsorted will not modify the original lists\n l1\n l2\n l3\n " if ('reverse' in kwargs): reverse = kwargs['reverse'] else: reverse = False length = referer.__len__() indexes = list(range(0, length)) rslt = sorted_refer_to(indexes, referer, reverse=reverse) referer = rslt['referer'] indexes = rslt['list'] rslt = [] lists = copy.deepcopy(list(lists)) for i in range(0, lists.__len__()): l = lists[i] nl = [] for j in range(0, length): loc = indexes[j] nl.append(l[loc]) rslt.append(nl) return tuple(rslt)
def batsorted(referer, *lists, **kwargs): "\n from elist.elist import *\n referer = [4,2,3,1]\n l1 = ['a','b','c','d']\n l2 = [100,200,300,400]\n l3 = ['A','B','A','B']\n nl1,nl2,nl3 = batsorted(referer,l1,l2,l3)\n nl1\n nl2\n nl3\n nl1,nl2,nl3 = batsorted(referer,l1,l2,l3,reverse=True)\n nl1\n nl2\n nl3\n ####the batsorted will not modify the original lists\n l1\n l2\n l3\n " if ('reverse' in kwargs): reverse = kwargs['reverse'] else: reverse = False length = referer.__len__() indexes = list(range(0, length)) rslt = sorted_refer_to(indexes, referer, reverse=reverse) referer = rslt['referer'] indexes = rslt['list'] rslt = [] lists = copy.deepcopy(list(lists)) for i in range(0, lists.__len__()): l = lists[i] nl = [] for j in range(0, length): loc = indexes[j] nl.append(l[loc]) rslt.append(nl) return tuple(rslt)<|docstring|>from elist.elist import * referer = [4,2,3,1] l1 = ['a','b','c','d'] l2 = [100,200,300,400] l3 = ['A','B','A','B'] nl1,nl2,nl3 = batsorted(referer,l1,l2,l3) nl1 nl2 nl3 nl1,nl2,nl3 = batsorted(referer,l1,l2,l3,reverse=True) nl1 nl2 nl3 ####the batsorted will not modify the original lists l1 l2 l3<|endoftext|>
73d59bf11b300a3338640b162cdd28c7fbce62d1287b8c938b741dc288aac308
def sortDictList(dictList, **kwargs): "\n students = [\n {'name':'john','class':'A', 'year':15},\n {'name':'jane','class':'B', 'year':12},\n {'name':'dave','class':'B', 'year':10}\n ]\n \n rslt = sortDictList(students,cond_keys=['name','class','year'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['name','year','class'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['class','name','year'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['class','year','name'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['year','name','class'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['year','name','class'])\n pobj(rslt)\n " def default_eq_func(value1, value2): cond = (value1 == value2) return cond def default_gt_func(value1, value2): cond = (value1 > value2) return cond def default_lt_func(value1, value2): cond = (value1 < value2) return cond if ('eq_func' in kwargs): eq_func = kwargs['eq_func'] else: eq_func = default_eq_func if ('gt_func' in kwargs): gt_func = kwargs['gt_func'] else: gt_func = default_gt_func if ('lt_func' in kwargs): lt_func = kwargs['lt_func'] else: lt_func = default_lt_func if ('reverse' in kwargs): reverse = kwargs['reverse'] else: reverse = False keys = kwargs['cond_keys'] def cmp_dict(d1, d2): '\n ' length = keys.__len__() for i in range(0, length): key = keys[i] cond = eq_func(d1[key], d2[key]) if cond: pass else: cond = gt_func(d1[key], d2[key]) if cond: return 1 else: return (- 1) return 0 ndl = dictList ndl = sorted(ndl, key=functools.cmp_to_key(cmp_dict), reverse=reverse) return ndl
students = [ {'name':'john','class':'A', 'year':15}, {'name':'jane','class':'B', 'year':12}, {'name':'dave','class':'B', 'year':10} ] rslt = sortDictList(students,cond_keys=['name','class','year']) pobj(rslt) rslt = sortDictList(students,cond_keys=['name','year','class']) pobj(rslt) rslt = sortDictList(students,cond_keys=['class','name','year']) pobj(rslt) rslt = sortDictList(students,cond_keys=['class','year','name']) pobj(rslt) rslt = sortDictList(students,cond_keys=['year','name','class']) pobj(rslt) rslt = sortDictList(students,cond_keys=['year','name','class']) pobj(rslt)
elist/elist.py
sortDictList
ihgazni2/elist
0
python
def sortDictList(dictList, **kwargs): "\n students = [\n {'name':'john','class':'A', 'year':15},\n {'name':'jane','class':'B', 'year':12},\n {'name':'dave','class':'B', 'year':10}\n ]\n \n rslt = sortDictList(students,cond_keys=['name','class','year'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['name','year','class'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['class','name','year'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['class','year','name'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['year','name','class'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['year','name','class'])\n pobj(rslt)\n " def default_eq_func(value1, value2): cond = (value1 == value2) return cond def default_gt_func(value1, value2): cond = (value1 > value2) return cond def default_lt_func(value1, value2): cond = (value1 < value2) return cond if ('eq_func' in kwargs): eq_func = kwargs['eq_func'] else: eq_func = default_eq_func if ('gt_func' in kwargs): gt_func = kwargs['gt_func'] else: gt_func = default_gt_func if ('lt_func' in kwargs): lt_func = kwargs['lt_func'] else: lt_func = default_lt_func if ('reverse' in kwargs): reverse = kwargs['reverse'] else: reverse = False keys = kwargs['cond_keys'] def cmp_dict(d1, d2): '\n ' length = keys.__len__() for i in range(0, length): key = keys[i] cond = eq_func(d1[key], d2[key]) if cond: pass else: cond = gt_func(d1[key], d2[key]) if cond: return 1 else: return (- 1) return 0 ndl = dictList ndl = sorted(ndl, key=functools.cmp_to_key(cmp_dict), reverse=reverse) return ndl
def sortDictList(dictList, **kwargs): "\n students = [\n {'name':'john','class':'A', 'year':15},\n {'name':'jane','class':'B', 'year':12},\n {'name':'dave','class':'B', 'year':10}\n ]\n \n rslt = sortDictList(students,cond_keys=['name','class','year'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['name','year','class'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['class','name','year'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['class','year','name'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['year','name','class'])\n pobj(rslt)\n rslt = sortDictList(students,cond_keys=['year','name','class'])\n pobj(rslt)\n " def default_eq_func(value1, value2): cond = (value1 == value2) return cond def default_gt_func(value1, value2): cond = (value1 > value2) return cond def default_lt_func(value1, value2): cond = (value1 < value2) return cond if ('eq_func' in kwargs): eq_func = kwargs['eq_func'] else: eq_func = default_eq_func if ('gt_func' in kwargs): gt_func = kwargs['gt_func'] else: gt_func = default_gt_func if ('lt_func' in kwargs): lt_func = kwargs['lt_func'] else: lt_func = default_lt_func if ('reverse' in kwargs): reverse = kwargs['reverse'] else: reverse = False keys = kwargs['cond_keys'] def cmp_dict(d1, d2): '\n ' length = keys.__len__() for i in range(0, length): key = keys[i] cond = eq_func(d1[key], d2[key]) if cond: pass else: cond = gt_func(d1[key], d2[key]) if cond: return 1 else: return (- 1) return 0 ndl = dictList ndl = sorted(ndl, key=functools.cmp_to_key(cmp_dict), reverse=reverse) return ndl<|docstring|>students = [ {'name':'john','class':'A', 'year':15}, {'name':'jane','class':'B', 'year':12}, {'name':'dave','class':'B', 'year':10} ] rslt = sortDictList(students,cond_keys=['name','class','year']) pobj(rslt) rslt = sortDictList(students,cond_keys=['name','year','class']) pobj(rslt) rslt = sortDictList(students,cond_keys=['class','name','year']) pobj(rslt) rslt = sortDictList(students,cond_keys=['class','year','name']) pobj(rslt) rslt = sortDictList(students,cond_keys=['year','name','class']) pobj(rslt) rslt = sortDictList(students,cond_keys=['year','name','class']) pobj(rslt)<|endoftext|>
211877e0fb61acb46ae75b55780bcc67babedc07691d70eb19344546cf7c56ee
def index_first(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_first(ol,'a')\n ####index_first, array_index, indexOf are the same\n array_index(ol,'a')\n indexOf(ol,'a')\n " return ol.index(value)
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_first(ol,'a') ####index_first, array_index, indexOf are the same array_index(ol,'a') indexOf(ol,'a')
elist/elist.py
index_first
ihgazni2/elist
0
python
def index_first(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_first(ol,'a')\n ####index_first, array_index, indexOf are the same\n array_index(ol,'a')\n indexOf(ol,'a')\n " return ol.index(value)
def index_first(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_first(ol,'a')\n ####index_first, array_index, indexOf are the same\n array_index(ol,'a')\n indexOf(ol,'a')\n " return ol.index(value)<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_first(ol,'a') ####index_first, array_index, indexOf are the same array_index(ol,'a') indexOf(ol,'a')<|endoftext|>
ff91b2ff20630243ad1d65e48b262a48fced739697ae4bd42060462565d7bec8
def index_firstnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_firstnot(ol,'a')\n ####index_firstnot, array_indexnot, indexOfnot are the same\n array_indexnot(ol,'a')\n indexOfnot(ol,'a')\n " length = ol.__len__() for i in range(0, length): if (value == ol[i]): pass else: return i return None
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_firstnot(ol,'a') ####index_firstnot, array_indexnot, indexOfnot are the same array_indexnot(ol,'a') indexOfnot(ol,'a')
elist/elist.py
index_firstnot
ihgazni2/elist
0
python
def index_firstnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_firstnot(ol,'a')\n ####index_firstnot, array_indexnot, indexOfnot are the same\n array_indexnot(ol,'a')\n indexOfnot(ol,'a')\n " length = ol.__len__() for i in range(0, length): if (value == ol[i]): pass else: return i return None
def index_firstnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_firstnot(ol,'a')\n ####index_firstnot, array_indexnot, indexOfnot are the same\n array_indexnot(ol,'a')\n indexOfnot(ol,'a')\n " length = ol.__len__() for i in range(0, length): if (value == ol[i]): pass else: return i return None<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_firstnot(ol,'a') ####index_firstnot, array_indexnot, indexOfnot are the same array_indexnot(ol,'a') indexOfnot(ol,'a')<|endoftext|>
16acee7fdcfb4448675192dd3e7893484a08e03cbb7fc3d02b62f96a8fd6a7f5
def index_last(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_last(ol,'a')\n ####lastIndexOf is the same as index_last\n lastIndexOf(ol,'a')\n " length = ol.__len__() for i in range((length - 1), (- 1), (- 1)): if (value == ol[i]): return i else: pass return None
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_last(ol,'a') ####lastIndexOf is the same as index_last lastIndexOf(ol,'a')
elist/elist.py
index_last
ihgazni2/elist
0
python
def index_last(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_last(ol,'a')\n ####lastIndexOf is the same as index_last\n lastIndexOf(ol,'a')\n " length = ol.__len__() for i in range((length - 1), (- 1), (- 1)): if (value == ol[i]): return i else: pass return None
def index_last(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_last(ol,'a')\n ####lastIndexOf is the same as index_last\n lastIndexOf(ol,'a')\n " length = ol.__len__() for i in range((length - 1), (- 1), (- 1)): if (value == ol[i]): return i else: pass return None<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_last(ol,'a') ####lastIndexOf is the same as index_last lastIndexOf(ol,'a')<|endoftext|>
96475c3fcfbdde28ce146e6d1fd18029ea48fb22bf5126a9d6743ad5ece1e663
def index_lastnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_lastnot(ol,'a')\n ####lastIndexOfnot is the same as index_lastnot\n lastIndexOfnot(ol,'a')\n " length = ol.__len__() for i in range((length - 1), (- 1), (- 1)): if (value == ol[i]): pass else: return i return None
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_lastnot(ol,'a') ####lastIndexOfnot is the same as index_lastnot lastIndexOfnot(ol,'a')
elist/elist.py
index_lastnot
ihgazni2/elist
0
python
def index_lastnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_lastnot(ol,'a')\n ####lastIndexOfnot is the same as index_lastnot\n lastIndexOfnot(ol,'a')\n " length = ol.__len__() for i in range((length - 1), (- 1), (- 1)): if (value == ol[i]): pass else: return i return None
def index_lastnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_lastnot(ol,'a')\n ####lastIndexOfnot is the same as index_lastnot\n lastIndexOfnot(ol,'a')\n " length = ol.__len__() for i in range((length - 1), (- 1), (- 1)): if (value == ol[i]): pass else: return i return None<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_lastnot(ol,'a') ####lastIndexOfnot is the same as index_lastnot lastIndexOfnot(ol,'a')<|endoftext|>
7668bed5c1444a0ddf0578c26ca46f8c0c5ff4b0aba8e59be2b2dc4c26b6e749
def index_which(ol, value, which): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_which(ol,'a',0)\n index_which(ol,'a',1)\n index_which(ol,'a',2)\n index_which(ol,'a',3) == None\n " length = ol.__len__() seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq == which): return i else: pass else: pass return None
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_which(ol,'a',0) index_which(ol,'a',1) index_which(ol,'a',2) index_which(ol,'a',3) == None
elist/elist.py
index_which
ihgazni2/elist
0
python
def index_which(ol, value, which): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_which(ol,'a',0)\n index_which(ol,'a',1)\n index_which(ol,'a',2)\n index_which(ol,'a',3) == None\n " length = ol.__len__() seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq == which): return i else: pass else: pass return None
def index_which(ol, value, which): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_which(ol,'a',0)\n index_which(ol,'a',1)\n index_which(ol,'a',2)\n index_which(ol,'a',3) == None\n " length = ol.__len__() seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq == which): return i else: pass else: pass return None<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_which(ol,'a',0) index_which(ol,'a',1) index_which(ol,'a',2) index_which(ol,'a',3) == None<|endoftext|>
c4e22d3bd8b1961ee7b735b5e4efbf63611159ab8f8f998fc41d2e1458283677
def index_whichnot(ol, value, which): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_whichnot(ol,'a',0)\n index_whichnot(ol,'a',1)\n index_whichnot(ol,'a',2)\n " length = ol.__len__() seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq == which): return i else: pass return None
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_whichnot(ol,'a',0) index_whichnot(ol,'a',1) index_whichnot(ol,'a',2)
elist/elist.py
index_whichnot
ihgazni2/elist
0
python
def index_whichnot(ol, value, which): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_whichnot(ol,'a',0)\n index_whichnot(ol,'a',1)\n index_whichnot(ol,'a',2)\n " length = ol.__len__() seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq == which): return i else: pass return None
def index_whichnot(ol, value, which): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n index_whichnot(ol,'a',0)\n index_whichnot(ol,'a',1)\n index_whichnot(ol,'a',2)\n " length = ol.__len__() seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq == which): return i else: pass return None<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] index_whichnot(ol,'a',0) index_whichnot(ol,'a',1) index_whichnot(ol,'a',2)<|endoftext|>
6a50eae27b1c4fec78384f55ecc187ce4d91f49da6c7efc192146aa080a861db
def indexes_all(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_all(ol,'a')\n " length = ol.__len__() indexes = [] for i in range(0, length): if (value == ol[i]): indexes.append(i) else: pass return indexes
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_all(ol,'a')
elist/elist.py
indexes_all
ihgazni2/elist
0
python
def indexes_all(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_all(ol,'a')\n " length = ol.__len__() indexes = [] for i in range(0, length): if (value == ol[i]): indexes.append(i) else: pass return indexes
def indexes_all(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_all(ol,'a')\n " length = ol.__len__() indexes = [] for i in range(0, length): if (value == ol[i]): indexes.append(i) else: pass return indexes<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_all(ol,'a')<|endoftext|>
9dcc0a55f3df61f007e01cca7094ab7fabae7e9d1fef43deca7f97413a7911c6
def indexes_allnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_allnot(ol,'a')\n " length = ol.__len__() indexes = [] for i in range(0, length): if (value == ol[i]): pass else: indexes.append(i) return indexes
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_allnot(ol,'a')
elist/elist.py
indexes_allnot
ihgazni2/elist
0
python
def indexes_allnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_allnot(ol,'a')\n " length = ol.__len__() indexes = [] for i in range(0, length): if (value == ol[i]): pass else: indexes.append(i) return indexes
def indexes_allnot(ol, value): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_allnot(ol,'a')\n " length = ol.__len__() indexes = [] for i in range(0, length): if (value == ol[i]): pass else: indexes.append(i) return indexes<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_allnot(ol,'a')<|endoftext|>
38875f63e799683ce65339f9f4a299ceb5cd7f7693af9f21c68655e8695c208b
def indexes_some(ol, value, *seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_some(ol,'a',0,2)\n indexes_some(ol,'a',0,1)\n indexes_some(ol,'a',1,2)\n indexes_some(ol,'a',3,4)\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass else: pass return indexes
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_some(ol,'a',0,2) indexes_some(ol,'a',0,1) indexes_some(ol,'a',1,2) indexes_some(ol,'a',3,4)
elist/elist.py
indexes_some
ihgazni2/elist
0
python
def indexes_some(ol, value, *seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_some(ol,'a',0,2)\n indexes_some(ol,'a',0,1)\n indexes_some(ol,'a',1,2)\n indexes_some(ol,'a',3,4)\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass else: pass return indexes
def indexes_some(ol, value, *seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_some(ol,'a',0,2)\n indexes_some(ol,'a',0,1)\n indexes_some(ol,'a',1,2)\n indexes_some(ol,'a',3,4)\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass else: pass return indexes<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_some(ol,'a',0,2) indexes_some(ol,'a',0,1) indexes_some(ol,'a',1,2) indexes_some(ol,'a',3,4)<|endoftext|>
93e6310c93f9bd09f93ba3c2ccc549f883ec986931a9d43623d7312cc8ba0ab7
def indexes_somenot(ol, value, *seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_somenot(ol,'a',0,2)\n indexes_somenot(ol,'a',0,1)\n indexes_somenot(ol,'a',1,2)\n indexes_somenot(ol,'a',3,4)\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass return indexes
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_somenot(ol,'a',0,2) indexes_somenot(ol,'a',0,1) indexes_somenot(ol,'a',1,2) indexes_somenot(ol,'a',3,4)
elist/elist.py
indexes_somenot
ihgazni2/elist
0
python
def indexes_somenot(ol, value, *seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_somenot(ol,'a',0,2)\n indexes_somenot(ol,'a',0,1)\n indexes_somenot(ol,'a',1,2)\n indexes_somenot(ol,'a',3,4)\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass return indexes
def indexes_somenot(ol, value, *seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_somenot(ol,'a',0,2)\n indexes_somenot(ol,'a',0,1)\n indexes_somenot(ol,'a',1,2)\n indexes_somenot(ol,'a',3,4)\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass return indexes<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_somenot(ol,'a',0,2) indexes_somenot(ol,'a',0,1) indexes_somenot(ol,'a',1,2) indexes_somenot(ol,'a',3,4)<|endoftext|>
681a8458cc566b6df140b298267ec6b30e6edc5c00a41ad326757c98a2097870
def indexes_seqs(ol, value, seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_seqs(ol,'a',{0,2})\n indexes_seqs(ol,'a',{0,1})\n indexes_seqs(ol,'a',{1,2})\n indexes_seqs(ol,'a',{3,4})\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass else: pass return indexes
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_seqs(ol,'a',{0,2}) indexes_seqs(ol,'a',{0,1}) indexes_seqs(ol,'a',{1,2}) indexes_seqs(ol,'a',{3,4})
elist/elist.py
indexes_seqs
ihgazni2/elist
0
python
def indexes_seqs(ol, value, seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_seqs(ol,'a',{0,2})\n indexes_seqs(ol,'a',{0,1})\n indexes_seqs(ol,'a',{1,2})\n indexes_seqs(ol,'a',{3,4})\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass else: pass return indexes
def indexes_seqs(ol, value, seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_seqs(ol,'a',{0,2})\n indexes_seqs(ol,'a',{0,1})\n indexes_seqs(ol,'a',{1,2})\n indexes_seqs(ol,'a',{3,4})\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass else: pass return indexes<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_seqs(ol,'a',{0,2}) indexes_seqs(ol,'a',{0,1}) indexes_seqs(ol,'a',{1,2}) indexes_seqs(ol,'a',{3,4})<|endoftext|>
7a98fd453e4beb48f6225dfa8c845c78b154db3e9f00e620cc1bb66d28d63a24
def indexes_seqsnot(ol, value, seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_seqsnot(ol,'a',{0,2})\n indexes_seqsnot(ol,'a',{0,1})\n indexes_seqsnot(ol,'a',{1,2})\n indexes_seqsnot(ol,'a',{3,4})\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass return indexes
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_seqsnot(ol,'a',{0,2}) indexes_seqsnot(ol,'a',{0,1}) indexes_seqsnot(ol,'a',{1,2}) indexes_seqsnot(ol,'a',{3,4})
elist/elist.py
indexes_seqsnot
ihgazni2/elist
0
python
def indexes_seqsnot(ol, value, seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_seqsnot(ol,'a',{0,2})\n indexes_seqsnot(ol,'a',{0,1})\n indexes_seqsnot(ol,'a',{1,2})\n indexes_seqsnot(ol,'a',{3,4})\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass return indexes
def indexes_seqsnot(ol, value, seqs): "\n from elist.elist import *\n ol = [1,'a',3,'a',4,'a',5]\n indexes_seqsnot(ol,'a',{0,2})\n indexes_seqsnot(ol,'a',{0,1})\n indexes_seqsnot(ol,'a',{1,2})\n indexes_seqsnot(ol,'a',{3,4})\n " seqs = list(seqs) length = ol.__len__() indexes = [] seq = (- 1) for i in range(0, length): if (value == ol[i]): pass else: seq = (seq + 1) if (seq in seqs): indexes.append(i) else: pass return indexes<|docstring|>from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_seqsnot(ol,'a',{0,2}) indexes_seqsnot(ol,'a',{0,1}) indexes_seqsnot(ol,'a',{1,2}) indexes_seqsnot(ol,'a',{3,4})<|endoftext|>
576cdaf6ff95f7fdfe5377211728b41a23f9fb7481a422373f6f6ba9112aba12
def first_continuous_indexes_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n first_continuous_indexes_slice(ol,"a")\n ' length = ol.__len__() begin = None slice = [] for i in range(0, length): if (ol[i] == value): begin = i break else: pass if (begin == None): return None else: slice.append(begin) for i in range((begin + 1), length): if (ol[i] == value): slice.append(i) else: break return slice
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] first_continuous_indexes_slice(ol,"a")
elist/elist.py
first_continuous_indexes_slice
ihgazni2/elist
0
python
def first_continuous_indexes_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n first_continuous_indexes_slice(ol,"a")\n ' length = ol.__len__() begin = None slice = [] for i in range(0, length): if (ol[i] == value): begin = i break else: pass if (begin == None): return None else: slice.append(begin) for i in range((begin + 1), length): if (ol[i] == value): slice.append(i) else: break return slice
def first_continuous_indexes_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n first_continuous_indexes_slice(ol,"a")\n ' length = ol.__len__() begin = None slice = [] for i in range(0, length): if (ol[i] == value): begin = i break else: pass if (begin == None): return None else: slice.append(begin) for i in range((begin + 1), length): if (ol[i] == value): slice.append(i) else: break return slice<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] first_continuous_indexes_slice(ol,"a")<|endoftext|>
c964be0c7022ab0289511dd4aac1e67dbe03da99bb75f5d5948544cd94fbe3b5
def first_continuous_indexesnot_slice(ol, value): '\n from elist.elist import *\n ol = ["a",0,1,"a","a",2,3,"a",4,"a","a","a",5]\n first_continuous_indexesnot_slice(ol,"a")\n ' length = ol.__len__() begin = None slice = [] for i in range(0, length): if (not (ol[i] == value)): begin = i break else: pass if (begin == None): return None else: slice.append(begin) for i in range((begin + 1), length): if (not (ol[i] == value)): slice.append(i) else: break return slice
from elist.elist import * ol = ["a",0,1,"a","a",2,3,"a",4,"a","a","a",5] first_continuous_indexesnot_slice(ol,"a")
elist/elist.py
first_continuous_indexesnot_slice
ihgazni2/elist
0
python
def first_continuous_indexesnot_slice(ol, value): '\n from elist.elist import *\n ol = ["a",0,1,"a","a",2,3,"a",4,"a","a","a",5]\n first_continuous_indexesnot_slice(ol,"a")\n ' length = ol.__len__() begin = None slice = [] for i in range(0, length): if (not (ol[i] == value)): begin = i break else: pass if (begin == None): return None else: slice.append(begin) for i in range((begin + 1), length): if (not (ol[i] == value)): slice.append(i) else: break return slice
def first_continuous_indexesnot_slice(ol, value): '\n from elist.elist import *\n ol = ["a",0,1,"a","a",2,3,"a",4,"a","a","a",5]\n first_continuous_indexesnot_slice(ol,"a")\n ' length = ol.__len__() begin = None slice = [] for i in range(0, length): if (not (ol[i] == value)): begin = i break else: pass if (begin == None): return None else: slice.append(begin) for i in range((begin + 1), length): if (not (ol[i] == value)): slice.append(i) else: break return slice<|docstring|>from elist.elist import * ol = ["a",0,1,"a","a",2,3,"a",4,"a","a","a",5] first_continuous_indexesnot_slice(ol,"a")<|endoftext|>
e37958d6e919759ba16dc195ba247dbb2e5ecefe2d9a039b2e3b684ce150f664
def last_continuous_indexes_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n last_continuous_indexes_slice(ol,"a")\n ' length = ol.__len__() end = None slice = [] for i in range((length - 1), (- 1), (- 1)): if (ol[i] == value): end = i break else: pass if (end == None): return None else: slice.append(end) for i in range((end - 1), (- 1), (- 1)): if (ol[i] == value): slice.append(i) else: break slice.reverse() return slice
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] last_continuous_indexes_slice(ol,"a")
elist/elist.py
last_continuous_indexes_slice
ihgazni2/elist
0
python
def last_continuous_indexes_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n last_continuous_indexes_slice(ol,"a")\n ' length = ol.__len__() end = None slice = [] for i in range((length - 1), (- 1), (- 1)): if (ol[i] == value): end = i break else: pass if (end == None): return None else: slice.append(end) for i in range((end - 1), (- 1), (- 1)): if (ol[i] == value): slice.append(i) else: break slice.reverse() return slice
def last_continuous_indexes_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n last_continuous_indexes_slice(ol,"a")\n ' length = ol.__len__() end = None slice = [] for i in range((length - 1), (- 1), (- 1)): if (ol[i] == value): end = i break else: pass if (end == None): return None else: slice.append(end) for i in range((end - 1), (- 1), (- 1)): if (ol[i] == value): slice.append(i) else: break slice.reverse() return slice<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] last_continuous_indexes_slice(ol,"a")<|endoftext|>
380d3b5bc21b266e4deca3fbbf048e3afd733a82962200189b38af35e1f0d645
def last_continuous_indexesnot_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n last_continuous_indexesnot_slice(ol,"a")\n ' length = ol.__len__() end = None slice = [] for i in range((length - 1), (- 1), (- 1)): if (not (ol[i] == value)): end = i break else: pass if (end == None): return None else: slice.append(end) for i in range((end - 1), (- 1), (- 1)): if (not (ol[i] == value)): slice.append(i) else: break slice.reverse() return slice
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] last_continuous_indexesnot_slice(ol,"a")
elist/elist.py
last_continuous_indexesnot_slice
ihgazni2/elist
0
python
def last_continuous_indexesnot_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n last_continuous_indexesnot_slice(ol,"a")\n ' length = ol.__len__() end = None slice = [] for i in range((length - 1), (- 1), (- 1)): if (not (ol[i] == value)): end = i break else: pass if (end == None): return None else: slice.append(end) for i in range((end - 1), (- 1), (- 1)): if (not (ol[i] == value)): slice.append(i) else: break slice.reverse() return slice
def last_continuous_indexesnot_slice(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n last_continuous_indexesnot_slice(ol,"a")\n ' length = ol.__len__() end = None slice = [] for i in range((length - 1), (- 1), (- 1)): if (not (ol[i] == value)): end = i break else: pass if (end == None): return None else: slice.append(end) for i in range((end - 1), (- 1), (- 1)): if (not (ol[i] == value)): slice.append(i) else: break slice.reverse() return slice<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] last_continuous_indexesnot_slice(ol,"a")<|endoftext|>
81edbf65b3fb15f1522905d9226c064030feb8d2d60da8a59b946afdefc109d3
def which_continuous_indexes_slice(ol, value, which): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n which_continuous_indexes_slice(ol,"a",0)\n which_continuous_indexes_slice(ol,"a",1)\n which_continuous_indexes_slice(ol,"a",2)\n which_continuous_indexes_slice(ol,"a",3)\n which_continuous_indexes_slice(ol,"b",0)\n ' length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) cursor = (cursor + 1) elif (cond1 & (not cond2)): slice.append(cursor) cursor = (cursor + 1) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq == which): return slice else: cursor = (cursor + 1) begin = None slice = [] else: cursor = (cursor + 1) if slice: seq = (seq + 1) else: pass if (seq == which): return slice else: return []
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] which_continuous_indexes_slice(ol,"a",0) which_continuous_indexes_slice(ol,"a",1) which_continuous_indexes_slice(ol,"a",2) which_continuous_indexes_slice(ol,"a",3) which_continuous_indexes_slice(ol,"b",0)
elist/elist.py
which_continuous_indexes_slice
ihgazni2/elist
0
python
def which_continuous_indexes_slice(ol, value, which): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n which_continuous_indexes_slice(ol,"a",0)\n which_continuous_indexes_slice(ol,"a",1)\n which_continuous_indexes_slice(ol,"a",2)\n which_continuous_indexes_slice(ol,"a",3)\n which_continuous_indexes_slice(ol,"b",0)\n ' length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) cursor = (cursor + 1) elif (cond1 & (not cond2)): slice.append(cursor) cursor = (cursor + 1) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq == which): return slice else: cursor = (cursor + 1) begin = None slice = [] else: cursor = (cursor + 1) if slice: seq = (seq + 1) else: pass if (seq == which): return slice else: return []
def which_continuous_indexes_slice(ol, value, which): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n which_continuous_indexes_slice(ol,"a",0)\n which_continuous_indexes_slice(ol,"a",1)\n which_continuous_indexes_slice(ol,"a",2)\n which_continuous_indexes_slice(ol,"a",3)\n which_continuous_indexes_slice(ol,"b",0)\n ' length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) cursor = (cursor + 1) elif (cond1 & (not cond2)): slice.append(cursor) cursor = (cursor + 1) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq == which): return slice else: cursor = (cursor + 1) begin = None slice = [] else: cursor = (cursor + 1) if slice: seq = (seq + 1) else: pass if (seq == which): return slice else: return []<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] which_continuous_indexes_slice(ol,"a",0) which_continuous_indexes_slice(ol,"a",1) which_continuous_indexes_slice(ol,"a",2) which_continuous_indexes_slice(ol,"a",3) which_continuous_indexes_slice(ol,"b",0)<|endoftext|>
fd699ee8d236d33b2d686a88ecd14ed78e522e252c91a3e24c4501fabcbaca1e
def which_continuous_indexesnot_slice(ol, value, which): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n which_continuous_indexesnot_slice(ol,"a",0)\n which_continuous_indexesnot_slice(ol,"a",1)\n which_continuous_indexesnot_slice(ol,"a",2)\n which_continuous_indexesnot_slice(ol,"a",3)\n which_continuous_indexesnot_slice(ol,"b",0)\n ' length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) cursor = (cursor + 1) elif (cond1 & (not cond2)): slice.append(cursor) cursor = (cursor + 1) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq == which): return slice else: cursor = (cursor + 1) begin = None slice = [] else: cursor = (cursor + 1) if slice: seq = (seq + 1) else: pass if (seq == which): return slice else: return []
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] which_continuous_indexesnot_slice(ol,"a",0) which_continuous_indexesnot_slice(ol,"a",1) which_continuous_indexesnot_slice(ol,"a",2) which_continuous_indexesnot_slice(ol,"a",3) which_continuous_indexesnot_slice(ol,"b",0)
elist/elist.py
which_continuous_indexesnot_slice
ihgazni2/elist
0
python
def which_continuous_indexesnot_slice(ol, value, which): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n which_continuous_indexesnot_slice(ol,"a",0)\n which_continuous_indexesnot_slice(ol,"a",1)\n which_continuous_indexesnot_slice(ol,"a",2)\n which_continuous_indexesnot_slice(ol,"a",3)\n which_continuous_indexesnot_slice(ol,"b",0)\n ' length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) cursor = (cursor + 1) elif (cond1 & (not cond2)): slice.append(cursor) cursor = (cursor + 1) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq == which): return slice else: cursor = (cursor + 1) begin = None slice = [] else: cursor = (cursor + 1) if slice: seq = (seq + 1) else: pass if (seq == which): return slice else: return []
def which_continuous_indexesnot_slice(ol, value, which): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n which_continuous_indexesnot_slice(ol,"a",0)\n which_continuous_indexesnot_slice(ol,"a",1)\n which_continuous_indexesnot_slice(ol,"a",2)\n which_continuous_indexesnot_slice(ol,"a",3)\n which_continuous_indexesnot_slice(ol,"b",0)\n ' length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) cursor = (cursor + 1) elif (cond1 & (not cond2)): slice.append(cursor) cursor = (cursor + 1) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq == which): return slice else: cursor = (cursor + 1) begin = None slice = [] else: cursor = (cursor + 1) if slice: seq = (seq + 1) else: pass if (seq == which): return slice else: return []<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] which_continuous_indexesnot_slice(ol,"a",0) which_continuous_indexesnot_slice(ol,"a",1) which_continuous_indexesnot_slice(ol,"a",2) which_continuous_indexesnot_slice(ol,"a",3) which_continuous_indexesnot_slice(ol,"b",0)<|endoftext|>
6902e8640363927d5d7464b2113be46c075e2ab886da6e64b13df11dc59418e1
def some_continuous_indexes_slices(ol, value, *seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n some_continuous_indexes_slices(ol,"a",0,2)\n ' seqs = list(seqs) rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] some_continuous_indexes_slices(ol,"a",0,2)
elist/elist.py
some_continuous_indexes_slices
ihgazni2/elist
0
python
def some_continuous_indexes_slices(ol, value, *seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n some_continuous_indexes_slices(ol,"a",0,2)\n ' seqs = list(seqs) rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
def some_continuous_indexes_slices(ol, value, *seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n some_continuous_indexes_slices(ol,"a",0,2)\n ' seqs = list(seqs) rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] some_continuous_indexes_slices(ol,"a",0,2)<|endoftext|>
5c25c623291fcb8b4239703ca51d1e76ebb67ea635ffa5adddcb9bd0ef05db24
def some_continuous_indexesnot_slices(ol, value, *seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n some_continuous_indexesnot_slices(ol,"a",0,2)\n ' seqs = list(seqs) rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] some_continuous_indexesnot_slices(ol,"a",0,2)
elist/elist.py
some_continuous_indexesnot_slices
ihgazni2/elist
0
python
def some_continuous_indexesnot_slices(ol, value, *seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n some_continuous_indexesnot_slices(ol,"a",0,2)\n ' seqs = list(seqs) rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
def some_continuous_indexesnot_slices(ol, value, *seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n some_continuous_indexesnot_slices(ol,"a",0,2)\n ' seqs = list(seqs) rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] some_continuous_indexesnot_slices(ol,"a",0,2)<|endoftext|>
2ea2790019fe40e25556bdb49d4b0e4c6e5f002b238ca6fc983ef09df67e3f9f
def seqs_continuous_indexes_slices(ol, value, seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n seqs_continuous_indexes_slices(ol,"a",{0,2})\n ' rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] seqs_continuous_indexes_slices(ol,"a",{0,2})
elist/elist.py
seqs_continuous_indexes_slices
ihgazni2/elist
0
python
def seqs_continuous_indexes_slices(ol, value, seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n seqs_continuous_indexes_slices(ol,"a",{0,2})\n ' rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
def seqs_continuous_indexes_slices(ol, value, seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n seqs_continuous_indexes_slices(ol,"a",{0,2})\n ' rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] seqs_continuous_indexes_slices(ol,"a",{0,2})<|endoftext|>
263d2c1dfaf66309e2024622f0b18481340be390f8ce7ff0dc31643a3f9d4f8f
def seqs_continuous_indexesnot_slices(ol, value, seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n seqs_continuous_indexesnot_slices(ol,"a",{0,2})\n ' rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] seqs_continuous_indexesnot_slices(ol,"a",{0,2})
elist/elist.py
seqs_continuous_indexesnot_slices
ihgazni2/elist
0
python
def seqs_continuous_indexesnot_slices(ol, value, seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n seqs_continuous_indexesnot_slices(ol,"a",{0,2})\n ' rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt
def seqs_continuous_indexesnot_slices(ol, value, seqs): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n seqs_continuous_indexesnot_slices(ol,"a",{0,2})\n ' rslt = [] length = ol.__len__() seq = (- 1) cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass begin = None slice = [] else: pass cursor = (cursor + 1) if slice: seq = (seq + 1) if (seq in seqs): rslt.append(slice) else: pass else: pass return rslt<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] seqs_continuous_indexesnot_slices(ol,"a",{0,2})<|endoftext|>
7d0db84d0c835bc88c8c74d289db98213a4a808e1c8fecd2e0f7a0fd6b65e269
def all_continuous_indexes_slices(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n all_continuous_indexes_slices(ol,"a")\n ' rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] all_continuous_indexes_slices(ol,"a")
elist/elist.py
all_continuous_indexes_slices
ihgazni2/elist
0
python
def all_continuous_indexes_slices(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n all_continuous_indexes_slices(ol,"a")\n ' rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt
def all_continuous_indexes_slices(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n all_continuous_indexes_slices(ol,"a")\n ' rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (ol[cursor] == value) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] all_continuous_indexes_slices(ol,"a")<|endoftext|>
b27a1d43256310b63c9dfa76758d6c9c7cead4b26ed3a727e584639e8af5c307
def all_continuous_indexesnot_slices(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n all_continuous_indexesnot_slices(ol,"a")\n ' rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt
from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] all_continuous_indexesnot_slices(ol,"a")
elist/elist.py
all_continuous_indexesnot_slices
ihgazni2/elist
0
python
def all_continuous_indexesnot_slices(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n all_continuous_indexesnot_slices(ol,"a")\n ' rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt
def all_continuous_indexesnot_slices(ol, value): '\n from elist.elist import *\n ol = [1,"a","a",2,3,"a",4,"a","a","a",5]\n all_continuous_indexesnot_slices(ol,"a")\n ' rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = (not (ol[cursor] == value)) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt<|docstring|>from elist.elist import * ol = [1,"a","a",2,3,"a",4,"a","a","a",5] all_continuous_indexesnot_slices(ol,"a")<|endoftext|>
91d59949b59d35989ae200c95a15ff631d731663668bc0827e16d936adbfcf9f
def vgroupi(ol, *args, **kwargs): '\n vgroupi([0, 0, 0, 1, 2, 0, 2],0)\n [[0, 1, 2], [5]]\n ' cond_func = (_dflt_vgroup_cond_func if (not ('cond_func' in kwargs)) else kwargs['cond_func']) rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = cond_func(ol[cursor], *args) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt
vgroupi([0, 0, 0, 1, 2, 0, 2],0) [[0, 1, 2], [5]]
elist/elist.py
vgroupi
ihgazni2/elist
0
python
def vgroupi(ol, *args, **kwargs): '\n vgroupi([0, 0, 0, 1, 2, 0, 2],0)\n [[0, 1, 2], [5]]\n ' cond_func = (_dflt_vgroup_cond_func if (not ('cond_func' in kwargs)) else kwargs['cond_func']) rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = cond_func(ol[cursor], *args) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt
def vgroupi(ol, *args, **kwargs): '\n vgroupi([0, 0, 0, 1, 2, 0, 2],0)\n [[0, 1, 2], [5]]\n ' cond_func = (_dflt_vgroup_cond_func if (not ('cond_func' in kwargs)) else kwargs['cond_func']) rslt = [] length = ol.__len__() cursor = 0 begin = None slice = [] while (cursor < length): cond1 = cond_func(ol[cursor], *args) cond2 = (begin == None) if (cond1 & cond2): begin = cursor slice.append(cursor) elif (cond1 & (not cond2)): slice.append(cursor) elif ((not cond1) & (not cond2)): rslt.append(slice) begin = None slice = [] else: pass cursor = (cursor + 1) if slice: rslt.append(slice) else: pass return rslt<|docstring|>vgroupi([0, 0, 0, 1, 2, 0, 2],0) [[0, 1, 2], [5]]<|endoftext|>
8401a42e1160b85de1a2811f9a6290dd4b0f702441735876438e3f0f90616a81
def vgroupi_brkseqs(ol, *args, **kwargs): '\n >>> vgroupi_brkseqs([0, 0, 0, 1, 2, 0, 2],0)\n [3, 6]\n ' slc = vgroupi(ol, *args, **kwargs) brkseqs = list(map((lambda ele: (ele[(- 1)] + 1)), slc)) return brkseqs
>>> vgroupi_brkseqs([0, 0, 0, 1, 2, 0, 2],0) [3, 6]
elist/elist.py
vgroupi_brkseqs
ihgazni2/elist
0
python
def vgroupi_brkseqs(ol, *args, **kwargs): '\n >>> vgroupi_brkseqs([0, 0, 0, 1, 2, 0, 2],0)\n [3, 6]\n ' slc = vgroupi(ol, *args, **kwargs) brkseqs = list(map((lambda ele: (ele[(- 1)] + 1)), slc)) return brkseqs
def vgroupi_brkseqs(ol, *args, **kwargs): '\n >>> vgroupi_brkseqs([0, 0, 0, 1, 2, 0, 2],0)\n [3, 6]\n ' slc = vgroupi(ol, *args, **kwargs) brkseqs = list(map((lambda ele: (ele[(- 1)] + 1)), slc)) return brkseqs<|docstring|>>>> vgroupi_brkseqs([0, 0, 0, 1, 2, 0, 2],0) [3, 6]<|endoftext|>
de01db10df0c6464779cf68ea19bb23a0aabc3d44d61963e14f8ecebb3f01f89
def refl_brkseqs(refl): '\n >>> refl_brkseqs([0, 0, 0, 1, 2, 2, 2])\n [3, 4]\n ' brks = [] prev_value = refl[0] for i in range(1, len(refl)): curr_value = refl[i] if (curr_value == prev_value): pass else: brks.append(i) prev_value = curr_value return brks
>>> refl_brkseqs([0, 0, 0, 1, 2, 2, 2]) [3, 4]
elist/elist.py
refl_brkseqs
ihgazni2/elist
0
python
def refl_brkseqs(refl): '\n >>> refl_brkseqs([0, 0, 0, 1, 2, 2, 2])\n [3, 4]\n ' brks = [] prev_value = refl[0] for i in range(1, len(refl)): curr_value = refl[i] if (curr_value == prev_value): pass else: brks.append(i) prev_value = curr_value return brks
def refl_brkseqs(refl): '\n >>> refl_brkseqs([0, 0, 0, 1, 2, 2, 2])\n [3, 4]\n ' brks = [] prev_value = refl[0] for i in range(1, len(refl)): curr_value = refl[i] if (curr_value == prev_value): pass else: brks.append(i) prev_value = curr_value return brks<|docstring|>>>> refl_brkseqs([0, 0, 0, 1, 2, 2, 2]) [3, 4]<|endoftext|>
c5629ea1e669f5831a86b13da2ad016322cdac7ea31eed1d1090d6c91b92cdb3
def refl_vgroupv(refl): '\n >>> refl_vgroupv([0, 0, 0, 1, 2, 2, 2])\n [[0, 0, 0], [1], [2, 2, 2]]\n ' rslts = [] prev_value = refl[0] prev_index = 0 for i in range(1, len(refl)): curr_value = refl[i] if (curr_value == prev_value): pass else: slc = refl[prev_index:i] rslts.append(slc) prev_value = curr_value prev_index = i slc = refl[prev_index:] rslts.append(slc) return rslts
>>> refl_vgroupv([0, 0, 0, 1, 2, 2, 2]) [[0, 0, 0], [1], [2, 2, 2]]
elist/elist.py
refl_vgroupv
ihgazni2/elist
0
python
def refl_vgroupv(refl): '\n >>> refl_vgroupv([0, 0, 0, 1, 2, 2, 2])\n [[0, 0, 0], [1], [2, 2, 2]]\n ' rslts = [] prev_value = refl[0] prev_index = 0 for i in range(1, len(refl)): curr_value = refl[i] if (curr_value == prev_value): pass else: slc = refl[prev_index:i] rslts.append(slc) prev_value = curr_value prev_index = i slc = refl[prev_index:] rslts.append(slc) return rslts
def refl_vgroupv(refl): '\n >>> refl_vgroupv([0, 0, 0, 1, 2, 2, 2])\n [[0, 0, 0], [1], [2, 2, 2]]\n ' rslts = [] prev_value = refl[0] prev_index = 0 for i in range(1, len(refl)): curr_value = refl[i] if (curr_value == prev_value): pass else: slc = refl[prev_index:i] rslts.append(slc) prev_value = curr_value prev_index = i slc = refl[prev_index:] rslts.append(slc) return rslts<|docstring|>>>> refl_vgroupv([0, 0, 0, 1, 2, 2, 2]) [[0, 0, 0], [1], [2, 2, 2]]<|endoftext|>
96fdd6538c1246da1ea2fcaa80af6ddc91572233dfa3cc4b8b667074899f6270
def refl_vgroupi(refl): '\n >>> refl_vgroupi([0, 0, 0, 1, 2, 2, 2])\n [[0, 1, 2], [3], [4, 5, 6]]\n ' rslts = [] prev_value = refl[0] prev_index = 0 lngth = len(refl) for i in range(1, lngth): curr_value = refl[i] if (curr_value == prev_value): pass else: slc = list(range(prev_index, i)) rslts.append(slc) prev_value = curr_value prev_index = i slc = list(range(prev_index, lngth)) rslts.append(slc) return rslts
>>> refl_vgroupi([0, 0, 0, 1, 2, 2, 2]) [[0, 1, 2], [3], [4, 5, 6]]
elist/elist.py
refl_vgroupi
ihgazni2/elist
0
python
def refl_vgroupi(refl): '\n >>> refl_vgroupi([0, 0, 0, 1, 2, 2, 2])\n [[0, 1, 2], [3], [4, 5, 6]]\n ' rslts = [] prev_value = refl[0] prev_index = 0 lngth = len(refl) for i in range(1, lngth): curr_value = refl[i] if (curr_value == prev_value): pass else: slc = list(range(prev_index, i)) rslts.append(slc) prev_value = curr_value prev_index = i slc = list(range(prev_index, lngth)) rslts.append(slc) return rslts
def refl_vgroupi(refl): '\n >>> refl_vgroupi([0, 0, 0, 1, 2, 2, 2])\n [[0, 1, 2], [3], [4, 5, 6]]\n ' rslts = [] prev_value = refl[0] prev_index = 0 lngth = len(refl) for i in range(1, lngth): curr_value = refl[i] if (curr_value == prev_value): pass else: slc = list(range(prev_index, i)) rslts.append(slc) prev_value = curr_value prev_index = i slc = list(range(prev_index, lngth)) rslts.append(slc) return rslts<|docstring|>>>> refl_vgroupi([0, 0, 0, 1, 2, 2, 2]) [[0, 1, 2], [3], [4, 5, 6]]<|endoftext|>
b540f8044686e38894f7987e101bcd0623d6d62f20ab6bf2cad7f38c5404796a
def groupv_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> groupv_via_same(l)\n [[1], [\'a\', \'a\'], [2, 2], [\'a\'], [1], [\'a\'], [\'b\'], [\'a\'], [5], [\'b\', \'b\', \'b\']]\n >>>\n ' rslt = [] lngth = len(l) if (lngth == 0): return [] else: cursor = 0 value = l[0] cache = [] while (cursor < lngth): cond = (l[cursor] == value) if cond: cache.append(value) else: rslt.append(cache) value = l[cursor] cache = [value] cursor = (cursor + 1) if (len(cache) > 0): rslt.append(cache) return rslt
l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"] >>> groupv_via_same(l) [[1], ['a', 'a'], [2, 2], ['a'], [1], ['a'], ['b'], ['a'], [5], ['b', 'b', 'b']] >>>
elist/elist.py
groupv_via_same
ihgazni2/elist
0
python
def groupv_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> groupv_via_same(l)\n [[1], [\'a\', \'a\'], [2, 2], [\'a\'], [1], [\'a\'], [\'b\'], [\'a\'], [5], [\'b\', \'b\', \'b\']]\n >>>\n ' rslt = [] lngth = len(l) if (lngth == 0): return [] else: cursor = 0 value = l[0] cache = [] while (cursor < lngth): cond = (l[cursor] == value) if cond: cache.append(value) else: rslt.append(cache) value = l[cursor] cache = [value] cursor = (cursor + 1) if (len(cache) > 0): rslt.append(cache) return rslt
def groupv_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> groupv_via_same(l)\n [[1], [\'a\', \'a\'], [2, 2], [\'a\'], [1], [\'a\'], [\'b\'], [\'a\'], [5], [\'b\', \'b\', \'b\']]\n >>>\n ' rslt = [] lngth = len(l) if (lngth == 0): return [] else: cursor = 0 value = l[0] cache = [] while (cursor < lngth): cond = (l[cursor] == value) if cond: cache.append(value) else: rslt.append(cache) value = l[cursor] cache = [value] cursor = (cursor + 1) if (len(cache) > 0): rslt.append(cache) return rslt<|docstring|>l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"] >>> groupv_via_same(l) [[1], ['a', 'a'], [2, 2], ['a'], [1], ['a'], ['b'], ['a'], [5], ['b', 'b', 'b']] >>><|endoftext|>
58789314649a2a67c0a63a7f981a20709b669bf245dbacdc42e4aea65dd1e5d4
def groupi_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> groupi_via_same(l)\n [[0], [1, 2], [3, 4], [5], [6], [7], [8], [9], [10], [11, 12, 13]]\n >>>\n ' rslt = [] lngth = len(l) if (lngth == 0): return [] else: cursor = 0 value = l[0] cache = [] while (cursor < lngth): cond = (l[cursor] == value) if cond: cache.append(cursor) else: rslt.append(cache) value = l[cursor] cache = [cursor] cursor = (cursor + 1) if (len(cache) > 0): rslt.append(cache) return rslt
l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"] >>> groupi_via_same(l) [[0], [1, 2], [3, 4], [5], [6], [7], [8], [9], [10], [11, 12, 13]] >>>
elist/elist.py
groupi_via_same
ihgazni2/elist
0
python
def groupi_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> groupi_via_same(l)\n [[0], [1, 2], [3, 4], [5], [6], [7], [8], [9], [10], [11, 12, 13]]\n >>>\n ' rslt = [] lngth = len(l) if (lngth == 0): return [] else: cursor = 0 value = l[0] cache = [] while (cursor < lngth): cond = (l[cursor] == value) if cond: cache.append(cursor) else: rslt.append(cache) value = l[cursor] cache = [cursor] cursor = (cursor + 1) if (len(cache) > 0): rslt.append(cache) return rslt
def groupi_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> groupi_via_same(l)\n [[0], [1, 2], [3, 4], [5], [6], [7], [8], [9], [10], [11, 12, 13]]\n >>>\n ' rslt = [] lngth = len(l) if (lngth == 0): return [] else: cursor = 0 value = l[0] cache = [] while (cursor < lngth): cond = (l[cursor] == value) if cond: cache.append(cursor) else: rslt.append(cache) value = l[cursor] cache = [cursor] cursor = (cursor + 1) if (len(cache) > 0): rslt.append(cache) return rslt<|docstring|>l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"] >>> groupi_via_same(l) [[0], [1, 2], [3, 4], [5], [6], [7], [8], [9], [10], [11, 12, 13]] >>><|endoftext|>
617e58f1f8d1ecd2757cf22b0d6378da2a846a885d0207707bece7ce45be87d5
def group_range_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> group_range_via_same(l)\n [[0, 1], [1, 3], [3, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 14]]\n >>>\n ' def map_func(ele): if (len(ele) == 1): ele = [ele[0], (ele[0] + 1)] else: ele = [ele[0], (ele[(- 1)] + 1)] return ele arr = groupi_via_same(l) rngs = elel.mapv(arr, map_func) return rngs
l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"] >>> group_range_via_same(l) [[0, 1], [1, 3], [3, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 14]] >>>
elist/elist.py
group_range_via_same
ihgazni2/elist
0
python
def group_range_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> group_range_via_same(l)\n [[0, 1], [1, 3], [3, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 14]]\n >>>\n ' def map_func(ele): if (len(ele) == 1): ele = [ele[0], (ele[0] + 1)] else: ele = [ele[0], (ele[(- 1)] + 1)] return ele arr = groupi_via_same(l) rngs = elel.mapv(arr, map_func) return rngs
def group_range_via_same(l): '\n l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"]\n >>> group_range_via_same(l)\n [[0, 1], [1, 3], [3, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 14]]\n >>>\n ' def map_func(ele): if (len(ele) == 1): ele = [ele[0], (ele[0] + 1)] else: ele = [ele[0], (ele[(- 1)] + 1)] return ele arr = groupi_via_same(l) rngs = elel.mapv(arr, map_func) return rngs<|docstring|>l = [1,"a","a",2,2,"a",1,"a","b","a",5,"b","b","b"] >>> group_range_via_same(l) [[0, 1], [1, 3], [3, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 14]] >>><|endoftext|>
c1fa0bf735660a161b64cfca974c949af483381401a0df0e1234579e1a75f550
def shift(ol, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n rslt = shift(ol)\n pobj(rslt)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = shift(ol,mode="original")\n rslt\n ol\n id(ol)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() rslt = pop(ol, 0, mode=mode) return rslt
from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4] id(ol) rslt = shift(ol) pobj(rslt) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4] id(ol) rslt = shift(ol,mode="original") rslt ol id(ol)
elist/elist.py
shift
ihgazni2/elist
0
python
def shift(ol, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n rslt = shift(ol)\n pobj(rslt)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = shift(ol,mode="original")\n rslt\n ol\n id(ol)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() rslt = pop(ol, 0, mode=mode) return rslt
def shift(ol, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n rslt = shift(ol)\n pobj(rslt)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = shift(ol,mode="original")\n rslt\n ol\n id(ol)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() rslt = pop(ol, 0, mode=mode) return rslt<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4] id(ol) rslt = shift(ol) pobj(rslt) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4] id(ol) rslt = shift(ol,mode="original") rslt ol id(ol)<|endoftext|>
a0d3bf094b0f107c7693d55ea84ea9f43279fb5ca89fc09f005cbc2858b6c6a2
def pop(ol, index, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n rslt = pop(ol,2)\n pobj(rslt)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = pop(ol,2,mode="original")\n rslt\n ol\n id(ol)\n ' index = uniform_index(index, ol.__len__()) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) popped = new.pop(index) return {'popped': popped, 'list': new} else: popped = ol.pop(index) return popped
from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4] id(ol) rslt = pop(ol,2) pobj(rslt) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4] id(ol) rslt = pop(ol,2,mode="original") rslt ol id(ol)
elist/elist.py
pop
ihgazni2/elist
0
python
def pop(ol, index, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n rslt = pop(ol,2)\n pobj(rslt)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = pop(ol,2,mode="original")\n rslt\n ol\n id(ol)\n ' index = uniform_index(index, ol.__len__()) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) popped = new.pop(index) return {'popped': popped, 'list': new} else: popped = ol.pop(index) return popped
def pop(ol, index, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n rslt = pop(ol,2)\n pobj(rslt)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = pop(ol,2,mode="original")\n rslt\n ol\n id(ol)\n ' index = uniform_index(index, ol.__len__()) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) popped = new.pop(index) return {'popped': popped, 'list': new} else: popped = ol.pop(index) return popped<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4] id(ol) rslt = pop(ol,2) pobj(rslt) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4] id(ol) rslt = pop(ol,2,mode="original") rslt ol id(ol)<|endoftext|>
747578c531c16baf4e010b9f180554e0ec1314b2c03d6299b4b6aec0d127c183
def cond_pop(ol, index, **kwargs): "\n from elist.jprint import pobj\n from elist.elist import *\n ol = [{'data':0;'type':'number'},{'data':'x';'type':'str'},{'data':'y';'type':'str'},4]\n #cond_func_args is a array\n def cond_func(index,value,cond_func_args):\n \n " cond_func = kwargs['cond_func'] cond_func_args = kwargs['cond_func_args'] index = uniform_index(index, ol.__len__()) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' value = ol[index] cond = cond_func(index, value, *cond_func_args) if (mode == 'new'): new = copy.deepcopy(ol) if cond: popped = new.pop(index) else: popped = new return {'popped': popped, 'list': new} else: if cond: popped = ol.pop(index) else: popped = ol return popped
from elist.jprint import pobj from elist.elist import * ol = [{'data':0;'type':'number'},{'data':'x';'type':'str'},{'data':'y';'type':'str'},4] #cond_func_args is a array def cond_func(index,value,cond_func_args):
elist/elist.py
cond_pop
ihgazni2/elist
0
python
def cond_pop(ol, index, **kwargs): "\n from elist.jprint import pobj\n from elist.elist import *\n ol = [{'data':0;'type':'number'},{'data':'x';'type':'str'},{'data':'y';'type':'str'},4]\n #cond_func_args is a array\n def cond_func(index,value,cond_func_args):\n \n " cond_func = kwargs['cond_func'] cond_func_args = kwargs['cond_func_args'] index = uniform_index(index, ol.__len__()) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' value = ol[index] cond = cond_func(index, value, *cond_func_args) if (mode == 'new'): new = copy.deepcopy(ol) if cond: popped = new.pop(index) else: popped = new return {'popped': popped, 'list': new} else: if cond: popped = ol.pop(index) else: popped = ol return popped
def cond_pop(ol, index, **kwargs): "\n from elist.jprint import pobj\n from elist.elist import *\n ol = [{'data':0;'type':'number'},{'data':'x';'type':'str'},{'data':'y';'type':'str'},4]\n #cond_func_args is a array\n def cond_func(index,value,cond_func_args):\n \n " cond_func = kwargs['cond_func'] cond_func_args = kwargs['cond_func_args'] index = uniform_index(index, ol.__len__()) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' value = ol[index] cond = cond_func(index, value, *cond_func_args) if (mode == 'new'): new = copy.deepcopy(ol) if cond: popped = new.pop(index) else: popped = new return {'popped': popped, 'list': new} else: if cond: popped = ol.pop(index) else: popped = ol return popped<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [{'data':0;'type':'number'},{'data':'x';'type':'str'},{'data':'y';'type':'str'},4] #cond_func_args is a array def cond_func(index,value,cond_func_args):<|endoftext|>
2616e5ea9aded3b66d7669842f4783499cf14250ec369977a0902700963649f5
def pop_range(ol, start_index, end_index, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_range(ol,2,4)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_range(ol,2,4,mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() start_index = uniform_index(start_index, length) end_index = uniform_index(end_index, length) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, start_index): new.append(cpol[i]) for i in range(start_index, end_index): popped.append(cpol[i]) for i in range(end_index, length): new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, start_index): tmp.append(ol[i]) for i in range(start_index, end_index): popped.append(ol[i]) for i in range(end_index, length): tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped
from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4,5,6] id(ol) rslt = pop_range(ol,2,4) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4,5,6] id(ol) rslt = pop_range(ol,2,4,mode="original") rslt ol id(ol)
elist/elist.py
pop_range
ihgazni2/elist
0
python
def pop_range(ol, start_index, end_index, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_range(ol,2,4)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_range(ol,2,4,mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() start_index = uniform_index(start_index, length) end_index = uniform_index(end_index, length) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, start_index): new.append(cpol[i]) for i in range(start_index, end_index): popped.append(cpol[i]) for i in range(end_index, length): new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, start_index): tmp.append(ol[i]) for i in range(start_index, end_index): popped.append(ol[i]) for i in range(end_index, length): tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped
def pop_range(ol, start_index, end_index, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_range(ol,2,4)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_range(ol,2,4,mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() start_index = uniform_index(start_index, length) end_index = uniform_index(end_index, length) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, start_index): new.append(cpol[i]) for i in range(start_index, end_index): popped.append(cpol[i]) for i in range(end_index, length): new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, start_index): tmp.append(ol[i]) for i in range(start_index, end_index): popped.append(ol[i]) for i in range(end_index, length): tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4,5,6] id(ol) rslt = pop_range(ol,2,4) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4,5,6] id(ol) rslt = pop_range(ol,2,4,mode="original") rslt ol id(ol)<|endoftext|>
5cb5f262267d68eb94e019ca614c4aa40c60c1bfcbd3785fd7cac466aad15cf1
def pop_some(ol, *indexes, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_some(ol,0,2,5)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_some(ol,0,2,5,mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() indexes = list(map((lambda index: uniform_index(index, length)), list(indexes))) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(cpol[i]) else: new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(ol[i]) else: tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped
from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4,5,6] id(ol) rslt = pop_some(ol,0,2,5) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4,5,6] id(ol) rslt = pop_some(ol,0,2,5,mode="original") rslt ol id(ol)
elist/elist.py
pop_some
ihgazni2/elist
0
python
def pop_some(ol, *indexes, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_some(ol,0,2,5)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_some(ol,0,2,5,mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() indexes = list(map((lambda index: uniform_index(index, length)), list(indexes))) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(cpol[i]) else: new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(ol[i]) else: tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped
def pop_some(ol, *indexes, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_some(ol,0,2,5)\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_some(ol,0,2,5,mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() indexes = list(map((lambda index: uniform_index(index, length)), list(indexes))) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(cpol[i]) else: new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(ol[i]) else: tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4,5,6] id(ol) rslt = pop_some(ol,0,2,5) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4,5,6] id(ol) rslt = pop_some(ol,0,2,5,mode="original") rslt ol id(ol)<|endoftext|>
535fc0bbf75be7b0dbab60e1c63afab682fb5aa4170d5dbd0e7ca0cdf7451485
def pop_indexes(ol, indexes, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_indexes(ol,{0,-3,5})\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_indexes(ol,{0,-3,5},mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() indexes = list(map((lambda index: uniform_index(index, length)), list(indexes))) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(cpol[i]) else: new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(ol[i]) else: tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped
from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4,5,6] id(ol) rslt = pop_indexes(ol,{0,-3,5}) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4,5,6] id(ol) rslt = pop_indexes(ol,{0,-3,5},mode="original") rslt ol id(ol)
elist/elist.py
pop_indexes
ihgazni2/elist
0
python
def pop_indexes(ol, indexes, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_indexes(ol,{0,-3,5})\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_indexes(ol,{0,-3,5},mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() indexes = list(map((lambda index: uniform_index(index, length)), list(indexes))) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(cpol[i]) else: new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(ol[i]) else: tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped
def pop_indexes(ol, indexes, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_indexes(ol,{0,-3,5})\n ol\n id(ol)\n id(rslt[\'list\'])\n ####\n ol = [1,2,3,4,5,6]\n id(ol)\n rslt = pop_indexes(ol,{0,-3,5},mode="original")\n rslt\n ol\n id(ol)\n ' length = ol.__len__() indexes = list(map((lambda index: uniform_index(index, length)), list(indexes))) if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): cpol = copy.deepcopy(ol) new = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(cpol[i]) else: new.append(cpol[i]) return {'popped': popped, 'list': new} else: tmp = [] popped = [] for i in range(0, length): if (i in indexes): popped.append(ol[i]) else: tmp.append(ol[i]) ol.clear() for i in range(0, tmp.__len__()): ol.append(tmp[i]) return popped<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,2,3,4,5,6] id(ol) rslt = pop_indexes(ol,{0,-3,5}) ol id(ol) id(rslt['list']) #### ol = [1,2,3,4,5,6] id(ol) rslt = pop_indexes(ol,{0,-3,5},mode="original") rslt ol id(ol)<|endoftext|>
22825b9a41dcb3b6bab83e53344f6c96cd99745f331f779d7bb98448ad7a78c3
def remove_first(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_first(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_first(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ####array_remove is the same as remove_first\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.remove(value) return new else: ol.remove(value) return ol
from elist.jprint import pobj from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_first(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_first(ol,'a',mode="original") ol rslt id(ol) id(rslt) ####array_remove is the same as remove_first
elist/elist.py
remove_first
ihgazni2/elist
0
python
def remove_first(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_first(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_first(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ####array_remove is the same as remove_first\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.remove(value) return new else: ol.remove(value) return ol
def remove_first(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_first(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_first(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ####array_remove is the same as remove_first\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.remove(value) return new else: ol.remove(value) return ol<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_first(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_first(ol,'a',mode="original") ol rslt id(ol) id(rslt) ####array_remove is the same as remove_first<|endoftext|>
92addafb2234500e558cbb8af214436fde72609aa5d6fc2e9d426e3a87afd8fd
def remove_firstnot(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_firstnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_firstnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ####array_removenot is the same as remove_firstnot\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() if (mode == 'new'): new = copy.deepcopy(ol) for i in range(0, length): if (new[i] == value): pass else: new.pop(i) return new return new else: for i in range(0, length): if (ol[i] == value): pass else: ol.pop(i) return ol return ol
from elist.jprint import pobj from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_firstnot(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_firstnot(ol,'a',mode="original") ol rslt id(ol) id(rslt) ####array_removenot is the same as remove_firstnot
elist/elist.py
remove_firstnot
ihgazni2/elist
0
python
def remove_firstnot(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_firstnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_firstnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ####array_removenot is the same as remove_firstnot\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() if (mode == 'new'): new = copy.deepcopy(ol) for i in range(0, length): if (new[i] == value): pass else: new.pop(i) return new return new else: for i in range(0, length): if (ol[i] == value): pass else: ol.pop(i) return ol return ol
def remove_firstnot(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_firstnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_firstnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ####array_removenot is the same as remove_firstnot\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() if (mode == 'new'): new = copy.deepcopy(ol) for i in range(0, length): if (new[i] == value): pass else: new.pop(i) return new return new else: for i in range(0, length): if (ol[i] == value): pass else: ol.pop(i) return ol return ol<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_firstnot(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_firstnot(ol,'a',mode="original") ol rslt id(ol) id(rslt) ####array_removenot is the same as remove_firstnot<|endoftext|>
bbdbc270ea58cbe3926f21994c0ac19febe80f7c865db63343d048cffa3e5215
def remove_last(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_last(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_last(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) new.reverse() new.remove(value) new.reverse() if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_last(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_last(ol,'a',mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_last
ihgazni2/elist
0
python
def remove_last(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_last(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_last(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) new.reverse() new.remove(value) new.reverse() if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_last(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_last(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_last(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) new.reverse() new.remove(value) new.reverse() if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_last(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_last(ol,'a',mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
8cc2f310688955f6c4775f7379e573d23b5e341b12b67941050eff51f6f6d537
def remove_lastnot(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_lastnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_lastnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() if (mode == 'new'): new = copy.deepcopy(ol) for i in range((length - 1), (- 1), (- 1)): if (new[i] == value): pass else: new.pop(i) return new return new else: for i in range((length - 1), (- 1), (- 1)): if (ol[i] == value): pass else: ol.pop(i) return ol return ol
from elist.jprint import pobj from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_lastnot(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_lastnot(ol,'a',mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_lastnot
ihgazni2/elist
0
python
def remove_lastnot(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_lastnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_lastnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() if (mode == 'new'): new = copy.deepcopy(ol) for i in range((length - 1), (- 1), (- 1)): if (new[i] == value): pass else: new.pop(i) return new return new else: for i in range((length - 1), (- 1), (- 1)): if (ol[i] == value): pass else: ol.pop(i) return ol return ol
def remove_lastnot(ol, value, **kwargs): '\n from elist.jprint import pobj\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_lastnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_lastnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' length = ol.__len__() if (mode == 'new'): new = copy.deepcopy(ol) for i in range((length - 1), (- 1), (- 1)): if (new[i] == value): pass else: new.pop(i) return new return new else: for i in range((length - 1), (- 1), (- 1)): if (ol[i] == value): pass else: ol.pop(i) return ol return ol<|docstring|>from elist.jprint import pobj from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_lastnot(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_lastnot(ol,'a',mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
d0684eb9332aa7ae689bac764eb8fb92e0411a42d75217d59a9d8b8423800e93
def remove_which(ol, value, which, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_which(ol,\'a\',1)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_which(ol,\'a\',1,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) length = ol.__len__() if (mode == 'new'): l = new else: l = ol seq = (- 1) for i in range(0, length): if (ol[i] == value): seq = (seq + 1) if (seq == which): l.pop(i) break else: pass else: pass return l
from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_which(ol,'a',1) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_which(ol,'a',1,mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_which
ihgazni2/elist
0
python
def remove_which(ol, value, which, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_which(ol,\'a\',1)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_which(ol,\'a\',1,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) length = ol.__len__() if (mode == 'new'): l = new else: l = ol seq = (- 1) for i in range(0, length): if (ol[i] == value): seq = (seq + 1) if (seq == which): l.pop(i) break else: pass else: pass return l
def remove_which(ol, value, which, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_which(ol,\'a\',1)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_which(ol,\'a\',1,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) length = ol.__len__() if (mode == 'new'): l = new else: l = ol seq = (- 1) for i in range(0, length): if (ol[i] == value): seq = (seq + 1) if (seq == which): l.pop(i) break else: pass else: pass return l<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_which(ol,'a',1) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_which(ol,'a',1,mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
c699e980b4e087743da726561120f1085ee4982374bf68bc0664381fac5b3c95
def remove_whichnot(ol, value, which, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_whichnot(ol,\'a\',1)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_whichnot(ol,\'a\',1,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) length = ol.__len__() if (mode == 'new'): l = new else: l = ol seq = (- 1) for i in range(0, length): if (not (ol[i] == value)): seq = (seq + 1) if (seq == which): l.pop(i) break else: pass else: pass return l
from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_whichnot(ol,'a',1) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_whichnot(ol,'a',1,mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_whichnot
ihgazni2/elist
0
python
def remove_whichnot(ol, value, which, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_whichnot(ol,\'a\',1)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_whichnot(ol,\'a\',1,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) length = ol.__len__() if (mode == 'new'): l = new else: l = ol seq = (- 1) for i in range(0, length): if (not (ol[i] == value)): seq = (seq + 1) if (seq == which): l.pop(i) break else: pass else: pass return l
def remove_whichnot(ol, value, which, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n new = remove_whichnot(ol,\'a\',1)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\']\n id(ol)\n rslt = remove_whichnot(ol,\'a\',1,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) length = ol.__len__() if (mode == 'new'): l = new else: l = ol seq = (- 1) for i in range(0, length): if (not (ol[i] == value)): seq = (seq + 1) if (seq == which): l.pop(i) break else: pass else: pass return l<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a'] id(ol) new = remove_whichnot(ol,'a',1) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a'] id(ol) rslt = remove_whichnot(ol,'a',1,mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
aac1d9e97919c160559507cdc26bec12685031a0e16d7ed32c75a3fd73389856
def remove_some(ol, value, *seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_some(ol,\'a\',1,3)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_some(ol,\'a\',1,3,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() seq = (- 1) cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_some(ol,'a',1,3) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_some(ol,'a',1,3,mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_some
ihgazni2/elist
0
python
def remove_some(ol, value, *seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_some(ol,\'a\',1,3)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_some(ol,\'a\',1,3,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() seq = (- 1) cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_some(ol, value, *seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_some(ol,\'a\',1,3)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_some(ol,\'a\',1,3,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() seq = (- 1) cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_some(ol,'a',1,3) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_some(ol,'a',1,3,mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
49e854e77954327188133b848edbb9dc6164e2795ef5721c9428343e1842a130
def remove_somenot(ol, value, *seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_somenot(ol,\'a\',1,3)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_somenot(ol,\'a\',1,3,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() seq = (- 1) cpol = copy.deepcopy(ol) for i in range(0, length): if (not (cpol[i] == value)): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_somenot(ol,'a',1,3) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_somenot(ol,'a',1,3,mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_somenot
ihgazni2/elist
0
python
def remove_somenot(ol, value, *seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_somenot(ol,\'a\',1,3)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_somenot(ol,\'a\',1,3,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() seq = (- 1) cpol = copy.deepcopy(ol) for i in range(0, length): if (not (cpol[i] == value)): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_somenot(ol, value, *seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_somenot(ol,\'a\',1,3)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_somenot(ol,\'a\',1,3,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() seq = (- 1) cpol = copy.deepcopy(ol) for i in range(0, length): if (not (cpol[i] == value)): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_somenot(ol,'a',1,3) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_somenot(ol,'a',1,3,mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
ed0d638c6b76aabe47419a7e65402660eb27ee2b33201ebdb2e1fa31a2f767b6
def remove_seqs(ol, value, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_seqs(ol,\'a\',{1,3})\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_seqs(ol,\'a\',{1,3},mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) seq = (- 1) for i in range(0, length): if (cpol[i] == value): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_seqs(ol,'a',{1,3}) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_seqs(ol,'a',{1,3},mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_seqs
ihgazni2/elist
0
python
def remove_seqs(ol, value, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_seqs(ol,\'a\',{1,3})\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_seqs(ol,\'a\',{1,3},mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) seq = (- 1) for i in range(0, length): if (cpol[i] == value): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_seqs(ol, value, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_seqs(ol,\'a\',{1,3})\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_seqs(ol,\'a\',{1,3},mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) seq = (- 1) for i in range(0, length): if (cpol[i] == value): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_seqs(ol,'a',{1,3}) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_seqs(ol,'a',{1,3},mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
52c9b912010d11585a4ef927eba581a98f6a16e18a45f6b244f16c46ecebe37d
def remove_seqsnot(ol, value, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_seqsnot(ol,\'a\',{1,3})\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_seqsnot(ol,\'a\',{1,3},mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) seq = (- 1) for i in range(0, length): if (not (cpol[i] == value)): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
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)
elist/elist.py
remove_seqsnot
ihgazni2/elist
0
python
def remove_seqsnot(ol, value, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_seqsnot(ol,\'a\',{1,3})\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_seqsnot(ol,\'a\',{1,3},mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) seq = (- 1) for i in range(0, length): if (not (cpol[i] == value)): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_seqsnot(ol, value, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_seqsnot(ol,\'a\',{1,3})\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_seqsnot(ol,\'a\',{1,3},mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(seqs) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) seq = (- 1) for i in range(0, length): if (not (cpol[i] == value)): seq = (seq + 1) if (seq in seqs): pass else: new.append(cpol[i]) else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>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)<|endoftext|>
ecf748dc7101c307eaa2af00a798bcd3ebf9cc2ab2cf41dfc576330269e28a3d
def remove_all(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_all(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_all(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): pass else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_all(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_all(ol,'a',mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_all
ihgazni2/elist
0
python
def remove_all(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_all(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_all(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): pass else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_all(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_all(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_all(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): pass else: new.append(cpol[i]) if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_all(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_all(ol,'a',mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
95028b2a27a98c28762c05d04d915efbbd98f8ec85d9005957658a73a9ac62e3
def remove_allnot(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_allnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_allnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_allnot(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_allnot(ol,'a',mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_allnot
ihgazni2/elist
0
python
def remove_allnot(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_allnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_allnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_allnot(ol, value, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n new = remove_allnot(ol,\'a\')\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'a\',5,\'a\',6,\'a\']\n id(ol)\n rslt = remove_allnot(ol,\'a\',mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): if (cpol[i] == value): new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = remove_allnot(ol,'a') ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt = remove_allnot(ol,'a',mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
2acd969542a35785ce414e6c864f92ca30eae9e248ec4852f150b52f909431be
def remove_many(ol, values, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n new = remove_many(ol,[\'a\',\'b\'],[1,2])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n rslt = remove_many(ol,[\'a\',\'b\'],[1,2],mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' values = copy.deepcopy(values) seqs = copy.deepcopy(seqs) cursors = ([(- 1)] * values.__len__()) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): label = True for j in range(0, cursors.__len__()): which = seqs[j] value = values[j] if (cpol[i] == value): cursors[j] = (cursors[j] + 1) if (cursors[j] == which): label = False break else: pass else: pass if label: new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) new = remove_many(ol,['a','b'],[1,2]) ol new id(ol) id(new) #### ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) rslt = remove_many(ol,['a','b'],[1,2],mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_many
ihgazni2/elist
0
python
def remove_many(ol, values, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n new = remove_many(ol,[\'a\',\'b\'],[1,2])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n rslt = remove_many(ol,[\'a\',\'b\'],[1,2],mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' values = copy.deepcopy(values) seqs = copy.deepcopy(seqs) cursors = ([(- 1)] * values.__len__()) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): label = True for j in range(0, cursors.__len__()): which = seqs[j] value = values[j] if (cpol[i] == value): cursors[j] = (cursors[j] + 1) if (cursors[j] == which): label = False break else: pass else: pass if label: new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_many(ol, values, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n new = remove_many(ol,[\'a\',\'b\'],[1,2])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n rslt = remove_many(ol,[\'a\',\'b\'],[1,2],mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' values = copy.deepcopy(values) seqs = copy.deepcopy(seqs) cursors = ([(- 1)] * values.__len__()) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): label = True for j in range(0, cursors.__len__()): which = seqs[j] value = values[j] if (cpol[i] == value): cursors[j] = (cursors[j] + 1) if (cursors[j] == which): label = False break else: pass else: pass if label: new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) new = remove_many(ol,['a','b'],[1,2]) ol new id(ol) id(new) #### ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) rslt = remove_many(ol,['a','b'],[1,2],mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
7c5e59d24a384cfea114d0e30a01bb55130aefbad889d51b81bf8cc9a527ed6b
def remove_manynot(ol, values, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n new = remove_manynot(ol,[\'a\',\'b\'],[1,2])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n rslt = remove_manynot(ol,[\'a\',\'b\'],[1,2],mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' values = copy.deepcopy(values) seqs = copy.deepcopy(seqs) cursors = ([(- 1)] * values.__len__()) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): label = True for j in range(0, cursors.__len__()): which = seqs[j] value = values[j] if (not (cpol[i] == value)): cursors[j] = (cursors[j] + 1) if (cursors[j] == which): label = False break else: pass else: pass if label: new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) new = remove_manynot(ol,['a','b'],[1,2]) ol new id(ol) id(new) #### ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) rslt = remove_manynot(ol,['a','b'],[1,2],mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
remove_manynot
ihgazni2/elist
0
python
def remove_manynot(ol, values, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n new = remove_manynot(ol,[\'a\',\'b\'],[1,2])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n rslt = remove_manynot(ol,[\'a\',\'b\'],[1,2],mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' values = copy.deepcopy(values) seqs = copy.deepcopy(seqs) cursors = ([(- 1)] * values.__len__()) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): label = True for j in range(0, cursors.__len__()): which = seqs[j] value = values[j] if (not (cpol[i] == value)): cursors[j] = (cursors[j] + 1) if (cursors[j] == which): label = False break else: pass else: pass if label: new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def remove_manynot(ol, values, seqs, **kwargs): '\n from elist.elist import *\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n new = remove_manynot(ol,[\'a\',\'b\'],[1,2])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,\'a\',3,\'b\',5,\'a\',6,\'a\',7,\'b\',8,\'b\',9]\n id(ol)\n rslt = remove_manynot(ol,[\'a\',\'b\'],[1,2],mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' values = copy.deepcopy(values) seqs = copy.deepcopy(seqs) cursors = ([(- 1)] * values.__len__()) new = [] length = ol.__len__() cpol = copy.deepcopy(ol) for i in range(0, length): label = True for j in range(0, cursors.__len__()): which = seqs[j] value = values[j] if (not (cpol[i] == value)): cursors[j] = (cursors[j] + 1) if (cursors[j] == which): label = False break else: pass else: pass if label: new.append(cpol[i]) else: pass if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) new = remove_manynot(ol,['a','b'],[1,2]) ol new id(ol) id(new) #### ol = [1,'a',3,'b',5,'a',6,'a',7,'b',8,'b',9] id(ol) rslt = remove_manynot(ol,['a','b'],[1,2],mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
4fb17130217c7f5f1aae7f81bdee5d6ef56140f9a3e34cfb43b1b5e2ab520b9e
def cond_remove_all(ol, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n\n new = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) selected = find_all(new, cond_func, *cond_func_args) selected_indexes = array_map(selected, (lambda ele: ele['index'])) new = pop_indexes(new, selected_indexes)['list'] if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) def afterCH(ele,ch): cond = (ord(str(ele)) > ord(ch)) return(cond) new = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B']) ol new id(ol) id(new) #### ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) rslt = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'],mode='original') ol rslt id(ol) id(rslt)
elist/elist.py
cond_remove_all
ihgazni2/elist
0
python
def cond_remove_all(ol, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n\n new = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) selected = find_all(new, cond_func, *cond_func_args) selected_indexes = array_map(selected, (lambda ele: ele['index'])) new = pop_indexes(new, selected_indexes)['list'] if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def cond_remove_all(ol, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n\n new = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) selected = find_all(new, cond_func, *cond_func_args) selected_indexes = array_map(selected, (lambda ele: ele['index'])) new = pop_indexes(new, selected_indexes)['list'] if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) def afterCH(ele,ch): cond = (ord(str(ele)) > ord(ch)) return(cond) new = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B']) ol new id(ol) id(new) #### ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) rslt = cond_remove_all(ol,cond_func=afterCH,cond_func_args=['B'],mode='original') ol rslt id(ol) id(rslt)<|endoftext|>
0b12397d8b272928c4acc7837e874ffe97d08ca4c18d9baf71a410393c955853
def cond_remove_seqs(ol, seqs, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n\n new = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) selected = find_all(new, cond_func, *cond_func_args) selected_indexes = array_map(selected, (lambda ele: ele['index'])) selected_indexes = pop_indexes(selected_indexes, seqs)['popped'] new = pop_indexes(new, selected_indexes)['list'] if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
from elist.elist import * ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) def afterCH(ele,ch): cond = (ord(str(ele)) > ord(ch)) return(cond) new = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B']) ol new id(ol) id(new) #### ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) rslt = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'],mode='original') ol rslt id(ol) id(rslt)
elist/elist.py
cond_remove_seqs
ihgazni2/elist
0
python
def cond_remove_seqs(ol, seqs, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n\n new = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) selected = find_all(new, cond_func, *cond_func_args) selected_indexes = array_map(selected, (lambda ele: ele['index'])) selected_indexes = pop_indexes(selected_indexes, seqs)['popped'] new = pop_indexes(new, selected_indexes)['list'] if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol
def cond_remove_seqs(ol, seqs, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n\n new = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' new = copy.deepcopy(ol) selected = find_all(new, cond_func, *cond_func_args) selected_indexes = array_map(selected, (lambda ele: ele['index'])) selected_indexes = pop_indexes(selected_indexes, seqs)['popped'] new = pop_indexes(new, selected_indexes)['list'] if (mode == 'new'): return new else: ol.clear() ol.extend(new) return ol<|docstring|>from elist.elist import * ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) def afterCH(ele,ch): cond = (ord(str(ele)) > ord(ch)) return(cond) new = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B']) ol new id(ol) id(new) #### ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) rslt = cond_remove_seqs(ol,[0,2],cond_func=afterCH,cond_func_args=['B'],mode='original') ol rslt id(ol) id(rslt)<|endoftext|>
7d8d41ca867677de080d2933b0b3a27b2d7f3ec01e0c6368e0f0c2b62d7dd508
def cond_remove_some(ol, *some, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n \n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n \n new = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(some) rslt = cond_remove_seqs(ol, seqs, cond_func=cond_func, cond_func_args=cond_func_args) return rslt
from elist.elist import * ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) def afterCH(ele,ch): cond = (ord(str(ele)) > ord(ch)) return(cond) new = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B']) ol new id(ol) id(new) #### ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) rslt = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'],mode='original') ol rslt id(ol) id(rslt)
elist/elist.py
cond_remove_some
ihgazni2/elist
0
python
def cond_remove_some(ol, *some, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n \n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n \n new = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(some) rslt = cond_remove_seqs(ol, seqs, cond_func=cond_func, cond_func_args=cond_func_args) return rslt
def cond_remove_some(ol, *some, **kwargs): "\n from elist.elist import *\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n \n def afterCH(ele,ch):\n cond = (ord(str(ele)) > ord(ch))\n return(cond)\n \n new = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'])\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9]\n id(ol)\n rslt = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'],mode='original')\n ol\n rslt\n id(ol)\n id(rslt)\n " cond_func = kwargs['cond_func'] if ('cond_func_args' in kwargs): cond_func_args = kwargs['cond_func_args'] else: cond_func_args = [] if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' seqs = list(some) rslt = cond_remove_seqs(ol, seqs, cond_func=cond_func, cond_func_args=cond_func_args) return rslt<|docstring|>from elist.elist import * ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) def afterCH(ele,ch): cond = (ord(str(ele)) > ord(ch)) return(cond) new = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B']) ol new id(ol) id(new) #### ol = [1,'X',3,'b',5,'c',6,'A',7,'b',8,'B',9] id(ol) rslt = cond_remove_some(ol,0,2,cond_func=afterCH,cond_func_args=['B'],mode='original') ol rslt id(ol) id(rslt)<|endoftext|>
eca7ae57dec94346779c04bf28d6f7c02e05c6e647c7cab353d3f68234904144
def init(len, default_element=None): '\n from elist.elist import *\n init(5)\n init(5,"x")\n ' rslt = [] for i in range(0, len): rslt.append(copy.deepcopy(default_element)) return rslt
from elist.elist import * init(5) init(5,"x")
elist/elist.py
init
ihgazni2/elist
0
python
def init(len, default_element=None): '\n from elist.elist import *\n init(5)\n init(5,"x")\n ' rslt = [] for i in range(0, len): rslt.append(copy.deepcopy(default_element)) return rslt
def init(len, default_element=None): '\n from elist.elist import *\n init(5)\n init(5,"x")\n ' rslt = [] for i in range(0, len): rslt.append(copy.deepcopy(default_element)) return rslt<|docstring|>from elist.elist import * init(5) init(5,"x")<|endoftext|>
36caba287ce8b2be733dfac3a07a28d749cba649c9d643544cff663c6a9140f4
def init_range(start, end, step): '\n init_range(1,20,2)\n ' return list(range(start, end, step))
init_range(1,20,2)
elist/elist.py
init_range
ihgazni2/elist
0
python
def init_range(start, end, step): '\n \n ' return list(range(start, end, step))
def init_range(start, end, step): '\n \n ' return list(range(start, end, step))<|docstring|>init_range(1,20,2)<|endoftext|>
4db695ce4513a7b7412307448bb8e4c9d3760d952ab051cc2d026d4f1c181f23
def intlize(l): '\n from elist.elist import *\n l = ["1","3","4","5"]\n intlize(l)\n ' return list(map((lambda ele: int(ele)), l))
from elist.elist import * l = ["1","3","4","5"] intlize(l)
elist/elist.py
intlize
ihgazni2/elist
0
python
def intlize(l): '\n from elist.elist import *\n l = ["1","3","4","5"]\n intlize(l)\n ' return list(map((lambda ele: int(ele)), l))
def intlize(l): '\n from elist.elist import *\n l = ["1","3","4","5"]\n intlize(l)\n ' return list(map((lambda ele: int(ele)), l))<|docstring|>from elist.elist import * l = ["1","3","4","5"] intlize(l)<|endoftext|>
6c02fab3c506e61f9a9a3ed9754efd8951b01c31d780b035fc75d96a01e8af54
def strlize(l): '\n from elist.elist import *\n l = [1,3,4,5]\n strlize(l)\n ' return list(map((lambda ele: str(ele)), l))
from elist.elist import * l = [1,3,4,5] strlize(l)
elist/elist.py
strlize
ihgazni2/elist
0
python
def strlize(l): '\n from elist.elist import *\n l = [1,3,4,5]\n strlize(l)\n ' return list(map((lambda ele: str(ele)), l))
def strlize(l): '\n from elist.elist import *\n l = [1,3,4,5]\n strlize(l)\n ' return list(map((lambda ele: str(ele)), l))<|docstring|>from elist.elist import * l = [1,3,4,5] strlize(l)<|endoftext|>
07153e3268d923a557d97285ac0804ba8e7af9df2bf372e067f467b4111632a5
def array_from(obj, func, *args): '\n from elist.elist import *\n array_from("abcd",None)\n #####\n def map_func(ele,x,y):\n return(int(ele)+x+y)\n \n array_from("1234",map_func,1000,100)\n \n def map_func(ele):\n return(int(ele)*2)\n \n array_from("1234",map_func)\n \n array_from("1234",None)\n ' if func: l = list(obj) rslt = list(map((lambda ele: func(ele, *args)), l)) return rslt else: return list(obj)
from elist.elist import * array_from("abcd",None) ##### def map_func(ele,x,y): return(int(ele)+x+y) array_from("1234",map_func,1000,100) def map_func(ele): return(int(ele)*2) array_from("1234",map_func) array_from("1234",None)
elist/elist.py
array_from
ihgazni2/elist
0
python
def array_from(obj, func, *args): '\n from elist.elist import *\n array_from("abcd",None)\n #####\n def map_func(ele,x,y):\n return(int(ele)+x+y)\n \n array_from("1234",map_func,1000,100)\n \n def map_func(ele):\n return(int(ele)*2)\n \n array_from("1234",map_func)\n \n array_from("1234",None)\n ' if func: l = list(obj) rslt = list(map((lambda ele: func(ele, *args)), l)) return rslt else: return list(obj)
def array_from(obj, func, *args): '\n from elist.elist import *\n array_from("abcd",None)\n #####\n def map_func(ele,x,y):\n return(int(ele)+x+y)\n \n array_from("1234",map_func,1000,100)\n \n def map_func(ele):\n return(int(ele)*2)\n \n array_from("1234",map_func)\n \n array_from("1234",None)\n ' if func: l = list(obj) rslt = list(map((lambda ele: func(ele, *args)), l)) return rslt else: return list(obj)<|docstring|>from elist.elist import * array_from("abcd",None) ##### def map_func(ele,x,y): return(int(ele)+x+y) array_from("1234",map_func,1000,100) def map_func(ele): return(int(ele)*2) array_from("1234",map_func) array_from("1234",None)<|endoftext|>
b7484ad7322a6651ec995086b8c1d2b94df7396731feb1d0ff11f823967b3852
def array_of(*eles): '\n from elist.elist import *\n array_of(1,2,4,5,6)\n ' return list(eles)
from elist.elist import * array_of(1,2,4,5,6)
elist/elist.py
array_of
ihgazni2/elist
0
python
def array_of(*eles): '\n from elist.elist import *\n array_of(1,2,4,5,6)\n ' return list(eles)
def array_of(*eles): '\n from elist.elist import *\n array_of(1,2,4,5,6)\n ' return list(eles)<|docstring|>from elist.elist import * array_of(1,2,4,5,6)<|endoftext|>
c81cd9d5c4e77a530bc58153282cfceeecce44ed1810fe71ba630ec7f65990c0
def deepcopy(ol): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n new = deepcopy(ol)\n new\n id(new)\n ' return copy.deepcopy(ol)
from elist.elist import * ol = [1,2,3,4] id(ol) new = deepcopy(ol) new id(new)
elist/elist.py
deepcopy
ihgazni2/elist
0
python
def deepcopy(ol): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n new = deepcopy(ol)\n new\n id(new)\n ' return copy.deepcopy(ol)
def deepcopy(ol): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n new = deepcopy(ol)\n new\n id(new)\n ' return copy.deepcopy(ol)<|docstring|>from elist.elist import * ol = [1,2,3,4] id(ol) new = deepcopy(ol) new id(new)<|endoftext|>
43f4e910d60f57906b22a04bc5f7cf868dabd12afd55a07fca250a3bbae699a5
def copy_within(ol, target, start=None, end=None): '\n from elist.elist import *\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,0,3,4)\n rslt\n id(rslt)\n ####\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,0,3)\n rslt\n id(rslt)\n ####\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,-2)\n rslt\n id(rslt)\n ####copyWithin is the same as copy_within\n ' length = ol.__len__() if (start == None): start = 0 else: pass if (end == None): end = length else: pass target = uniform_index(target, length) start = uniform_index(start, length) end = uniform_index(end, length) cplen = (end - start) cpend = (target + cplen) if ((target + cplen) > length): cpend = length else: pass shift = (start - target) if (shift >= 0): for i in range(target, cpend): ol[i] = ol[(i + shift)] else: for i in range((cpend - 1), (target - 1), (- 1)): ol[i] = ol[(i + shift)] return ol
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
elist/elist.py
copy_within
ihgazni2/elist
0
python
def copy_within(ol, target, start=None, end=None): '\n from elist.elist import *\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,0,3,4)\n rslt\n id(rslt)\n ####\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,0,3)\n rslt\n id(rslt)\n ####\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,-2)\n rslt\n id(rslt)\n ####copyWithin is the same as copy_within\n ' length = ol.__len__() if (start == None): start = 0 else: pass if (end == None): end = length else: pass target = uniform_index(target, length) start = uniform_index(start, length) end = uniform_index(end, length) cplen = (end - start) cpend = (target + cplen) if ((target + cplen) > length): cpend = length else: pass shift = (start - target) if (shift >= 0): for i in range(target, cpend): ol[i] = ol[(i + shift)] else: for i in range((cpend - 1), (target - 1), (- 1)): ol[i] = ol[(i + shift)] return ol
def copy_within(ol, target, start=None, end=None): '\n from elist.elist import *\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,0,3,4)\n rslt\n id(rslt)\n ####\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,0,3)\n rslt\n id(rslt)\n ####\n ol = [1, 2, 3, 4, 5]\n id(ol)\n rslt = copyWithin(ol,-2)\n rslt\n id(rslt)\n ####copyWithin is the same as copy_within\n ' length = ol.__len__() if (start == None): start = 0 else: pass if (end == None): end = length else: pass target = uniform_index(target, length) start = uniform_index(start, length) end = uniform_index(end, length) cplen = (end - start) cpend = (target + cplen) if ((target + cplen) > length): cpend = length else: pass shift = (start - target) if (shift >= 0): for i in range(target, cpend): ol[i] = ol[(i + shift)] else: for i in range((cpend - 1), (target - 1), (- 1)): ol[i] = ol[(i + shift)] return ol<|docstring|>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<|endoftext|>
187288317622eb6e62e120bdf58e58c49f9284889a978d31a4eee85ff0744de8
def reverse(ol, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n new = reverse(ol)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = reverse(ol,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.reverse() return new else: ol.reverse() return ol ('reverse',) 'sort'
from elist.elist import * ol = [1,2,3,4] id(ol) new = reverse(ol) ol new id(ol) id(new) #### ol = [1,2,3,4] id(ol) rslt = reverse(ol,mode="original") ol rslt id(ol) id(rslt)
elist/elist.py
reverse
ihgazni2/elist
0
python
def reverse(ol, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n new = reverse(ol)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = reverse(ol,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.reverse() return new else: ol.reverse() return ol ('reverse',) 'sort'
def reverse(ol, **kwargs): '\n from elist.elist import *\n ol = [1,2,3,4]\n id(ol)\n new = reverse(ol)\n ol\n new\n id(ol)\n id(new)\n ####\n ol = [1,2,3,4]\n id(ol)\n rslt = reverse(ol,mode="original")\n ol\n rslt\n id(ol)\n id(rslt)\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'new' if (mode == 'new'): new = copy.deepcopy(ol) new.reverse() return new else: ol.reverse() return ol ('reverse',) 'sort'<|docstring|>from elist.elist import * ol = [1,2,3,4] id(ol) new = reverse(ol) ol new id(ol) id(new) #### ol = [1,2,3,4] id(ol) rslt = reverse(ol,mode="original") ol rslt id(ol) id(rslt)<|endoftext|>
336672504025df4b944a9fcd5cc9669126a3c9b2680fb676e50635dc485f3167
def comprise(list1, list2, **kwargs): '\n from elist.elist import *\n comprise([1,2,3,4,5],[2,3,4],mode="loose")\n comprise([1,2,3,4,5],[2,3,4])\n comprise([1,2,3,4,5],[2,3,4],mode="strict")\n comprise([1,2,3,4,5],[1,2,3,4],mode="strict")\n #not recursive ,only one level\n #please refer to ListTree.search for recursive support\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'loose' len_1 = list1.__len__() len_2 = list2.__len__() if (len_2 > len_1): return False elif (mode == 'strict'): if (list2 == list1[:len_2]): return True else: return False else: end = (len_1 - len_2) for i in range(0, (end + 1)): if (list2 == list1[i:(i + len_2)]): return True else: pass return False
from elist.elist import * comprise([1,2,3,4,5],[2,3,4],mode="loose") comprise([1,2,3,4,5],[2,3,4]) comprise([1,2,3,4,5],[2,3,4],mode="strict") comprise([1,2,3,4,5],[1,2,3,4],mode="strict") #not recursive ,only one level #please refer to ListTree.search for recursive support
elist/elist.py
comprise
ihgazni2/elist
0
python
def comprise(list1, list2, **kwargs): '\n from elist.elist import *\n comprise([1,2,3,4,5],[2,3,4],mode="loose")\n comprise([1,2,3,4,5],[2,3,4])\n comprise([1,2,3,4,5],[2,3,4],mode="strict")\n comprise([1,2,3,4,5],[1,2,3,4],mode="strict")\n #not recursive ,only one level\n #please refer to ListTree.search for recursive support\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'loose' len_1 = list1.__len__() len_2 = list2.__len__() if (len_2 > len_1): return False elif (mode == 'strict'): if (list2 == list1[:len_2]): return True else: return False else: end = (len_1 - len_2) for i in range(0, (end + 1)): if (list2 == list1[i:(i + len_2)]): return True else: pass return False
def comprise(list1, list2, **kwargs): '\n from elist.elist import *\n comprise([1,2,3,4,5],[2,3,4],mode="loose")\n comprise([1,2,3,4,5],[2,3,4])\n comprise([1,2,3,4,5],[2,3,4],mode="strict")\n comprise([1,2,3,4,5],[1,2,3,4],mode="strict")\n #not recursive ,only one level\n #please refer to ListTree.search for recursive support\n ' if ('mode' in kwargs): mode = kwargs['mode'] else: mode = 'loose' len_1 = list1.__len__() len_2 = list2.__len__() if (len_2 > len_1): return False elif (mode == 'strict'): if (list2 == list1[:len_2]): return True else: return False else: end = (len_1 - len_2) for i in range(0, (end + 1)): if (list2 == list1[i:(i + len_2)]): return True else: pass return False<|docstring|>from elist.elist import * comprise([1,2,3,4,5],[2,3,4],mode="loose") comprise([1,2,3,4,5],[2,3,4]) comprise([1,2,3,4,5],[2,3,4],mode="strict") comprise([1,2,3,4,5],[1,2,3,4],mode="strict") #not recursive ,only one level #please refer to ListTree.search for recursive support<|endoftext|>
e299c63c31639349fd38e9908ec4a1041e5cea18419b8350900e15756dc4aa61
def entries(ol): "\n from elist.elist import *\n ol = ['a','b','c']\n rslt = entries(ol)\n rslt\n " rslt = [] length = ol.__len__() for i in range(0, length): entry = [i, ol[i]] rslt.append(entry) return rslt
from elist.elist import * ol = ['a','b','c'] rslt = entries(ol) rslt
elist/elist.py
entries
ihgazni2/elist
0
python
def entries(ol): "\n from elist.elist import *\n ol = ['a','b','c']\n rslt = entries(ol)\n rslt\n " rslt = [] length = ol.__len__() for i in range(0, length): entry = [i, ol[i]] rslt.append(entry) return rslt
def entries(ol): "\n from elist.elist import *\n ol = ['a','b','c']\n rslt = entries(ol)\n rslt\n " rslt = [] length = ol.__len__() for i in range(0, length): entry = [i, ol[i]] rslt.append(entry) return rslt<|docstring|>from elist.elist import * ol = ['a','b','c'] rslt = entries(ol) rslt<|endoftext|>
5a364656abd30a627b6c20d9cfcfdfe5d070b46efc00396d1a358b4f791ddb4c
def includes(ol, value): '\n from elist.elist import *\n ol = [1,2,3,4]\n includes(ol,3)\n includes(ol,5)\n ' return (value in ol)
from elist.elist import * ol = [1,2,3,4] includes(ol,3) includes(ol,5)
elist/elist.py
includes
ihgazni2/elist
0
python
def includes(ol, value): '\n from elist.elist import *\n ol = [1,2,3,4]\n includes(ol,3)\n includes(ol,5)\n ' return (value in ol)
def includes(ol, value): '\n from elist.elist import *\n ol = [1,2,3,4]\n includes(ol,3)\n includes(ol,5)\n ' return (value in ol)<|docstring|>from elist.elist import * ol = [1,2,3,4] includes(ol,3) includes(ol,5)<|endoftext|>