

def Insert(self, key, value, row_index):
    'Inserts new values at a specified offset.\n\n    Args:\n      key: string for header value.\n      value: string for a data value.\n      row_index: Offset into row for data.\n\n    Raises:\n      IndexError: If the offset is out of bands.\n    '
    if (row_index < 0):
        row_index += len(self)
    if (not (0 <= row_index < len(self))):
        raise IndexError(('Index "%s" is out of bounds.' % row_index))
    new_row = Row()
    for idx in self.header:
        if (self.index(idx) == row_index):
            new_row[key] = value
        new_row[idx] = self[idx]
    self._keys = new_row.header
    self._values = new_row.values
    del new_row
    self._BuildIndex()

dataset/ETHPy150Open google/textfsm/texttable.py Row.Insert/original