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

Method insert

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

Source from the content-addressed store, hash-verified

118 return Group(l), Group(r)
119
120 def insert(self, i, texel):
121 if i == len(self):
122 return Group(self.data+[texel])
123
124 data = []
125 for elem in self.data:
126 n = len(elem)
127 if i<0:
128 data.append(elem)
129 elif i>=n:
130 data.append(elem)
131 else:
132 data.append(elem.insert(i, texel))
133 i -= n
134 return Group(data)
135
136
137C = Characters

Callers 15

GetColsFunction · 0.45
_insort_rightMethod · 0.45
enter_high_scoreFunction · 0.45
__nonzero__Method · 0.45
AlterBorderFunction · 0.45
selectoneFunction · 0.45
persistent_localsFunction · 0.45
mroMethod · 0.45
handleFunction · 0.45
textwindowFunction · 0.45
latticeFunction · 0.45

Calls 2

GroupClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected