def update(self):
        if self._root is None: return

        # Count the edges in each cell
        N = len(self._cells)
        cell_edges = [[0 for i in range(N)] for j in range(N)]
        for edge in self._chart:
            cell_edges[edge.start()][edge.end()] += 1

        # Color the cells correspondingly.
        for i in range(N):
            for j in range(i, N):
                if cell_edges[i][j] == 0:
                    color = 'gray20'
                else:
                    color = ('#00%02x%02x' %
                             (min(255, 50+128*cell_edges[i][j]/10),
                              max(0, 128-128*10/cell_edges[i][j])))
                cell_tag = self._cells[i][j]
                self._canvas.itemconfig(cell_tag, fill=color)
                if (i,j) == self._selected_cell:
                    self._canvas.itemconfig(cell_tag, outline='#00ffff',
                                            width=3)
                    self._canvas.tag_raise(cell_tag)
                else:
                    self._canvas.itemconfig(cell_tag, outline='black',
                                            width=1)

        # Update the edge list.
        edges = list(self._chart.select(span=self._selected_cell))
        self._list.set(edges)

        # Update our edge count.
        self._num_edges = self._chart.num_edges()
        if self._numedges_label is not None:
            self._numedges_label['text'] = '%d edges' % self._num_edges
dataset/ETHPy150Open nltk/nltk/nltk/app/chartparser_app.py/ChartMatrixView.update/swapped operands of `/`