def set_rows(self, ids):
        # NOTE: make sure we have integers and not np.generic objects.
        assert all(isinstance(i, int) for i in ids)

        # Determine the sort column and dir to set after the rows.
        sort_col, sort_dir = self.current_sort
        default_sort_col, default_sort_dir = self.default_sort

        sort_col = sort_col or default_sort_col
        sort_dir = sort_dir or default_sort_dir or 'desc'

        # Set the rows.
        logger.log(5, "Set %d rows in the table.", len(ids))
        items = [self._get_row(id) for id in ids]
        # Sort the rows before passing them to the widget.
        # if sort_col:
        #     items = sorted(items, key=itemgetter(sort_col),
        #                    reverse=(sort_dir == 'desc'))
        data = _create_json_dict(items=items,
                                 cols=self.column_names,
                                 )
        self.eval_js('table.setData({});'.format(data))

        # Sort.
        if sort_col:
            self.sort_by(sort_col, sort_dir)
Set the rows of the table.
dataset/ETHPy150Open kwikteam/phy/phy/gui/widgets.py/Table.set_rows