(self, i)
| 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): |