def _all_add_or_modify_row(self, item_name, insert_dict, table, index=None, condition=None,<EOL>condvars=None,<EOL>flags=(ADD_ROW, MODIFY_ROW,)):
if len(flags) == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>if index is not None and condition is not None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>elif condition is not None:<EOL><INDENT>row_iterator = table.where(condition, condvars=condvars)<EOL><DEDENT>elif index is not None:<EOL><INDENT>row_iterator = table.iterrows(index, index + <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>row_iterator = None<EOL><DEDENT>try:<EOL><INDENT>row = next(row_iterator)<EOL><DEDENT>except TypeError:<EOL><INDENT>row = None<EOL><DEDENT>except StopIteration:<EOL><INDENT>row = None<EOL><DEDENT>if ((HDF5StorageService.MODIFY_ROW in flags or HDF5StorageService.ADD_ROW in flags) and<EOL>HDF5StorageService.REMOVE_ROW in flags):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if row is None and HDF5StorageService.ADD_ROW in flags:<EOL><INDENT>row = table.row<EOL>self._all_insert_into_row(row, insert_dict)<EOL>row.append()<EOL><DEDENT>elif row is not None and HDF5StorageService.MODIFY_ROW in flags:<EOL><INDENT>self._all_insert_into_row(row, insert_dict)<EOL>row.update()<EOL><DEDENT>elif HDF5StorageService.REMOVE_ROW in flags:<EOL><INDENT>if row is not None:<EOL><INDENT>row_number = row.nrow<EOL>try:<EOL><INDENT>table.remove_rows(start=row_number, stop=row_number+<NUM_LIT:1>)<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>self._all_kill_iterator(row_iterator)<EOL>table.flush()<EOL>if HDF5StorageService.REMOVE_ROW not in flags and row is None:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT>' % (item_name, table._v_name))<EOL><DEDENT>
Adds or changes a row in a pytable.

        :param item_name: Name of item, the row is about, only important for throwing errors.

        :param insert_dict:

            Dictionary of data that is about to be inserted into the pytables row.

        :param table:

            The table to insert or modify a row in

        :param index:

            Index of row to be modified. Instead of an index a search condition can be
            used as well, see below.

        :param condition:

            Condition to search for in the table

        :param condvars:

            Variables for the search condition

        :param flags:

            Flags whether to add, modify, or remove a row in the table