MCPcopy Create free account
hub / github.com/ActiveState/code / split

Method split

recipes/Python/577978_Text_Model/recipe-577978.py:102–118  ·  view source on GitHub ↗
(self, i)

Source from the content-addressed store, hash-verified

100 return Group(r)
101
102 def split(self, i):
103 if i<0 or i>len(self):
104 raise IndexError(i)
105 l = []
106 r = []
107 for texel in self.data:
108 n = len(texel)
109 if i<=0:
110 r.append(texel)
111 elif i>=n:
112 l.append(texel)
113 elif n>i:
114 a, b = texel.split(i)
115 l.append(a)
116 r.append(b)
117 i -= n
118 return Group(l), Group(r)
119
120 def insert(self, i, texel):
121 if i == len(self):

Callers 15

recipe-578464.jsFile · 0.45
recipe-576839.jsFile · 0.45
recipe-577013.jsFile · 0.45
recipe-578537.jsFile · 0.45
recipe-577247.jsFile · 0.45
load_playlistFunction · 0.45
search_scoreFunction · 0.45
parse_feedback_dataFunction · 0.45
recipe-578517.jsFile · 0.45
check_search_wordsFunction · 0.45
DisplayMessageFunction · 0.45

Calls 2

GroupClass · 0.85
appendMethod · 0.45

Tested by 7

test_for_dayFunction · 0.36
test_createFunction · 0.36
test_specMethod · 0.36
test_unitMethod · 0.36