MCPcopy Index your code
hub / github.com/clips/pattern / insert

Method insert

pattern/db/__init__.py:2136–2140  ·  view source on GitHub ↗

Inserts the given value in the column. This will create a new row in the matrix, where other columns are set to the default.

(self, i, value, default=None)

Source from the content-addressed store, hash-verified

2134 r=list(self._datasheet); [self._datasheet.__setitem__(i2, r[i1]) for i2, i1 in enumerate(o)]
2135
2136 def insert(self, i, value, default=None):
2137 """ Inserts the given value in the column.
2138 This will create a new row in the matrix, where other columns are set to the default.
2139 """
2140 self._datasheet.insert(i, [default]*self._j + [value] + [default]*(len(self._datasheet)-self._j-1))
2141
2142 def append(self, value, default=None):
2143 self.insert(len(self), value, default)

Callers 2

appendMethod · 0.95
extendMethod · 0.95

Calls 2

lenFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected