{
    "file_diffs": [
        {
            "old_file_content": "import itertools\nimport logging\nfrom functools import partial\n\nfrom AnyQt.QtWidgets import QTableView\nfrom AnyQt.QtCore import Qt, QSize, QItemSelection, QItemSelectionRange\n\nfrom Orange.data import Table, Variable, StringVariable\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets.utils.distmatrixmodel import \\\n    DistMatrixModel, DistMatrixView\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.settings import Setting, ContextSetting, ContextHandler\nfrom Orange.widgets.utils.itemmodels import VariableListModel\nfrom Orange.widgets.utils.itemselectionmodel import SymmetricSelectionModel, \\\n    BlockSelectionModel, selection_blocks, ranges\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\nlog = logging.getLogger(__name__)\n\n\nclass DistanceMatrixContextHandler(ContextHandler):\n    @staticmethod\n    def _var_names(annotations):\n        return [a.name if isinstance(a, Variable) else a for a in annotations]\n\n    # pylint: disable=arguments-differ\n    def new_context(self, matrix, annotations):\n        context = super().new_context()\n        context.shape = matrix.shape\n        context.symmetric = matrix.is_symmetric()\n        context.annotations = self._var_names(annotations)\n        context.annotation = context.annotations[1]\n        context.selection = [] if context.symmetric else ([], [])\n        return context\n\n    # pylint: disable=arguments-differ\n    def match(self, context, matrix, annotations):\n        annotations = self._var_names(annotations)\n        if context.shape != matrix.shape \\\n                or context.symmetric is not matrix.is_symmetric() \\\n                or context.annotation not in annotations:\n            return 0\n        return 1 + (context.annotations == annotations)\n\n    def settings_from_widget(self, widget, *args):\n        # pylint: disable=protected-access\n        context = widget.current_context\n        if context is not None:\n            context.annotation = widget.annot_combo.currentText()\n            context.selection, _ = widget._get_selection()\n\n    def settings_to_widget(self, widget, *args):\n        # pylint: disable=protected-access\n        context = widget.current_context\n        widget.annotation_idx = context.annotations.index(context.annotation)\n        widget._set_selection(context.selection)\n\n\nclass OWDistanceMatrix(widget.OWWidget):\n    name = \"Distance Matrix\"\n    description = \"View distance matrix.\"\n    icon = \"icons/DistanceMatrix.svg\"\n    priority = 200\n    keywords = \"distance matrix\"\n\n    class Inputs:\n        distances = Input(\"Distances\", DistMatrix)\n\n    class Outputs:\n        distances = Output(\"Distances\", DistMatrix, dynamic=False)\n        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])\n\n    settingsHandler = DistanceMatrixContextHandler()\n    settings_version = 2\n    auto_commit = Setting(True)\n    annotation_idx = ContextSetting(1)\n    selection = ContextSetting([])\n\n    want_control_area = True\n    want_main_area = False\n\n    def __init__(self):\n        super().__init__()\n        self.distances = None\n        self.items = None\n\n        self.tablemodel = DistMatrixModel()\n        view = self.tableview = DistMatrixView()\n        view.setModel(self.tablemodel)\n        view.setSelectionBehavior(QTableView.SelectItems)\n        self.controlArea.layout().addWidget(view)\n\n        self.annot_combo = gui.comboBox(\n            self.buttonsArea, self, \"annotation_idx\", label=\"Labels: \",\n            orientation=Qt.Horizontal,\n            callback=self._invalidate_annotations, contentsLength=12)\n        self.annot_combo.setModel(VariableListModel())\n        self.annot_combo.model()[:] = [\"None\", \"Enumeration\"]\n        gui.rubber(self.buttonsArea)\n        acb = gui.auto_send(self.buttonsArea, self, \"auto_commit\", box=False)\n        acb.setFixedWidth(200)\n\n    def sizeHint(self):\n        return QSize(800, 500)\n\n    @Inputs.distances\n    def set_distances(self, distances):\n        self.closeContext()\n        self.distances = distances\n        self.tablemodel.set_data(self.distances)\n        self.items = None\n\n        annotations = [\"None\", \"Enumerate\"]\n        view = self.tableview\n\n        if distances is not None:\n            pending_idx = 1\n\n            if not distances.is_symmetric():\n                seltype = BlockSelectionModel\n                if distances.row_items is not None \\\n                        or distances.col_items is not None:\n                    annotations.append(\"Labels\")\n                    pending_idx = 2\n            else:\n                seltype = SymmetricSelectionModel\n                self.items = items = distances.row_items\n\n                if items and not distances.axis:\n                    annotations.append(\"Attribute names\")\n                    pending_idx = 2\n                elif isinstance(items, list) and \\\n                        all(isinstance(item, Variable) for item in items):\n                    annotations.append(\"Name\")\n                    pending_idx = 2\n                elif isinstance(items, Table):\n                    annotations.extend(\n                        itertools.chain(items.domain.variables, items.domain.metas))\n                    pending_idx = annotations.index(self._choose_label(items))\n\n            selmodel = seltype(view.model(), view)\n            selmodel.selectionChanged.connect(self.commit.deferred)\n            view.setSelectionModel(selmodel)\n        else:\n            pending_idx = 0\n            view.selectionModel().clear()\n\n        self.annot_combo.model()[:] = annotations\n        self.annotation_idx = pending_idx\n        if distances is not None:\n            self.openContext(distances, annotations)\n        self._update_labels()\n        view.resizeColumnsToContents()\n        self.commit.now()\n\n    @staticmethod\n    def _choose_label(data: Table):\n        attr = max((attr for attr in data.domain.metas\n                    if isinstance(attr, StringVariable)),\n                   key=lambda x: len(set(data.get_column(x))),\n                   default=None)\n        return attr or data.domain.class_var or \"Enumerate\"\n\n    def _invalidate_annotations(self):\n        if self.distances is not None:\n            self._update_labels()\n\n    def _update_labels(self):\n        def enumeration(n):\n            return [str(i + 1) for i in range(n)]\n\n        hor_labels = ver_labels = None\n        colors = None\n\n        if self.annotation_idx == 0:\n            pass\n\n        elif self.annotation_idx == 1:\n            ver_labels, hor_labels = map(enumeration, self.distances.shape)\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Attribute names\":\n            attr = self.distances.row_items.domain.attributes\n            ver_labels = hor_labels = [\n                str(attr[i]) for i in range(self.distances.shape[0])]\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Labels\":\n            if self.distances.col_items is not None:\n                hor_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.col_items)]\n            else:\n                hor_labels = enumeration(self.distances.shape[1])\n            if self.distances.row_items is not None:\n                ver_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.row_items)]\n            else:\n                ver_labels = enumeration(self.distances.shape[0])\n\n        elif self.annotation_idx == 2 and \\\n                isinstance(self.items, widget.AttributeList):\n            ver_labels = hor_labels = [v.name for v in self.items]\n\n        elif isinstance(self.items, Table):\n            var = self.annot_combo.model()[self.annotation_idx]\n            column = self.items.get_column(var)\n            if var.is_primitive():\n                colors = var.palette.values_to_qcolors(column)\n            ver_labels = hor_labels = [var.str_val(value) for value in column]\n\n        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),\n                               (self.tableview.verticalHeader(), ver_labels)):\n            self.tablemodel.set_labels(header.orientation(), labels, colors)\n            if labels is None:\n                header.hide()\n            else:\n                header.show()\n        self.tableview.resizeColumnsToContents()\n\n    @gui.deferred\n    def commit(self):\n        sub_table = sub_distances = None\n        if self.distances is not None:\n            inds, symmetric = self._get_selection()\n            if symmetric:\n                if inds:\n                    sub_distances = self.distances.submatrix(inds)\n                    if self.distances.axis and isinstance(self.items, Table):\n                        sub_table = self.items[inds]\n            elif all(inds):\n                sub_distances = self.distances.submatrix(*inds)\n        self.Outputs.distances.send(sub_distances)\n        self.Outputs.table.send(sub_table)\n\n    def _get_selection(self):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            return self.tableview.selectionModel().selectedItems(), True\n        else:\n            row_spans, col_spans = selection_blocks(selmodel.selection())\n            rows = list(itertools.chain.from_iterable(\n                itertools.starmap(range, row_spans)))\n            cols = list(itertools.chain.from_iterable(\n                itertools.starmap(range, col_spans)))\n            return (rows, cols), False\n\n    def _set_selection(self, selection):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            if not isinstance(selection, list):\n                log.error(\"wrong data for symmetric selection\")\n                return\n            selmodel.setSelectedItems(selection)\n        else:\n            if not isinstance(selection, tuple) and len(selection) == 2:\n                log.error(\"wrong data for asymmetric selection\")\n                return\n            rows, cols = selection\n            selection = QItemSelection()\n            rowranges = list(ranges(rows))\n            colranges = list(ranges(cols))\n\n            index = self.tablemodel.index\n            for rowstart, rowend in rowranges:\n                for colstart, colend in colranges:\n                    selection.append(\n                        QItemSelectionRange(\n                            index(rowstart, colstart),\n                            index(rowend - 1, colend - 1)\n                        )\n                    )\n            selmodel.select(selection, selmodel.ClearAndSelect)\n\n    def send_report(self):\n        if self.distances is None:\n            return\n        model = self.tablemodel\n        index = model.index\n        ndec = self.tableview.itemDelegate().ndecimals\n        header = model.headerData\n        h, w = self.distances.shape\n\n        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))\n        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))\n\n        def cell(func, num):\n            label, brush = (func(role)\n                            for role in (Qt.DisplayRole, Qt.BackgroundRole))\n            if brush:\n                style = f' style=\"background-color: {brush.color().name()}\"'\n            else:\n                style = \"\"\n            label = \"\" if label is None else f\"{label:.{ndec}f}\" if num else label\n            self.report_raw(f\"<td {style}>{label}</td>\\n\")\n\n        self.report_raw('<table style=\"border-collapse:collapse\">')\n        if hor_header:\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                self.report_raw(\"<td></td>\")\n            for col in range(w):\n                cell(partial(header, col, Qt.Horizontal), False)\n            self.report_raw(\"</tr>\")\n\n        for row in range(h):\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                cell(partial(header, row, Qt.Vertical), False)\n            for col in range(w):\n                cell(index(row, col).data, True)\n            self.report_raw(\"</tr>\")\n        self.report_raw(\"</table>\")\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 2:\n            context.shape = (context.dim, context.dim)\n            context.symmetric = True\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    import Orange.distance\n    data = Orange.data.Table(\"zoo\")\n    dist = Orange.distance.Euclidean(data)\n    # dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n    # dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n    # dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n    WidgetPreview(OWDistanceMatrix).run(dist)\n",
            "new_file_content": "import itertools\nimport logging\nfrom functools import partial\n\nfrom AnyQt.QtWidgets import QTableView\nfrom AnyQt.QtCore import Qt, QSize, QItemSelection, QItemSelectionRange\n\nfrom Orange.data import Table, Variable, StringVariable\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets.utils.distmatrixmodel import \\\n    DistMatrixModel, DistMatrixView\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.settings import Setting, ContextSetting, ContextHandler\nfrom Orange.widgets.utils.itemmodels import VariableListModel\nfrom Orange.widgets.utils.itemselectionmodel import SymmetricSelectionModel, \\\n    BlockSelectionModel, selection_blocks, ranges\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\nlog = logging.getLogger(__name__)\n\n\nclass DistanceMatrixContextHandler(ContextHandler):\n    @staticmethod\n    def _var_names(annotations):\n        return [a.name if isinstance(a, Variable) else a for a in annotations]\n\n    # pylint: disable=arguments-differ\n    def new_context(self, matrix, annotations):\n        context = super().new_context()\n        context.shape = matrix.shape\n        context.symmetric = matrix.is_symmetric()\n        context.annotations = self._var_names(annotations)\n        context.annotation = context.annotations[1]\n        context.selection = [] if context.symmetric else ([], [])\n        return context\n\n    # pylint: disable=arguments-differ\n    def match(self, context, matrix, annotations):\n        annotations = self._var_names(annotations)\n        if context.shape != matrix.shape \\\n                or context.symmetric is not matrix.is_symmetric() \\\n                or context.annotation not in annotations:\n            return 0\n        return 1 + (context.annotations == annotations)\n\n    def settings_from_widget(self, widget, *args):\n        # pylint: disable=protected-access\n        context = widget.current_context\n        if context is not None:\n            context.annotation = widget.annot_combo.currentText()\n            context.selection, _ = widget._get_selection()\n\n    def settings_to_widget(self, widget, *args):\n        # pylint: disable=protected-access\n        context = widget.current_context\n        widget.annotation_idx = context.annotations.index(context.annotation)\n        widget._set_selection(context.selection)\n\n\nclass OWDistanceMatrix(widget.OWWidget):\n    name = \"Distance Matrix\"\n    description = \"View distance matrix.\"\n    icon = \"icons/DistanceMatrix.svg\"\n    priority = 200\n    keywords = \"distance matrix\"\n\n    class Inputs:\n        distances = Input(\"Distances\", DistMatrix)\n\n    class Outputs:\n        distances = Output(\"Distances\", DistMatrix, dynamic=False)\n        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])\n\n    class Error(widget.OWWidget.Error):\n        empty_matrix = widget.Msg(\"Distance matrix is empty.\")\n\n    settingsHandler = DistanceMatrixContextHandler()\n    settings_version = 2\n    auto_commit = Setting(True)\n    annotation_idx = ContextSetting(1)\n    selection = ContextSetting([])\n\n    want_control_area = True\n    want_main_area = False\n\n    def __init__(self):\n        super().__init__()\n        self.distances = None\n        self.items = None\n\n        self.tablemodel = DistMatrixModel()\n        view = self.tableview = DistMatrixView()\n        view.setModel(self.tablemodel)\n        view.setSelectionBehavior(QTableView.SelectItems)\n        self.controlArea.layout().addWidget(view)\n\n        self.annot_combo = gui.comboBox(\n            self.buttonsArea, self, \"annotation_idx\", label=\"Labels: \",\n            orientation=Qt.Horizontal,\n            callback=self._invalidate_annotations, contentsLength=12)\n        self.annot_combo.setModel(VariableListModel())\n        self.annot_combo.model()[:] = [\"None\", \"Enumeration\"]\n        gui.rubber(self.buttonsArea)\n        acb = gui.auto_send(self.buttonsArea, self, \"auto_commit\", box=False)\n        acb.setFixedWidth(200)\n\n    def sizeHint(self):\n        return QSize(800, 500)\n\n    @Inputs.distances\n    def set_distances(self, distances):\n        self.clear_messages()\n        self.closeContext()\n        if distances is not None:\n            if len(distances) == 0:\n                distances = None\n                self.Error.empty_matrix()\n        self.distances = distances\n        self.tablemodel.set_data(self.distances)\n        self.items = None\n\n        annotations = [\"None\", \"Enumerate\"]\n        view = self.tableview\n\n        if distances is not None:\n            pending_idx = 1\n\n            if not distances.is_symmetric():\n                seltype = BlockSelectionModel\n                if distances.row_items is not None \\\n                        or distances.col_items is not None:\n                    annotations.append(\"Labels\")\n                    pending_idx = 2\n            else:\n                seltype = SymmetricSelectionModel\n                self.items = items = distances.row_items\n\n                if items and not distances.axis:\n                    annotations.append(\"Attribute names\")\n                    pending_idx = 2\n                elif isinstance(items, list) and \\\n                        all(isinstance(item, Variable) for item in items):\n                    annotations.append(\"Name\")\n                    pending_idx = 2\n                elif isinstance(items, Table):\n                    annotations.extend(\n                        itertools.chain(items.domain.variables, items.domain.metas))\n                    pending_idx = annotations.index(self._choose_label(items))\n\n            selmodel = seltype(view.model(), view)\n            selmodel.selectionChanged.connect(self.commit.deferred)\n            view.setSelectionModel(selmodel)\n        else:\n            pending_idx = 0\n            view.selectionModel().clear()\n\n        self.annot_combo.model()[:] = annotations\n        self.annotation_idx = pending_idx\n        if distances is not None:\n            self.openContext(distances, annotations)\n        self._update_labels()\n        view.resizeColumnsToContents()\n        self.commit.now()\n\n    @staticmethod\n    def _choose_label(data: Table):\n        attr = max((attr for attr in data.domain.metas\n                    if isinstance(attr, StringVariable)),\n                   key=lambda x: len(set(data.get_column(x))),\n                   default=None)\n        return attr or data.domain.class_var or \"Enumerate\"\n\n    def _invalidate_annotations(self):\n        if self.distances is not None:\n            self._update_labels()\n\n    def _update_labels(self):\n        def enumeration(n):\n            return [str(i + 1) for i in range(n)]\n\n        hor_labels = ver_labels = None\n        colors = None\n\n        if self.annotation_idx == 0:\n            pass\n\n        elif self.annotation_idx == 1:\n            ver_labels, hor_labels = map(enumeration, self.distances.shape)\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Attribute names\":\n            attr = self.distances.row_items.domain.attributes\n            ver_labels = hor_labels = [\n                str(attr[i]) for i in range(self.distances.shape[0])]\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Labels\":\n            if self.distances.col_items is not None:\n                hor_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.col_items)]\n            else:\n                hor_labels = enumeration(self.distances.shape[1])\n            if self.distances.row_items is not None:\n                ver_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.row_items)]\n            else:\n                ver_labels = enumeration(self.distances.shape[0])\n\n        elif self.annotation_idx == 2 and \\\n                isinstance(self.items, widget.AttributeList):\n            ver_labels = hor_labels = [v.name for v in self.items]\n\n        elif isinstance(self.items, Table):\n            var = self.annot_combo.model()[self.annotation_idx]\n            column = self.items.get_column(var)\n            if var.is_primitive():\n                colors = var.palette.values_to_qcolors(column)\n            ver_labels = hor_labels = [var.str_val(value) for value in column]\n\n        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),\n                               (self.tableview.verticalHeader(), ver_labels)):\n            self.tablemodel.set_labels(header.orientation(), labels, colors)\n            if labels is None:\n                header.hide()\n            else:\n                header.show()\n        self.tableview.resizeColumnsToContents()\n\n    @gui.deferred\n    def commit(self):\n        sub_table = sub_distances = None\n        if self.distances is not None:\n            inds, symmetric = self._get_selection()\n            if symmetric:\n                if inds:\n                    sub_distances = self.distances.submatrix(inds)\n                    if self.distances.axis and isinstance(self.items, Table):\n                        sub_table = self.items[inds]\n            elif all(inds):\n                sub_distances = self.distances.submatrix(*inds)\n        self.Outputs.distances.send(sub_distances)\n        self.Outputs.table.send(sub_table)\n\n    def _get_selection(self):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            return self.tableview.selectionModel().selectedItems(), True\n        else:\n            row_spans, col_spans = selection_blocks(selmodel.selection())\n            rows = list(itertools.chain.from_iterable(\n                itertools.starmap(range, row_spans)))\n            cols = list(itertools.chain.from_iterable(\n                itertools.starmap(range, col_spans)))\n            return (rows, cols), False\n\n    def _set_selection(self, selection):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            if not isinstance(selection, list):\n                log.error(\"wrong data for symmetric selection\")\n                return\n            selmodel.setSelectedItems(selection)\n        else:\n            if not isinstance(selection, tuple) and len(selection) == 2:\n                log.error(\"wrong data for asymmetric selection\")\n                return\n            rows, cols = selection\n            selection = QItemSelection()\n            rowranges = list(ranges(rows))\n            colranges = list(ranges(cols))\n\n            index = self.tablemodel.index\n            for rowstart, rowend in rowranges:\n                for colstart, colend in colranges:\n                    selection.append(\n                        QItemSelectionRange(\n                            index(rowstart, colstart),\n                            index(rowend - 1, colend - 1)\n                        )\n                    )\n            selmodel.select(selection, selmodel.ClearAndSelect)\n\n    def send_report(self):\n        if self.distances is None:\n            return\n        model = self.tablemodel\n        index = model.index\n        ndec = self.tableview.itemDelegate().ndecimals\n        header = model.headerData\n        h, w = self.distances.shape\n\n        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))\n        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))\n\n        def cell(func, num):\n            label, brush = (func(role)\n                            for role in (Qt.DisplayRole, Qt.BackgroundRole))\n            if brush:\n                style = f' style=\"background-color: {brush.color().name()}\"'\n            else:\n                style = \"\"\n            label = \"\" if label is None else f\"{label:.{ndec}f}\" if num else label\n            self.report_raw(f\"<td {style}>{label}</td>\\n\")\n\n        self.report_raw('<table style=\"border-collapse:collapse\">')\n        if hor_header:\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                self.report_raw(\"<td></td>\")\n            for col in range(w):\n                cell(partial(header, col, Qt.Horizontal), False)\n            self.report_raw(\"</tr>\")\n\n        for row in range(h):\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                cell(partial(header, row, Qt.Vertical), False)\n            for col in range(w):\n                cell(index(row, col).data, True)\n            self.report_raw(\"</tr>\")\n        self.report_raw(\"</table>\")\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 2:\n            context.shape = (context.dim, context.dim)\n            context.symmetric = True\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    import Orange.distance\n    data = Orange.data.Table(\"zoo\")\n    dist = Orange.distance.Euclidean(data)\n    # dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n    # dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n    # dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n    WidgetPreview(OWDistanceMatrix).run(dist)\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/unsupervised/owdistancematrix.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "5edd2215f",
                "new_commit_hash": "e9e5c6ca1",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/unsupervised/owdistancematrix.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/unsupervised/owdistancematrix.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 72,
                            "length": 6
                        },
                        "new_range": {
                            "start": 72,
                            "length": 9
                        },
                        "section": "class OWDistanceMatrix(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        distances = Output(\"Distances\", DistMatrix, dynamic=False)",
                                "type": "context"
                            },
                            {
                                "content": "        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    class Error(widget.OWWidget.Error):",
                                "type": "added"
                            },
                            {
                                "content": "        empty_matrix = widget.Msg(\"Distance matrix is empty.\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    settingsHandler = DistanceMatrixContextHandler()",
                                "type": "context"
                            },
                            {
                                "content": "    settings_version = 2",
                                "type": "context"
                            },
                            {
                                "content": "    auto_commit = Setting(True)",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owdistancematrix.py",
                            "type": "class",
                            "name": "OWDistanceMatrix",
                            "content": "class OWDistanceMatrix(widget.OWWidget):\n    name = \"Distance Matrix\"\n    description = \"View distance matrix.\"\n    icon = \"icons/DistanceMatrix.svg\"\n    priority = 200\n    keywords = \"distance matrix\"\n\n    class Inputs:\n        distances = Input(\"Distances\", DistMatrix)\n\n    class Outputs:\n        distances = Output(\"Distances\", DistMatrix, dynamic=False)\n        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])\n\n    class Error(widget.OWWidget.Error):\n        empty_matrix = widget.Msg(\"Distance matrix is empty.\")\n\n    settingsHandler = DistanceMatrixContextHandler()\n    settings_version = 2\n    auto_commit = Setting(True)\n    annotation_idx = ContextSetting(1)\n    selection = ContextSetting([])\n\n    want_control_area = True\n    want_main_area = False\n\n    def __init__(self):\n        super().__init__()\n        self.distances = None\n        self.items = None\n\n        self.tablemodel = DistMatrixModel()\n        view = self.tableview = DistMatrixView()\n        view.setModel(self.tablemodel)\n        view.setSelectionBehavior(QTableView.SelectItems)\n        self.controlArea.layout().addWidget(view)\n\n        self.annot_combo = gui.comboBox(\n            self.buttonsArea, self, \"annotation_idx\", label=\"Labels: \",\n            orientation=Qt.Horizontal,\n            callback=self._invalidate_annotations, contentsLength=12)\n        self.annot_combo.setModel(VariableListModel())\n        self.annot_combo.model()[:] = [\"None\", \"Enumeration\"]\n        gui.rubber(self.buttonsArea)\n        acb = gui.auto_send(self.buttonsArea, self, \"auto_commit\", box=False)\n        acb.setFixedWidth(200)\n\n    def sizeHint(self):\n        return QSize(800, 500)\n\n    @Inputs.distances\n    def set_distances(self, distances):\n        self.clear_messages()\n        self.closeContext()\n        if distances is not None:\n            if len(distances) == 0:\n                distances = None\n                self.Error.empty_matrix()\n        self.distances = distances\n        self.tablemodel.set_data(self.distances)\n        self.items = None\n\n        annotations = [\"None\", \"Enumerate\"]\n        view = self.tableview\n\n        if distances is not None:\n            pending_idx = 1\n\n            if not distances.is_symmetric():\n                seltype = BlockSelectionModel\n                if distances.row_items is not None \\\n                        or distances.col_items is not None:\n                    annotations.append(\"Labels\")\n                    pending_idx = 2\n            else:\n                seltype = SymmetricSelectionModel\n                self.items = items = distances.row_items\n\n                if items and not distances.axis:\n                    annotations.append(\"Attribute names\")\n                    pending_idx = 2\n                elif isinstance(items, list) and \\\n                        all(isinstance(item, Variable) for item in items):\n                    annotations.append(\"Name\")\n                    pending_idx = 2\n                elif isinstance(items, Table):\n                    annotations.extend(\n                        itertools.chain(items.domain.variables, items.domain.metas))\n                    pending_idx = annotations.index(self._choose_label(items))\n\n            selmodel = seltype(view.model(), view)\n            selmodel.selectionChanged.connect(self.commit.deferred)\n            view.setSelectionModel(selmodel)\n        else:\n            pending_idx = 0\n            view.selectionModel().clear()\n\n        self.annot_combo.model()[:] = annotations\n        self.annotation_idx = pending_idx\n        if distances is not None:\n            self.openContext(distances, annotations)\n        self._update_labels()\n        view.resizeColumnsToContents()\n        self.commit.now()\n\n    @staticmethod\n    def _choose_label(data: Table):\n        attr = max((attr for attr in data.domain.metas\n                    if isinstance(attr, StringVariable)),\n                   key=lambda x: len(set(data.get_column(x))),\n                   default=None)\n        return attr or data.domain.class_var or \"Enumerate\"\n\n    def _invalidate_annotations(self):\n        if self.distances is not None:\n            self._update_labels()\n\n    def _update_labels(self):\n        def enumeration(n):\n            return [str(i + 1) for i in range(n)]\n\n        hor_labels = ver_labels = None\n        colors = None\n\n        if self.annotation_idx == 0:\n            pass\n\n        elif self.annotation_idx == 1:\n            ver_labels, hor_labels = map(enumeration, self.distances.shape)\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Attribute names\":\n            attr = self.distances.row_items.domain.attributes\n            ver_labels = hor_labels = [\n                str(attr[i]) for i in range(self.distances.shape[0])]\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Labels\":\n            if self.distances.col_items is not None:\n                hor_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.col_items)]\n            else:\n                hor_labels = enumeration(self.distances.shape[1])\n            if self.distances.row_items is not None:\n                ver_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.row_items)]\n            else:\n                ver_labels = enumeration(self.distances.shape[0])\n\n        elif self.annotation_idx == 2 and \\\n                isinstance(self.items, widget.AttributeList):\n            ver_labels = hor_labels = [v.name for v in self.items]\n\n        elif isinstance(self.items, Table):\n            var = self.annot_combo.model()[self.annotation_idx]\n            column = self.items.get_column(var)\n            if var.is_primitive():\n                colors = var.palette.values_to_qcolors(column)\n            ver_labels = hor_labels = [var.str_val(value) for value in column]\n\n        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),\n                               (self.tableview.verticalHeader(), ver_labels)):\n            self.tablemodel.set_labels(header.orientation(), labels, colors)\n            if labels is None:\n                header.hide()\n            else:\n                header.show()\n        self.tableview.resizeColumnsToContents()\n\n    @gui.deferred\n    def commit(self):\n        sub_table = sub_distances = None\n        if self.distances is not None:\n            inds, symmetric = self._get_selection()\n            if symmetric:\n                if inds:\n                    sub_distances = self.distances.submatrix(inds)\n                    if self.distances.axis and isinstance(self.items, Table):\n                        sub_table = self.items[inds]\n            elif all(inds):\n                sub_distances = self.distances.submatrix(*inds)\n        self.Outputs.distances.send(sub_distances)\n        self.Outputs.table.send(sub_table)\n\n    def _get_selection(self):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            return self.tableview.selectionModel().selectedItems(), True\n        else:\n            row_spans, col_spans = selection_blocks(selmodel.selection())\n            rows = list(itertools.chain.from_iterable(\n                itertools.starmap(range, row_spans)))\n            cols = list(itertools.chain.from_iterable(\n                itertools.starmap(range, col_spans)))\n            return (rows, cols), False\n\n    def _set_selection(self, selection):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            if not isinstance(selection, list):\n                log.error(\"wrong data for symmetric selection\")\n                return\n            selmodel.setSelectedItems(selection)\n        else:\n            if not isinstance(selection, tuple) and len(selection) == 2:\n                log.error(\"wrong data for asymmetric selection\")\n                return\n            rows, cols = selection\n            selection = QItemSelection()\n            rowranges = list(ranges(rows))\n            colranges = list(ranges(cols))\n\n            index = self.tablemodel.index\n            for rowstart, rowend in rowranges:\n                for colstart, colend in colranges:\n                    selection.append(\n                        QItemSelectionRange(\n                            index(rowstart, colstart),\n                            index(rowend - 1, colend - 1)\n                        )\n                    )\n            selmodel.select(selection, selmodel.ClearAndSelect)\n\n    def send_report(self):\n        if self.distances is None:\n            return\n        model = self.tablemodel\n        index = model.index\n        ndec = self.tableview.itemDelegate().ndecimals\n        header = model.headerData\n        h, w = self.distances.shape\n\n        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))\n        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))\n\n        def cell(func, num):\n            label, brush = (func(role)\n                            for role in (Qt.DisplayRole, Qt.BackgroundRole))\n            if brush:\n                style = f' style=\"background-color: {brush.color().name()}\"'\n            else:\n                style = \"\"\n            label = \"\" if label is None else f\"{label:.{ndec}f}\" if num else label\n            self.report_raw(f\"<td {style}>{label}</td>\\n\")\n\n        self.report_raw('<table style=\"border-collapse:collapse\">')\n        if hor_header:\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                self.report_raw(\"<td></td>\")\n            for col in range(w):\n                cell(partial(header, col, Qt.Horizontal), False)\n            self.report_raw(\"</tr>\")\n\n        for row in range(h):\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                cell(partial(header, row, Qt.Vertical), False)\n            for col in range(w):\n                cell(index(row, col).data, True)\n            self.report_raw(\"</tr>\")\n        self.report_raw(\"</table>\")\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 2:\n            context.shape = (context.dim, context.dim)\n            context.symmetric = True",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 61,
                            "end_lineno": 328,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 107,
                            "length": 7
                        },
                        "new_range": {
                            "start": 110,
                            "length": 12
                        },
                        "section": "class OWDistanceMatrix(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    @Inputs.distances",
                                "type": "context"
                            },
                            {
                                "content": "    def set_distances(self, distances):",
                                "type": "context"
                            },
                            {
                                "content": "        self.clear_messages()",
                                "type": "added"
                            },
                            {
                                "content": "        self.closeContext()",
                                "type": "context"
                            },
                            {
                                "content": "        if distances is not None:",
                                "type": "added"
                            },
                            {
                                "content": "            if len(distances) == 0:",
                                "type": "added"
                            },
                            {
                                "content": "                distances = None",
                                "type": "added"
                            },
                            {
                                "content": "                self.Error.empty_matrix()",
                                "type": "added"
                            },
                            {
                                "content": "        self.distances = distances",
                                "type": "context"
                            },
                            {
                                "content": "        self.tablemodel.set_data(self.distances)",
                                "type": "context"
                            },
                            {
                                "content": "        self.items = None",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owdistancematrix.py",
                            "type": "method",
                            "name": "OWDistanceMatrix.set_distances",
                            "content": "class OWDistanceMatrix(widget.OWWidget):\n    name = \"Distance Matrix\"\n    description = \"View distance matrix.\"\n    icon = \"icons/DistanceMatrix.svg\"\n    priority = 200\n    keywords = \"distance matrix\"\n\n    class Inputs:\n        distances = Input(\"Distances\", DistMatrix)\n\n    class Outputs:\n        distances = Output(\"Distances\", DistMatrix, dynamic=False)\n        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])\n\n    class Error(widget.OWWidget.Error):\n        empty_matrix = widget.Msg(\"Distance matrix is empty.\")\n\n    settingsHandler = DistanceMatrixContextHandler()\n    settings_version = 2\n    auto_commit = Setting(True)\n    annotation_idx = ContextSetting(1)\n    selection = ContextSetting([])\n\n    want_control_area = True\n    want_main_area = False\n\n    def __init__(self):\n        super().__init__()\n        self.distances = None\n        self.items = None\n\n        self.tablemodel = DistMatrixModel()\n        view = self.tableview = DistMatrixView()\n        view.setModel(self.tablemodel)\n        view.setSelectionBehavior(QTableView.SelectItems)\n        self.controlArea.layout().addWidget(view)\n\n        self.annot_combo = gui.comboBox(\n            self.buttonsArea, self, \"annotation_idx\", label=\"Labels: \",\n            orientation=Qt.Horizontal,\n            callback=self._invalidate_annotations, contentsLength=12)\n        self.annot_combo.setModel(VariableListModel())\n        self.annot_combo.model()[:] = [\"None\", \"Enumeration\"]\n        gui.rubber(self.buttonsArea)\n        acb = gui.auto_send(self.buttonsArea, self, \"auto_commit\", box=False)\n        acb.setFixedWidth(200)\n\n    def sizeHint(self):\n        return QSize(800, 500)\n\n    @Inputs.distances\n    def set_distances(self, distances):\n        self.clear_messages()\n        self.closeContext()\n        if distances is not None:\n            if len(distances) == 0:\n                distances = None\n                self.Error.empty_matrix()\n        self.distances = distances\n        self.tablemodel.set_data(self.distances)\n        self.items = None\n\n        annotations = [\"None\", \"Enumerate\"]\n        view = self.tableview\n\n        if distances is not None:\n            pending_idx = 1\n\n            if not distances.is_symmetric():\n                seltype = BlockSelectionModel\n                if distances.row_items is not None \\\n                        or distances.col_items is not None:\n                    annotations.append(\"Labels\")\n                    pending_idx = 2\n            else:\n                seltype = SymmetricSelectionModel\n                self.items = items = distances.row_items\n\n                if items and not distances.axis:\n                    annotations.append(\"Attribute names\")\n                    pending_idx = 2\n                elif isinstance(items, list) and \\\n                        all(isinstance(item, Variable) for item in items):\n                    annotations.append(\"Name\")\n                    pending_idx = 2\n                elif isinstance(items, Table):\n                    annotations.extend(\n                        itertools.chain(items.domain.variables, items.domain.metas))\n                    pending_idx = annotations.index(self._choose_label(items))\n\n            selmodel = seltype(view.model(), view)\n            selmodel.selectionChanged.connect(self.commit.deferred)\n            view.setSelectionModel(selmodel)\n        else:\n            pending_idx = 0\n            view.selectionModel().clear()\n\n        self.annot_combo.model()[:] = annotations\n        self.annotation_idx = pending_idx\n        if distances is not None:\n            self.openContext(distances, annotations)\n        self._update_labels()\n        view.resizeColumnsToContents()\n        self.commit.now()\n\n    @staticmethod\n    def _choose_label(data: Table):\n        attr = max((attr for attr in data.domain.metas\n                    if isinstance(attr, StringVariable)),\n                   key=lambda x: len(set(data.get_column(x))),\n                   default=None)\n        return attr or data.domain.class_var or \"Enumerate\"\n\n    def _invalidate_annotations(self):\n        if self.distances is not None:\n            self._update_labels()\n\n    def _update_labels(self):\n        def enumeration(n):\n            return [str(i + 1) for i in range(n)]\n\n        hor_labels = ver_labels = None\n        colors = None\n\n        if self.annotation_idx == 0:\n            pass\n\n        elif self.annotation_idx == 1:\n            ver_labels, hor_labels = map(enumeration, self.distances.shape)\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Attribute names\":\n            attr = self.distances.row_items.domain.attributes\n            ver_labels = hor_labels = [\n                str(attr[i]) for i in range(self.distances.shape[0])]\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Labels\":\n            if self.distances.col_items is not None:\n                hor_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.col_items)]\n            else:\n                hor_labels = enumeration(self.distances.shape[1])\n            if self.distances.row_items is not None:\n                ver_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.row_items)]\n            else:\n                ver_labels = enumeration(self.distances.shape[0])\n\n        elif self.annotation_idx == 2 and \\\n                isinstance(self.items, widget.AttributeList):\n            ver_labels = hor_labels = [v.name for v in self.items]\n\n        elif isinstance(self.items, Table):\n            var = self.annot_combo.model()[self.annotation_idx]\n            column = self.items.get_column(var)\n            if var.is_primitive():\n                colors = var.palette.values_to_qcolors(column)\n            ver_labels = hor_labels = [var.str_val(value) for value in column]\n\n        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),\n                               (self.tableview.verticalHeader(), ver_labels)):\n            self.tablemodel.set_labels(header.orientation(), labels, colors)\n            if labels is None:\n                header.hide()\n            else:\n                header.show()\n        self.tableview.resizeColumnsToContents()\n\n    @gui.deferred\n    def commit(self):\n        sub_table = sub_distances = None\n        if self.distances is not None:\n            inds, symmetric = self._get_selection()\n            if symmetric:\n                if inds:\n                    sub_distances = self.distances.submatrix(inds)\n                    if self.distances.axis and isinstance(self.items, Table):\n                        sub_table = self.items[inds]\n            elif all(inds):\n                sub_distances = self.distances.submatrix(*inds)\n        self.Outputs.distances.send(sub_distances)\n        self.Outputs.table.send(sub_table)\n\n    def _get_selection(self):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            return self.tableview.selectionModel().selectedItems(), True\n        else:\n            row_spans, col_spans = selection_blocks(selmodel.selection())\n            rows = list(itertools.chain.from_iterable(\n                itertools.starmap(range, row_spans)))\n            cols = list(itertools.chain.from_iterable(\n                itertools.starmap(range, col_spans)))\n            return (rows, cols), False\n\n    def _set_selection(self, selection):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            if not isinstance(selection, list):\n                log.error(\"wrong data for symmetric selection\")\n                return\n            selmodel.setSelectedItems(selection)\n        else:\n            if not isinstance(selection, tuple) and len(selection) == 2:\n                log.error(\"wrong data for asymmetric selection\")\n                return\n            rows, cols = selection\n            selection = QItemSelection()\n            rowranges = list(ranges(rows))\n            colranges = list(ranges(cols))\n\n            index = self.tablemodel.index\n            for rowstart, rowend in rowranges:\n                for colstart, colend in colranges:\n                    selection.append(\n                        QItemSelectionRange(\n                            index(rowstart, colstart),\n                            index(rowend - 1, colend - 1)\n                        )\n                    )\n            selmodel.select(selection, selmodel.ClearAndSelect)\n\n    def send_report(self):\n        if self.distances is None:\n            return\n        model = self.tablemodel\n        index = model.index\n        ndec = self.tableview.itemDelegate().ndecimals\n        header = model.headerData\n        h, w = self.distances.shape\n\n        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))\n        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))\n\n        def cell(func, num):\n            label, brush = (func(role)\n                            for role in (Qt.DisplayRole, Qt.BackgroundRole))\n            if brush:\n                style = f' style=\"background-color: {brush.color().name()}\"'\n            else:\n                style = \"\"\n            label = \"\" if label is None else f\"{label:.{ndec}f}\" if num else label\n            self.report_raw(f\"<td {style}>{label}</td>\\n\")\n\n        self.report_raw('<table style=\"border-collapse:collapse\">')\n        if hor_header:\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                self.report_raw(\"<td></td>\")\n            for col in range(w):\n                cell(partial(header, col, Qt.Horizontal), False)\n            self.report_raw(\"</tr>\")\n\n        for row in range(h):\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                cell(partial(header, row, Qt.Vertical), False)\n            for col in range(w):\n                cell(index(row, col).data, True)\n            self.report_raw(\"</tr>\")\n        self.report_raw(\"</table>\")\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 2:\n            context.shape = (context.dim, context.dim)\n            context.symmetric = True",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 112,
                            "end_lineno": 164,
                            "parent": {
                                "file_name": "Orange/widgets/unsupervised/owdistancematrix.py",
                                "type": "class",
                                "name": "OWDistanceMatrix",
                                "content": "class OWDistanceMatrix(widget.OWWidget):\n    name = \"Distance Matrix\"\n    description = \"View distance matrix.\"\n    icon = \"icons/DistanceMatrix.svg\"\n    priority = 200\n    keywords = \"distance matrix\"\n\n    class Inputs:\n        distances = Input(\"Distances\", DistMatrix)\n\n    class Outputs:\n        distances = Output(\"Distances\", DistMatrix, dynamic=False)\n        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])\n\n    class Error(widget.OWWidget.Error):\n        empty_matrix = widget.Msg(\"Distance matrix is empty.\")\n\n    settingsHandler = DistanceMatrixContextHandler()\n    settings_version = 2\n    auto_commit = Setting(True)\n    annotation_idx = ContextSetting(1)\n    selection = ContextSetting([])\n\n    want_control_area = True\n    want_main_area = False\n\n    def __init__(self):\n        super().__init__()\n        self.distances = None\n        self.items = None\n\n        self.tablemodel = DistMatrixModel()\n        view = self.tableview = DistMatrixView()\n        view.setModel(self.tablemodel)\n        view.setSelectionBehavior(QTableView.SelectItems)\n        self.controlArea.layout().addWidget(view)\n\n        self.annot_combo = gui.comboBox(\n            self.buttonsArea, self, \"annotation_idx\", label=\"Labels: \",\n            orientation=Qt.Horizontal,\n            callback=self._invalidate_annotations, contentsLength=12)\n        self.annot_combo.setModel(VariableListModel())\n        self.annot_combo.model()[:] = [\"None\", \"Enumeration\"]\n        gui.rubber(self.buttonsArea)\n        acb = gui.auto_send(self.buttonsArea, self, \"auto_commit\", box=False)\n        acb.setFixedWidth(200)\n\n    def sizeHint(self):\n        return QSize(800, 500)\n\n    @Inputs.distances\n    def set_distances(self, distances):\n        self.clear_messages()\n        self.closeContext()\n        if distances is not None:\n            if len(distances) == 0:\n                distances = None\n                self.Error.empty_matrix()\n        self.distances = distances\n        self.tablemodel.set_data(self.distances)\n        self.items = None\n\n        annotations = [\"None\", \"Enumerate\"]\n        view = self.tableview\n\n        if distances is not None:\n            pending_idx = 1\n\n            if not distances.is_symmetric():\n                seltype = BlockSelectionModel\n                if distances.row_items is not None \\\n                        or distances.col_items is not None:\n                    annotations.append(\"Labels\")\n                    pending_idx = 2\n            else:\n                seltype = SymmetricSelectionModel\n                self.items = items = distances.row_items\n\n                if items and not distances.axis:\n                    annotations.append(\"Attribute names\")\n                    pending_idx = 2\n                elif isinstance(items, list) and \\\n                        all(isinstance(item, Variable) for item in items):\n                    annotations.append(\"Name\")\n                    pending_idx = 2\n                elif isinstance(items, Table):\n                    annotations.extend(\n                        itertools.chain(items.domain.variables, items.domain.metas))\n                    pending_idx = annotations.index(self._choose_label(items))\n\n            selmodel = seltype(view.model(), view)\n            selmodel.selectionChanged.connect(self.commit.deferred)\n            view.setSelectionModel(selmodel)\n        else:\n            pending_idx = 0\n            view.selectionModel().clear()\n\n        self.annot_combo.model()[:] = annotations\n        self.annotation_idx = pending_idx\n        if distances is not None:\n            self.openContext(distances, annotations)\n        self._update_labels()\n        view.resizeColumnsToContents()\n        self.commit.now()\n\n    @staticmethod\n    def _choose_label(data: Table):\n        attr = max((attr for attr in data.domain.metas\n                    if isinstance(attr, StringVariable)),\n                   key=lambda x: len(set(data.get_column(x))),\n                   default=None)\n        return attr or data.domain.class_var or \"Enumerate\"\n\n    def _invalidate_annotations(self):\n        if self.distances is not None:\n            self._update_labels()\n\n    def _update_labels(self):\n        def enumeration(n):\n            return [str(i + 1) for i in range(n)]\n\n        hor_labels = ver_labels = None\n        colors = None\n\n        if self.annotation_idx == 0:\n            pass\n\n        elif self.annotation_idx == 1:\n            ver_labels, hor_labels = map(enumeration, self.distances.shape)\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Attribute names\":\n            attr = self.distances.row_items.domain.attributes\n            ver_labels = hor_labels = [\n                str(attr[i]) for i in range(self.distances.shape[0])]\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Labels\":\n            if self.distances.col_items is not None:\n                hor_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.col_items)]\n            else:\n                hor_labels = enumeration(self.distances.shape[1])\n            if self.distances.row_items is not None:\n                ver_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.row_items)]\n            else:\n                ver_labels = enumeration(self.distances.shape[0])\n\n        elif self.annotation_idx == 2 and \\\n                isinstance(self.items, widget.AttributeList):\n            ver_labels = hor_labels = [v.name for v in self.items]\n\n        elif isinstance(self.items, Table):\n            var = self.annot_combo.model()[self.annotation_idx]\n            column = self.items.get_column(var)\n            if var.is_primitive():\n                colors = var.palette.values_to_qcolors(column)\n            ver_labels = hor_labels = [var.str_val(value) for value in column]\n\n        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),\n                               (self.tableview.verticalHeader(), ver_labels)):\n            self.tablemodel.set_labels(header.orientation(), labels, colors)\n            if labels is None:\n                header.hide()\n            else:\n                header.show()\n        self.tableview.resizeColumnsToContents()\n\n    @gui.deferred\n    def commit(self):\n        sub_table = sub_distances = None\n        if self.distances is not None:\n            inds, symmetric = self._get_selection()\n            if symmetric:\n                if inds:\n                    sub_distances = self.distances.submatrix(inds)\n                    if self.distances.axis and isinstance(self.items, Table):\n                        sub_table = self.items[inds]\n            elif all(inds):\n                sub_distances = self.distances.submatrix(*inds)\n        self.Outputs.distances.send(sub_distances)\n        self.Outputs.table.send(sub_table)\n\n    def _get_selection(self):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            return self.tableview.selectionModel().selectedItems(), True\n        else:\n            row_spans, col_spans = selection_blocks(selmodel.selection())\n            rows = list(itertools.chain.from_iterable(\n                itertools.starmap(range, row_spans)))\n            cols = list(itertools.chain.from_iterable(\n                itertools.starmap(range, col_spans)))\n            return (rows, cols), False\n\n    def _set_selection(self, selection):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            if not isinstance(selection, list):\n                log.error(\"wrong data for symmetric selection\")\n                return\n            selmodel.setSelectedItems(selection)\n        else:\n            if not isinstance(selection, tuple) and len(selection) == 2:\n                log.error(\"wrong data for asymmetric selection\")\n                return\n            rows, cols = selection\n            selection = QItemSelection()\n            rowranges = list(ranges(rows))\n            colranges = list(ranges(cols))\n\n            index = self.tablemodel.index\n            for rowstart, rowend in rowranges:\n                for colstart, colend in colranges:\n                    selection.append(\n                        QItemSelectionRange(\n                            index(rowstart, colstart),\n                            index(rowend - 1, colend - 1)\n                        )\n                    )\n            selmodel.select(selection, selmodel.ClearAndSelect)\n\n    def send_report(self):\n        if self.distances is None:\n            return\n        model = self.tablemodel\n        index = model.index\n        ndec = self.tableview.itemDelegate().ndecimals\n        header = model.headerData\n        h, w = self.distances.shape\n\n        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))\n        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))\n\n        def cell(func, num):\n            label, brush = (func(role)\n                            for role in (Qt.DisplayRole, Qt.BackgroundRole))\n            if brush:\n                style = f' style=\"background-color: {brush.color().name()}\"'\n            else:\n                style = \"\"\n            label = \"\" if label is None else f\"{label:.{ndec}f}\" if num else label\n            self.report_raw(f\"<td {style}>{label}</td>\\n\")\n\n        self.report_raw('<table style=\"border-collapse:collapse\">')\n        if hor_header:\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                self.report_raw(\"<td></td>\")\n            for col in range(w):\n                cell(partial(header, col, Qt.Horizontal), False)\n            self.report_raw(\"</tr>\")\n\n        for row in range(h):\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                cell(partial(header, row, Qt.Vertical), False)\n            for col in range(w):\n                cell(index(row, col).data, True)\n            self.report_raw(\"</tr>\")\n        self.report_raw(\"</table>\")\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 2:\n            context.shape = (context.dim, context.dim)\n            context.symmetric = True",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 61,
                                "end_lineno": 328,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/unsupervised/owdistancematrix.py",
                            "type": "class",
                            "name": "OWDistanceMatrix",
                            "content": "class OWDistanceMatrix(widget.OWWidget):\n    name = \"Distance Matrix\"\n    description = \"View distance matrix.\"\n    icon = \"icons/DistanceMatrix.svg\"\n    priority = 200\n    keywords = \"distance matrix\"\n\n    class Inputs:\n        distances = Input(\"Distances\", DistMatrix)\n\n    class Outputs:\n        distances = Output(\"Distances\", DistMatrix, dynamic=False)\n        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])\n\n    class Error(widget.OWWidget.Error):\n        empty_matrix = widget.Msg(\"Distance matrix is empty.\")\n\n    settingsHandler = DistanceMatrixContextHandler()\n    settings_version = 2\n    auto_commit = Setting(True)\n    annotation_idx = ContextSetting(1)\n    selection = ContextSetting([])\n\n    want_control_area = True\n    want_main_area = False\n\n    def __init__(self):\n        super().__init__()\n        self.distances = None\n        self.items = None\n\n        self.tablemodel = DistMatrixModel()\n        view = self.tableview = DistMatrixView()\n        view.setModel(self.tablemodel)\n        view.setSelectionBehavior(QTableView.SelectItems)\n        self.controlArea.layout().addWidget(view)\n\n        self.annot_combo = gui.comboBox(\n            self.buttonsArea, self, \"annotation_idx\", label=\"Labels: \",\n            orientation=Qt.Horizontal,\n            callback=self._invalidate_annotations, contentsLength=12)\n        self.annot_combo.setModel(VariableListModel())\n        self.annot_combo.model()[:] = [\"None\", \"Enumeration\"]\n        gui.rubber(self.buttonsArea)\n        acb = gui.auto_send(self.buttonsArea, self, \"auto_commit\", box=False)\n        acb.setFixedWidth(200)\n\n    def sizeHint(self):\n        return QSize(800, 500)\n\n    @Inputs.distances\n    def set_distances(self, distances):\n        self.clear_messages()\n        self.closeContext()\n        if distances is not None:\n            if len(distances) == 0:\n                distances = None\n                self.Error.empty_matrix()\n        self.distances = distances\n        self.tablemodel.set_data(self.distances)\n        self.items = None\n\n        annotations = [\"None\", \"Enumerate\"]\n        view = self.tableview\n\n        if distances is not None:\n            pending_idx = 1\n\n            if not distances.is_symmetric():\n                seltype = BlockSelectionModel\n                if distances.row_items is not None \\\n                        or distances.col_items is not None:\n                    annotations.append(\"Labels\")\n                    pending_idx = 2\n            else:\n                seltype = SymmetricSelectionModel\n                self.items = items = distances.row_items\n\n                if items and not distances.axis:\n                    annotations.append(\"Attribute names\")\n                    pending_idx = 2\n                elif isinstance(items, list) and \\\n                        all(isinstance(item, Variable) for item in items):\n                    annotations.append(\"Name\")\n                    pending_idx = 2\n                elif isinstance(items, Table):\n                    annotations.extend(\n                        itertools.chain(items.domain.variables, items.domain.metas))\n                    pending_idx = annotations.index(self._choose_label(items))\n\n            selmodel = seltype(view.model(), view)\n            selmodel.selectionChanged.connect(self.commit.deferred)\n            view.setSelectionModel(selmodel)\n        else:\n            pending_idx = 0\n            view.selectionModel().clear()\n\n        self.annot_combo.model()[:] = annotations\n        self.annotation_idx = pending_idx\n        if distances is not None:\n            self.openContext(distances, annotations)\n        self._update_labels()\n        view.resizeColumnsToContents()\n        self.commit.now()\n\n    @staticmethod\n    def _choose_label(data: Table):\n        attr = max((attr for attr in data.domain.metas\n                    if isinstance(attr, StringVariable)),\n                   key=lambda x: len(set(data.get_column(x))),\n                   default=None)\n        return attr or data.domain.class_var or \"Enumerate\"\n\n    def _invalidate_annotations(self):\n        if self.distances is not None:\n            self._update_labels()\n\n    def _update_labels(self):\n        def enumeration(n):\n            return [str(i + 1) for i in range(n)]\n\n        hor_labels = ver_labels = None\n        colors = None\n\n        if self.annotation_idx == 0:\n            pass\n\n        elif self.annotation_idx == 1:\n            ver_labels, hor_labels = map(enumeration, self.distances.shape)\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Attribute names\":\n            attr = self.distances.row_items.domain.attributes\n            ver_labels = hor_labels = [\n                str(attr[i]) for i in range(self.distances.shape[0])]\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Labels\":\n            if self.distances.col_items is not None:\n                hor_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.col_items)]\n            else:\n                hor_labels = enumeration(self.distances.shape[1])\n            if self.distances.row_items is not None:\n                ver_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.row_items)]\n            else:\n                ver_labels = enumeration(self.distances.shape[0])\n\n        elif self.annotation_idx == 2 and \\\n                isinstance(self.items, widget.AttributeList):\n            ver_labels = hor_labels = [v.name for v in self.items]\n\n        elif isinstance(self.items, Table):\n            var = self.annot_combo.model()[self.annotation_idx]\n            column = self.items.get_column(var)\n            if var.is_primitive():\n                colors = var.palette.values_to_qcolors(column)\n            ver_labels = hor_labels = [var.str_val(value) for value in column]\n\n        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),\n                               (self.tableview.verticalHeader(), ver_labels)):\n            self.tablemodel.set_labels(header.orientation(), labels, colors)\n            if labels is None:\n                header.hide()\n            else:\n                header.show()\n        self.tableview.resizeColumnsToContents()\n\n    @gui.deferred\n    def commit(self):\n        sub_table = sub_distances = None\n        if self.distances is not None:\n            inds, symmetric = self._get_selection()\n            if symmetric:\n                if inds:\n                    sub_distances = self.distances.submatrix(inds)\n                    if self.distances.axis and isinstance(self.items, Table):\n                        sub_table = self.items[inds]\n            elif all(inds):\n                sub_distances = self.distances.submatrix(*inds)\n        self.Outputs.distances.send(sub_distances)\n        self.Outputs.table.send(sub_table)\n\n    def _get_selection(self):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            return self.tableview.selectionModel().selectedItems(), True\n        else:\n            row_spans, col_spans = selection_blocks(selmodel.selection())\n            rows = list(itertools.chain.from_iterable(\n                itertools.starmap(range, row_spans)))\n            cols = list(itertools.chain.from_iterable(\n                itertools.starmap(range, col_spans)))\n            return (rows, cols), False\n\n    def _set_selection(self, selection):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            if not isinstance(selection, list):\n                log.error(\"wrong data for symmetric selection\")\n                return\n            selmodel.setSelectedItems(selection)\n        else:\n            if not isinstance(selection, tuple) and len(selection) == 2:\n                log.error(\"wrong data for asymmetric selection\")\n                return\n            rows, cols = selection\n            selection = QItemSelection()\n            rowranges = list(ranges(rows))\n            colranges = list(ranges(cols))\n\n            index = self.tablemodel.index\n            for rowstart, rowend in rowranges:\n                for colstart, colend in colranges:\n                    selection.append(\n                        QItemSelectionRange(\n                            index(rowstart, colstart),\n                            index(rowend - 1, colend - 1)\n                        )\n                    )\n            selmodel.select(selection, selmodel.ClearAndSelect)\n\n    def send_report(self):\n        if self.distances is None:\n            return\n        model = self.tablemodel\n        index = model.index\n        ndec = self.tableview.itemDelegate().ndecimals\n        header = model.headerData\n        h, w = self.distances.shape\n\n        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))\n        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))\n\n        def cell(func, num):\n            label, brush = (func(role)\n                            for role in (Qt.DisplayRole, Qt.BackgroundRole))\n            if brush:\n                style = f' style=\"background-color: {brush.color().name()}\"'\n            else:\n                style = \"\"\n            label = \"\" if label is None else f\"{label:.{ndec}f}\" if num else label\n            self.report_raw(f\"<td {style}>{label}</td>\\n\")\n\n        self.report_raw('<table style=\"border-collapse:collapse\">')\n        if hor_header:\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                self.report_raw(\"<td></td>\")\n            for col in range(w):\n                cell(partial(header, col, Qt.Horizontal), False)\n            self.report_raw(\"</tr>\")\n\n        for row in range(h):\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                cell(partial(header, row, Qt.Vertical), False)\n            for col in range(w):\n                cell(index(row, col).data, True)\n            self.report_raw(\"</tr>\")\n        self.report_raw(\"</table>\")\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 2:\n            context.shape = (context.dim, context.dim)\n            context.symmetric = True",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 61,
                            "end_lineno": 328,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# pylint: disable=protected-access\n\nimport unittest\nfrom functools import partial\nfrom unittest.mock import patch\n\nimport numpy as np\nfrom AnyQt.QtCore import Qt\n\nfrom orangewidget.settings import Context\n\nfrom Orange.misc import DistMatrix\nfrom Orange.data import Table, Domain, ContinuousVariable, StringVariable\nfrom Orange.distance import Euclidean\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.unsupervised.owdistancematrix import OWDistanceMatrix\n\n\nclass TestOWDistanceMatrix(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDistanceMatrix)\n        self.iris = Table(\"iris\")[:5]\n        self.distances = Euclidean(self.iris)\n\n    def test_set_distances(self):\n        assert isinstance(self.widget, OWDistanceMatrix)\n\n        # Distances with row data\n        self.widget.set_distances(self.distances)\n        self.assertIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Distances without row data\n        self.distances.row_items = None\n        self.widget.set_distances(self.distances)\n        self.assertNotIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n        # Non-square distances, row labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, column labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, both labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n    def test_context_attribute(self):\n        distances = Euclidean(self.iris, axis=0)\n        annotations = [\"None\", \"Enumerate\"]\n        self.widget.set_distances(distances)\n        self.widget.openContext(distances, annotations)\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget.commit, 'now') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.distances, self.distances)\n            commit.assert_called()\n\n    def test_labels(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        grades = Table.from_list(\n            Domain([x, y], [], [s]),\n            [[91.0, 89.0, \"Bill\"],\n             [51.0, 100.0, \"Cynthia\"],\n             [9.0, 61.0, \"Demi\"],\n             [49.0, 92.0, \"Fred\"],\n             [91.0, 49.0, \"George\"]\n             ]\n        )\n\n        header = self.widget.tablemodel.headerData\n\n        distances = Euclidean(grades)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(grades.domain.metas[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertEqual(header(2, Qt.Horizontal, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(2, Qt.Vertical, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n        idx = ac.model().indexOf(grades.domain.attributes[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertIn(\"9\", header(2, Qt.Horizontal, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertIn(\"9\", header(2, Qt.Vertical, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_num_meta_labels_w_nan(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        data = Table.from_list(\n            Domain([x], [], [y, s]),\n            [[0, 1, \"a\"],\n             [1, np.nan, \"b\"]]\n        )\n        distances = Euclidean(data)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(y)\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n\n        header = self.widget.tablemodel.headerData\n        self.assertEqual(header(0, Qt.Horizontal, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Horizontal, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(0, Qt.Vertical, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Vertical, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_choose_label(self):\n        self.assertIs(OWDistanceMatrix._choose_label(self.iris),\n                      self.iris.domain.class_var)\n\n        domain = Domain([ContinuousVariable(x) for x in \"xyz\"],\n                        ContinuousVariable(\"t\"),\n                        [ContinuousVariable(\"m\")] +\n                        [StringVariable(c) for c in \"abc\"]\n                        )\n        data = Table.from_numpy(\n            domain,\n            np.zeros((4, 3), dtype=float),\n            np.arange(4, dtype=float),\n            np.array([[0, \"a\", \"a\", \"a\"],\n                      [1, \"b\", \"b\", \"b\"],\n                      [2, \"a\", \"c\", \"b\"],\n                      [0, \"b\", \"a\", \"a\"]])\n        )\n        self.assertIs(OWDistanceMatrix._choose_label(data),\n                      domain.metas[2])\n        domain2 = Domain(domain.attributes, domain.class_var, domain.metas[:-2])\n        self.assertIs(OWDistanceMatrix._choose_label(data.transform(domain2)),\n                      domain.metas[1])\n\n    def test_non_square_labels(self):\n        widget = self.widget\n        ac = self.widget.annot_combo\n\n        dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n        dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n        dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n        self.send_signal(widget.Inputs.distances, dist)\n        self.assertEqual(ac.model().rowCount(), 3)\n\n        header = partial(widget.tablemodel.headerData, role=Qt.DisplayRole)\n        ac.setCurrentIndex(0)\n        ac.activated.emit(0)\n        self.assertIsNone(header(1, Qt.Horizontal))\n        self.assertIsNone(header(1, Qt.Vertical))\n\n        ac.setCurrentIndex(1)\n        ac.activated.emit(1)\n        self.assertEqual(header(1, Qt.Horizontal), \"2\")\n        self.assertEqual(header(1, Qt.Vertical), \"2\")\n\n        ac.setCurrentIndex(2)\n        ac.activated.emit(2)\n        self.assertEqual(header(1, Qt.Horizontal), \"dd\")\n        self.assertEqual(header(1, Qt.Vertical), \"bb\")\n\n    @WidgetTest.skipNonEnglish\n    def test_migrate_settings_v1_and_use_them(self):\n        ind = [1, 2, 5, 6, 7, 8]\n        context = Context(\n            values={'__version__': 1},\n            dim=10,\n            annotations=['None', 'Enumerate',\n                         'sepal length', 'sepal width', 'petal length',\n                         'petal width', 'iris'],\n            annotation='petal length',\n            selection=ind)\n        widget = self.create_widget(\n            OWDistanceMatrix, stored_settings={\"__version__\": 1, \"context_settings\": [context]})\n        iris = Table(\"iris\")[:10]\n        distances = Euclidean(iris)\n        self.send_signal(widget.Inputs.distances, distances)\n        self.assertEqual(widget.annotation_idx, 4)\n        self.assertEqual(widget.tableview.selectionModel().selectedItems(), ind)\n        outm = self.get_output(widget.Outputs.distances)\n        np.testing.assert_equal(outm, distances.submatrix(ind, ind))\n\n    def test_square_settings(self):\n        widget = self.widget\n        self.send_signal(widget.Inputs.distances, self.distances)\n        widget._set_selection([0, 3, 4])\n        widget.annotation_idx = 3\n\n        self.send_signal(widget.Inputs.distances, None)\n        self.assertEqual(widget._get_selection(), ([], True))\n        self.assertEqual(widget.annotation_idx, 0)\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        matrix = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        matrix.row_items = list(\"ab\")\n\n        self.send_signal(widget.Inputs.distances,matrix)\n        self.assertEqual(widget._get_selection(), (([], []), False))\n        self.assertEqual(widget.annotation_idx, 2)\n\n        widget._set_selection(([0], [0, 2]))\n        widget.annotation_idx = 0\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        self.send_signal(widget.Inputs.distances, matrix)\n        self.assertEqual(widget._get_selection(), (([0], [0, 2]), False))\n        self.assertEqual(widget.annotation_idx, 0)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "# pylint: disable=protected-access\n\nimport unittest\nfrom functools import partial\nfrom unittest.mock import patch\n\nimport numpy as np\nfrom AnyQt.QtCore import Qt\n\nfrom orangewidget.settings import Context\n\nfrom Orange.misc import DistMatrix\nfrom Orange.data import Table, Domain, ContinuousVariable, StringVariable\nfrom Orange.distance import Euclidean\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.unsupervised.owdistancematrix import OWDistanceMatrix\n\n\nclass TestOWDistanceMatrix(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDistanceMatrix)\n        self.iris = Table(\"iris\")[:5]\n        self.distances = Euclidean(self.iris)\n\n    def test_set_distances(self):\n        assert isinstance(self.widget, OWDistanceMatrix)\n\n        # Distances with row data\n        self.widget.set_distances(self.distances)\n        self.assertIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Distances without row data\n        self.distances.row_items = None\n        self.widget.set_distances(self.distances)\n        self.assertNotIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n        # Non-square distances, row labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, column labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, both labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n    def test_context_attribute(self):\n        distances = Euclidean(self.iris, axis=0)\n        annotations = [\"None\", \"Enumerate\"]\n        self.widget.set_distances(distances)\n        self.widget.openContext(distances, annotations)\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget.commit, 'now') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.distances, self.distances)\n            commit.assert_called()\n\n    def test_labels(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        grades = Table.from_list(\n            Domain([x, y], [], [s]),\n            [[91.0, 89.0, \"Bill\"],\n             [51.0, 100.0, \"Cynthia\"],\n             [9.0, 61.0, \"Demi\"],\n             [49.0, 92.0, \"Fred\"],\n             [91.0, 49.0, \"George\"]\n             ]\n        )\n\n        header = self.widget.tablemodel.headerData\n\n        distances = Euclidean(grades)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(grades.domain.metas[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertEqual(header(2, Qt.Horizontal, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(2, Qt.Vertical, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n        idx = ac.model().indexOf(grades.domain.attributes[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertIn(\"9\", header(2, Qt.Horizontal, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertIn(\"9\", header(2, Qt.Vertical, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_num_meta_labels_w_nan(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        data = Table.from_list(\n            Domain([x], [], [y, s]),\n            [[0, 1, \"a\"],\n             [1, np.nan, \"b\"]]\n        )\n        distances = Euclidean(data)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(y)\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n\n        header = self.widget.tablemodel.headerData\n        self.assertEqual(header(0, Qt.Horizontal, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Horizontal, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(0, Qt.Vertical, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Vertical, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_choose_label(self):\n        self.assertIs(OWDistanceMatrix._choose_label(self.iris),\n                      self.iris.domain.class_var)\n\n        domain = Domain([ContinuousVariable(x) for x in \"xyz\"],\n                        ContinuousVariable(\"t\"),\n                        [ContinuousVariable(\"m\")] +\n                        [StringVariable(c) for c in \"abc\"]\n                        )\n        data = Table.from_numpy(\n            domain,\n            np.zeros((4, 3), dtype=float),\n            np.arange(4, dtype=float),\n            np.array([[0, \"a\", \"a\", \"a\"],\n                      [1, \"b\", \"b\", \"b\"],\n                      [2, \"a\", \"c\", \"b\"],\n                      [0, \"b\", \"a\", \"a\"]])\n        )\n        self.assertIs(OWDistanceMatrix._choose_label(data),\n                      domain.metas[2])\n        domain2 = Domain(domain.attributes, domain.class_var, domain.metas[:-2])\n        self.assertIs(OWDistanceMatrix._choose_label(data.transform(domain2)),\n                      domain.metas[1])\n\n    def test_non_square_labels(self):\n        widget = self.widget\n        ac = self.widget.annot_combo\n\n        dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n        dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n        dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n        self.send_signal(widget.Inputs.distances, dist)\n        self.assertEqual(ac.model().rowCount(), 3)\n\n        header = partial(widget.tablemodel.headerData, role=Qt.DisplayRole)\n        ac.setCurrentIndex(0)\n        ac.activated.emit(0)\n        self.assertIsNone(header(1, Qt.Horizontal))\n        self.assertIsNone(header(1, Qt.Vertical))\n\n        ac.setCurrentIndex(1)\n        ac.activated.emit(1)\n        self.assertEqual(header(1, Qt.Horizontal), \"2\")\n        self.assertEqual(header(1, Qt.Vertical), \"2\")\n\n        ac.setCurrentIndex(2)\n        ac.activated.emit(2)\n        self.assertEqual(header(1, Qt.Horizontal), \"dd\")\n        self.assertEqual(header(1, Qt.Vertical), \"bb\")\n\n    @WidgetTest.skipNonEnglish\n    def test_migrate_settings_v1_and_use_them(self):\n        ind = [1, 2, 5, 6, 7, 8]\n        context = Context(\n            values={'__version__': 1},\n            dim=10,\n            annotations=['None', 'Enumerate',\n                         'sepal length', 'sepal width', 'petal length',\n                         'petal width', 'iris'],\n            annotation='petal length',\n            selection=ind)\n        widget = self.create_widget(\n            OWDistanceMatrix, stored_settings={\"__version__\": 1, \"context_settings\": [context]})\n        iris = Table(\"iris\")[:10]\n        distances = Euclidean(iris)\n        self.send_signal(widget.Inputs.distances, distances)\n        self.assertEqual(widget.annotation_idx, 4)\n        self.assertEqual(widget.tableview.selectionModel().selectedItems(), ind)\n        outm = self.get_output(widget.Outputs.distances)\n        np.testing.assert_equal(outm, distances.submatrix(ind, ind))\n\n    def test_square_settings(self):\n        widget = self.widget\n        self.send_signal(widget.Inputs.distances, self.distances)\n        widget._set_selection([0, 3, 4])\n        widget.annotation_idx = 3\n\n        self.send_signal(widget.Inputs.distances, None)\n        self.assertEqual(widget._get_selection(), ([], True))\n        self.assertEqual(widget.annotation_idx, 0)\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        matrix = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        matrix.row_items = list(\"ab\")\n\n        self.send_signal(widget.Inputs.distances,matrix)\n        self.assertEqual(widget._get_selection(), (([], []), False))\n        self.assertEqual(widget.annotation_idx, 2)\n\n        widget._set_selection(([0], [0, 2]))\n        widget.annotation_idx = 0\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        self.send_signal(widget.Inputs.distances, matrix)\n        self.assertEqual(widget._get_selection(), (([0], [0, 2]), False))\n        self.assertEqual(widget.annotation_idx, 0)\n\n    def test_empty_matrix(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        self.send_signal(self.widget.Inputs.distances, matrix)\n        self.assertTrue(self.widget.Error.empty_matrix.is_shown())\n        self.send_signal(self.widget.Inputs.distances, None)\n        self.assertFalse(self.widget.Error.empty_matrix.is_shown())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/unsupervised/tests/test_owdistancematrix.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "28a59e174",
                "new_commit_hash": "a30b4f42a",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/unsupervised/tests/test_owdistancematrix.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/unsupervised/tests/test_owdistancematrix.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 243,
                            "length": 6
                        },
                        "new_range": {
                            "start": 243,
                            "length": 13
                        },
                        "section": "class TestOWDistanceMatrix(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.assertEqual(widget._get_selection(), (([0], [0, 2]), False))",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(widget.annotation_idx, 0)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_empty_matrix(self):",
                                "type": "added"
                            },
                            {
                                "content": "        matrix = DistMatrix(np.empty((0, 0)))",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.distances, matrix)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(self.widget.Error.empty_matrix.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.distances, None)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.empty_matrix.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "if __name__ == \"__main__\":",
                                "type": "context"
                            },
                            {
                                "content": "    unittest.main()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owdistancematrix.py",
                            "type": "class",
                            "name": "TestOWDistanceMatrix",
                            "content": "class TestOWDistanceMatrix(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDistanceMatrix)\n        self.iris = Table(\"iris\")[:5]\n        self.distances = Euclidean(self.iris)\n\n    def test_set_distances(self):\n        assert isinstance(self.widget, OWDistanceMatrix)\n\n        # Distances with row data\n        self.widget.set_distances(self.distances)\n        self.assertIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Distances without row data\n        self.distances.row_items = None\n        self.widget.set_distances(self.distances)\n        self.assertNotIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n        # Non-square distances, row labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, column labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, both labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n    def test_context_attribute(self):\n        distances = Euclidean(self.iris, axis=0)\n        annotations = [\"None\", \"Enumerate\"]\n        self.widget.set_distances(distances)\n        self.widget.openContext(distances, annotations)\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget.commit, 'now') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.distances, self.distances)\n            commit.assert_called()\n\n    def test_labels(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        grades = Table.from_list(\n            Domain([x, y], [], [s]),\n            [[91.0, 89.0, \"Bill\"],\n             [51.0, 100.0, \"Cynthia\"],\n             [9.0, 61.0, \"Demi\"],\n             [49.0, 92.0, \"Fred\"],\n             [91.0, 49.0, \"George\"]\n             ]\n        )\n\n        header = self.widget.tablemodel.headerData\n\n        distances = Euclidean(grades)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(grades.domain.metas[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertEqual(header(2, Qt.Horizontal, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(2, Qt.Vertical, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n        idx = ac.model().indexOf(grades.domain.attributes[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertIn(\"9\", header(2, Qt.Horizontal, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertIn(\"9\", header(2, Qt.Vertical, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_num_meta_labels_w_nan(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        data = Table.from_list(\n            Domain([x], [], [y, s]),\n            [[0, 1, \"a\"],\n             [1, np.nan, \"b\"]]\n        )\n        distances = Euclidean(data)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(y)\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n\n        header = self.widget.tablemodel.headerData\n        self.assertEqual(header(0, Qt.Horizontal, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Horizontal, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(0, Qt.Vertical, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Vertical, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_choose_label(self):\n        self.assertIs(OWDistanceMatrix._choose_label(self.iris),\n                      self.iris.domain.class_var)\n\n        domain = Domain([ContinuousVariable(x) for x in \"xyz\"],\n                        ContinuousVariable(\"t\"),\n                        [ContinuousVariable(\"m\")] +\n                        [StringVariable(c) for c in \"abc\"]\n                        )\n        data = Table.from_numpy(\n            domain,\n            np.zeros((4, 3), dtype=float),\n            np.arange(4, dtype=float),\n            np.array([[0, \"a\", \"a\", \"a\"],\n                      [1, \"b\", \"b\", \"b\"],\n                      [2, \"a\", \"c\", \"b\"],\n                      [0, \"b\", \"a\", \"a\"]])\n        )\n        self.assertIs(OWDistanceMatrix._choose_label(data),\n                      domain.metas[2])\n        domain2 = Domain(domain.attributes, domain.class_var, domain.metas[:-2])\n        self.assertIs(OWDistanceMatrix._choose_label(data.transform(domain2)),\n                      domain.metas[1])\n\n    def test_non_square_labels(self):\n        widget = self.widget\n        ac = self.widget.annot_combo\n\n        dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n        dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n        dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n        self.send_signal(widget.Inputs.distances, dist)\n        self.assertEqual(ac.model().rowCount(), 3)\n\n        header = partial(widget.tablemodel.headerData, role=Qt.DisplayRole)\n        ac.setCurrentIndex(0)\n        ac.activated.emit(0)\n        self.assertIsNone(header(1, Qt.Horizontal))\n        self.assertIsNone(header(1, Qt.Vertical))\n\n        ac.setCurrentIndex(1)\n        ac.activated.emit(1)\n        self.assertEqual(header(1, Qt.Horizontal), \"2\")\n        self.assertEqual(header(1, Qt.Vertical), \"2\")\n\n        ac.setCurrentIndex(2)\n        ac.activated.emit(2)\n        self.assertEqual(header(1, Qt.Horizontal), \"dd\")\n        self.assertEqual(header(1, Qt.Vertical), \"bb\")\n\n    @WidgetTest.skipNonEnglish\n    def test_migrate_settings_v1_and_use_them(self):\n        ind = [1, 2, 5, 6, 7, 8]\n        context = Context(\n            values={'__version__': 1},\n            dim=10,\n            annotations=['None', 'Enumerate',\n                         'sepal length', 'sepal width', 'petal length',\n                         'petal width', 'iris'],\n            annotation='petal length',\n            selection=ind)\n        widget = self.create_widget(\n            OWDistanceMatrix, stored_settings={\"__version__\": 1, \"context_settings\": [context]})\n        iris = Table(\"iris\")[:10]\n        distances = Euclidean(iris)\n        self.send_signal(widget.Inputs.distances, distances)\n        self.assertEqual(widget.annotation_idx, 4)\n        self.assertEqual(widget.tableview.selectionModel().selectedItems(), ind)\n        outm = self.get_output(widget.Outputs.distances)\n        np.testing.assert_equal(outm, distances.submatrix(ind, ind))\n\n    def test_square_settings(self):\n        widget = self.widget\n        self.send_signal(widget.Inputs.distances, self.distances)\n        widget._set_selection([0, 3, 4])\n        widget.annotation_idx = 3\n\n        self.send_signal(widget.Inputs.distances, None)\n        self.assertEqual(widget._get_selection(), ([], True))\n        self.assertEqual(widget.annotation_idx, 0)\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        matrix = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        matrix.row_items = list(\"ab\")\n\n        self.send_signal(widget.Inputs.distances,matrix)\n        self.assertEqual(widget._get_selection(), (([], []), False))\n        self.assertEqual(widget.annotation_idx, 2)\n\n        widget._set_selection(([0], [0, 2]))\n        widget.annotation_idx = 0\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        self.send_signal(widget.Inputs.distances, matrix)\n        self.assertEqual(widget._get_selection(), (([0], [0, 2]), False))\n        self.assertEqual(widget.annotation_idx, 0)\n\n    def test_empty_matrix(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        self.send_signal(self.widget.Inputs.distances, matrix)\n        self.assertTrue(self.widget.Error.empty_matrix.is_shown())\n        self.send_signal(self.widget.Inputs.distances, None)\n        self.assertFalse(self.widget.Error.empty_matrix.is_shown())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 19,
                            "end_lineno": 251,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owdistancematrix.py",
                            "type": "method",
                            "name": "TestOWDistanceMatrix.test_empty_matrix",
                            "content": "class TestOWDistanceMatrix(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDistanceMatrix)\n        self.iris = Table(\"iris\")[:5]\n        self.distances = Euclidean(self.iris)\n\n    def test_set_distances(self):\n        assert isinstance(self.widget, OWDistanceMatrix)\n\n        # Distances with row data\n        self.widget.set_distances(self.distances)\n        self.assertIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Distances without row data\n        self.distances.row_items = None\n        self.widget.set_distances(self.distances)\n        self.assertNotIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n        # Non-square distances, row labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, column labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, both labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n    def test_context_attribute(self):\n        distances = Euclidean(self.iris, axis=0)\n        annotations = [\"None\", \"Enumerate\"]\n        self.widget.set_distances(distances)\n        self.widget.openContext(distances, annotations)\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget.commit, 'now') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.distances, self.distances)\n            commit.assert_called()\n\n    def test_labels(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        grades = Table.from_list(\n            Domain([x, y], [], [s]),\n            [[91.0, 89.0, \"Bill\"],\n             [51.0, 100.0, \"Cynthia\"],\n             [9.0, 61.0, \"Demi\"],\n             [49.0, 92.0, \"Fred\"],\n             [91.0, 49.0, \"George\"]\n             ]\n        )\n\n        header = self.widget.tablemodel.headerData\n\n        distances = Euclidean(grades)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(grades.domain.metas[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertEqual(header(2, Qt.Horizontal, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(2, Qt.Vertical, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n        idx = ac.model().indexOf(grades.domain.attributes[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertIn(\"9\", header(2, Qt.Horizontal, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertIn(\"9\", header(2, Qt.Vertical, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_num_meta_labels_w_nan(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        data = Table.from_list(\n            Domain([x], [], [y, s]),\n            [[0, 1, \"a\"],\n             [1, np.nan, \"b\"]]\n        )\n        distances = Euclidean(data)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(y)\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n\n        header = self.widget.tablemodel.headerData\n        self.assertEqual(header(0, Qt.Horizontal, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Horizontal, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(0, Qt.Vertical, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Vertical, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_choose_label(self):\n        self.assertIs(OWDistanceMatrix._choose_label(self.iris),\n                      self.iris.domain.class_var)\n\n        domain = Domain([ContinuousVariable(x) for x in \"xyz\"],\n                        ContinuousVariable(\"t\"),\n                        [ContinuousVariable(\"m\")] +\n                        [StringVariable(c) for c in \"abc\"]\n                        )\n        data = Table.from_numpy(\n            domain,\n            np.zeros((4, 3), dtype=float),\n            np.arange(4, dtype=float),\n            np.array([[0, \"a\", \"a\", \"a\"],\n                      [1, \"b\", \"b\", \"b\"],\n                      [2, \"a\", \"c\", \"b\"],\n                      [0, \"b\", \"a\", \"a\"]])\n        )\n        self.assertIs(OWDistanceMatrix._choose_label(data),\n                      domain.metas[2])\n        domain2 = Domain(domain.attributes, domain.class_var, domain.metas[:-2])\n        self.assertIs(OWDistanceMatrix._choose_label(data.transform(domain2)),\n                      domain.metas[1])\n\n    def test_non_square_labels(self):\n        widget = self.widget\n        ac = self.widget.annot_combo\n\n        dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n        dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n        dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n        self.send_signal(widget.Inputs.distances, dist)\n        self.assertEqual(ac.model().rowCount(), 3)\n\n        header = partial(widget.tablemodel.headerData, role=Qt.DisplayRole)\n        ac.setCurrentIndex(0)\n        ac.activated.emit(0)\n        self.assertIsNone(header(1, Qt.Horizontal))\n        self.assertIsNone(header(1, Qt.Vertical))\n\n        ac.setCurrentIndex(1)\n        ac.activated.emit(1)\n        self.assertEqual(header(1, Qt.Horizontal), \"2\")\n        self.assertEqual(header(1, Qt.Vertical), \"2\")\n\n        ac.setCurrentIndex(2)\n        ac.activated.emit(2)\n        self.assertEqual(header(1, Qt.Horizontal), \"dd\")\n        self.assertEqual(header(1, Qt.Vertical), \"bb\")\n\n    @WidgetTest.skipNonEnglish\n    def test_migrate_settings_v1_and_use_them(self):\n        ind = [1, 2, 5, 6, 7, 8]\n        context = Context(\n            values={'__version__': 1},\n            dim=10,\n            annotations=['None', 'Enumerate',\n                         'sepal length', 'sepal width', 'petal length',\n                         'petal width', 'iris'],\n            annotation='petal length',\n            selection=ind)\n        widget = self.create_widget(\n            OWDistanceMatrix, stored_settings={\"__version__\": 1, \"context_settings\": [context]})\n        iris = Table(\"iris\")[:10]\n        distances = Euclidean(iris)\n        self.send_signal(widget.Inputs.distances, distances)\n        self.assertEqual(widget.annotation_idx, 4)\n        self.assertEqual(widget.tableview.selectionModel().selectedItems(), ind)\n        outm = self.get_output(widget.Outputs.distances)\n        np.testing.assert_equal(outm, distances.submatrix(ind, ind))\n\n    def test_square_settings(self):\n        widget = self.widget\n        self.send_signal(widget.Inputs.distances, self.distances)\n        widget._set_selection([0, 3, 4])\n        widget.annotation_idx = 3\n\n        self.send_signal(widget.Inputs.distances, None)\n        self.assertEqual(widget._get_selection(), ([], True))\n        self.assertEqual(widget.annotation_idx, 0)\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        matrix = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        matrix.row_items = list(\"ab\")\n\n        self.send_signal(widget.Inputs.distances,matrix)\n        self.assertEqual(widget._get_selection(), (([], []), False))\n        self.assertEqual(widget.annotation_idx, 2)\n\n        widget._set_selection(([0], [0, 2]))\n        widget.annotation_idx = 0\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        self.send_signal(widget.Inputs.distances, matrix)\n        self.assertEqual(widget._get_selection(), (([0], [0, 2]), False))\n        self.assertEqual(widget.annotation_idx, 0)\n\n    def test_empty_matrix(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        self.send_signal(self.widget.Inputs.distances, matrix)\n        self.assertTrue(self.widget.Error.empty_matrix.is_shown())\n        self.send_signal(self.widget.Inputs.distances, None)\n        self.assertFalse(self.widget.Error.empty_matrix.is_shown())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 246,
                            "end_lineno": 251,
                            "parent": {
                                "file_name": "Orange/widgets/unsupervised/tests/test_owdistancematrix.py",
                                "type": "class",
                                "name": "TestOWDistanceMatrix",
                                "content": "class TestOWDistanceMatrix(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDistanceMatrix)\n        self.iris = Table(\"iris\")[:5]\n        self.distances = Euclidean(self.iris)\n\n    def test_set_distances(self):\n        assert isinstance(self.widget, OWDistanceMatrix)\n\n        # Distances with row data\n        self.widget.set_distances(self.distances)\n        self.assertIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Distances without row data\n        self.distances.row_items = None\n        self.widget.set_distances(self.distances)\n        self.assertNotIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n        # Non-square distances, row labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, column labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, both labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n    def test_context_attribute(self):\n        distances = Euclidean(self.iris, axis=0)\n        annotations = [\"None\", \"Enumerate\"]\n        self.widget.set_distances(distances)\n        self.widget.openContext(distances, annotations)\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget.commit, 'now') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.distances, self.distances)\n            commit.assert_called()\n\n    def test_labels(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        grades = Table.from_list(\n            Domain([x, y], [], [s]),\n            [[91.0, 89.0, \"Bill\"],\n             [51.0, 100.0, \"Cynthia\"],\n             [9.0, 61.0, \"Demi\"],\n             [49.0, 92.0, \"Fred\"],\n             [91.0, 49.0, \"George\"]\n             ]\n        )\n\n        header = self.widget.tablemodel.headerData\n\n        distances = Euclidean(grades)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(grades.domain.metas[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertEqual(header(2, Qt.Horizontal, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(2, Qt.Vertical, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n        idx = ac.model().indexOf(grades.domain.attributes[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertIn(\"9\", header(2, Qt.Horizontal, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertIn(\"9\", header(2, Qt.Vertical, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_num_meta_labels_w_nan(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        data = Table.from_list(\n            Domain([x], [], [y, s]),\n            [[0, 1, \"a\"],\n             [1, np.nan, \"b\"]]\n        )\n        distances = Euclidean(data)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(y)\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n\n        header = self.widget.tablemodel.headerData\n        self.assertEqual(header(0, Qt.Horizontal, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Horizontal, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(0, Qt.Vertical, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Vertical, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_choose_label(self):\n        self.assertIs(OWDistanceMatrix._choose_label(self.iris),\n                      self.iris.domain.class_var)\n\n        domain = Domain([ContinuousVariable(x) for x in \"xyz\"],\n                        ContinuousVariable(\"t\"),\n                        [ContinuousVariable(\"m\")] +\n                        [StringVariable(c) for c in \"abc\"]\n                        )\n        data = Table.from_numpy(\n            domain,\n            np.zeros((4, 3), dtype=float),\n            np.arange(4, dtype=float),\n            np.array([[0, \"a\", \"a\", \"a\"],\n                      [1, \"b\", \"b\", \"b\"],\n                      [2, \"a\", \"c\", \"b\"],\n                      [0, \"b\", \"a\", \"a\"]])\n        )\n        self.assertIs(OWDistanceMatrix._choose_label(data),\n                      domain.metas[2])\n        domain2 = Domain(domain.attributes, domain.class_var, domain.metas[:-2])\n        self.assertIs(OWDistanceMatrix._choose_label(data.transform(domain2)),\n                      domain.metas[1])\n\n    def test_non_square_labels(self):\n        widget = self.widget\n        ac = self.widget.annot_combo\n\n        dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n        dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n        dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n        self.send_signal(widget.Inputs.distances, dist)\n        self.assertEqual(ac.model().rowCount(), 3)\n\n        header = partial(widget.tablemodel.headerData, role=Qt.DisplayRole)\n        ac.setCurrentIndex(0)\n        ac.activated.emit(0)\n        self.assertIsNone(header(1, Qt.Horizontal))\n        self.assertIsNone(header(1, Qt.Vertical))\n\n        ac.setCurrentIndex(1)\n        ac.activated.emit(1)\n        self.assertEqual(header(1, Qt.Horizontal), \"2\")\n        self.assertEqual(header(1, Qt.Vertical), \"2\")\n\n        ac.setCurrentIndex(2)\n        ac.activated.emit(2)\n        self.assertEqual(header(1, Qt.Horizontal), \"dd\")\n        self.assertEqual(header(1, Qt.Vertical), \"bb\")\n\n    @WidgetTest.skipNonEnglish\n    def test_migrate_settings_v1_and_use_them(self):\n        ind = [1, 2, 5, 6, 7, 8]\n        context = Context(\n            values={'__version__': 1},\n            dim=10,\n            annotations=['None', 'Enumerate',\n                         'sepal length', 'sepal width', 'petal length',\n                         'petal width', 'iris'],\n            annotation='petal length',\n            selection=ind)\n        widget = self.create_widget(\n            OWDistanceMatrix, stored_settings={\"__version__\": 1, \"context_settings\": [context]})\n        iris = Table(\"iris\")[:10]\n        distances = Euclidean(iris)\n        self.send_signal(widget.Inputs.distances, distances)\n        self.assertEqual(widget.annotation_idx, 4)\n        self.assertEqual(widget.tableview.selectionModel().selectedItems(), ind)\n        outm = self.get_output(widget.Outputs.distances)\n        np.testing.assert_equal(outm, distances.submatrix(ind, ind))\n\n    def test_square_settings(self):\n        widget = self.widget\n        self.send_signal(widget.Inputs.distances, self.distances)\n        widget._set_selection([0, 3, 4])\n        widget.annotation_idx = 3\n\n        self.send_signal(widget.Inputs.distances, None)\n        self.assertEqual(widget._get_selection(), ([], True))\n        self.assertEqual(widget.annotation_idx, 0)\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        matrix = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        matrix.row_items = list(\"ab\")\n\n        self.send_signal(widget.Inputs.distances,matrix)\n        self.assertEqual(widget._get_selection(), (([], []), False))\n        self.assertEqual(widget.annotation_idx, 2)\n\n        widget._set_selection(([0], [0, 2]))\n        widget.annotation_idx = 0\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        self.send_signal(widget.Inputs.distances, matrix)\n        self.assertEqual(widget._get_selection(), (([0], [0, 2]), False))\n        self.assertEqual(widget.annotation_idx, 0)\n\n    def test_empty_matrix(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        self.send_signal(self.widget.Inputs.distances, matrix)\n        self.assertTrue(self.widget.Error.empty_matrix.is_shown())\n        self.send_signal(self.widget.Inputs.distances, None)\n        self.assertFalse(self.widget.Error.empty_matrix.is_shown())",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 19,
                                "end_lineno": 251,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "from typing import NamedTuple, List, Optional, Dict, Any\n\nimport numpy as np\n\nfrom AnyQt.QtWidgets import QTableView, QHeaderView\nfrom AnyQt.QtGui import QColor, QBrush, QFont\nfrom AnyQt.QtCore import Qt, QAbstractTableModel\n\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets import gui\nfrom Orange.widgets.utils import colorpalettes\nfrom Orange.widgets.utils.itemdelegates import FixedFormatNumericColumnDelegate\n\n\nclass LabelData(NamedTuple):\n    labels: Optional[List[str]] = None\n    colors: Optional[np.ndarray] = None\n\n\nclass DistMatrixModel(QAbstractTableModel):\n    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))\n                         for i in range(256)])\n\n    _diverging_brushes = np.array([\n        QBrush(col) for col in\n        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'\n        ].qcolors])\n\n    def __init__(self):\n        super().__init__()\n        self.distances: Optional[DistMatrix] = None\n        self.colors: Optional[np.ndarray] = None\n        self.brushes: Optional[np.ndarray] = None\n        self.__header_data: Dict[Any, Optional[LabelData]] = {\n            Qt.Horizontal: LabelData(),\n            Qt.Vertical: LabelData()}\n        self.__zero_diag: bool = True\n        self.__span: Optional[float] = None\n\n        self.__header_font = QFont()\n        self.__header_font.setBold(True)\n\n    def set_data(self, distances):\n        self.beginResetModel()\n        self.distances = distances\n        self.__header_data = dict.fromkeys(self.__header_data, LabelData())\n        if distances is None:\n            self.__span = self.colors = self.brushes = None\n            return\n        minc = min(0, np.min(distances))\n        maxc = np.max(distances)\n        if minc < 0:\n            self.__span = max(-minc, maxc)\n            self.brushes = self._diverging_brushes\n            self.colors = 127 + (distances / self.__span * 128).astype(int)\n        else:\n            self.__span = maxc\n            self.brushes = self._brushes\n            self.colors = (distances / self.__span * 255).astype(int)\n\n        self.__zero_diag = \\\n            distances.is_symmetric() and np.allclose(np.diag(distances), 0)\n        self.endResetModel()\n\n    def set_labels(self, orientation, labels: Optional[List[str]],\n                   colors: Optional[np.ndarray] = None):\n        self.__header_data[orientation] = LabelData(labels, colors)\n        rc, cc = self.rowCount() - 1, self.columnCount() - 1\n        self.headerDataChanged.emit(\n            orientation, 0, rc if orientation == Qt.Vertical else cc)\n        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))\n\n    def rowCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[0]\n\n    def columnCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[1]\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.TextAlignmentRole:\n            return Qt.AlignCenter | Qt.AlignVCenter\n        if self.distances is None:\n            return None\n\n        row, col = index.row(), index.column()\n        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):\n            return float(self.distances[row, col])\n        if role == Qt.BackgroundRole:\n            return self.brushes[self.colors[row, col]]\n        if role == Qt.ForegroundRole:\n            return QColor(Qt.black)  # the background is light-ish\n        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:\n            return 0., self.__span\n        return None\n\n    def headerData(self, ind, orientation, role):\n        if role == Qt.FontRole:\n            return self.__header_font\n\n        __header_data = self.__header_data[orientation]\n        if role == Qt.DisplayRole:\n            if __header_data.labels is not None \\\n                    and ind < len(__header_data.labels):\n                return __header_data.labels[ind]\n\n        colors = self.__header_data[orientation].colors\n        if colors is not None:\n            color = colors[ind].lighter(150)\n            if role == Qt.BackgroundRole:\n                return QBrush(color)\n            if role == Qt.ForegroundRole:\n                return QColor(Qt.black if color.value() > 128 else Qt.white)\n        return None\n\n\nclass DistMatrixView(gui.HScrollStepMixin, QTableView):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n\n        self.setWordWrap(False)\n        self.setTextElideMode(Qt.ElideNone)\n        self.setEditTriggers(QTableView.NoEditTriggers)\n        self.setItemDelegate(\n            FixedFormatNumericColumnDelegate(\n                roles=(Qt.DisplayRole, Qt.BackgroundRole, Qt.ForegroundRole,\n                       Qt.TextAlignmentRole)))\n        for header in (self.horizontalHeader(), self.verticalHeader()):\n            header.setResizeContentsPrecision(1)\n            header.setSectionResizeMode(QHeaderView.ResizeToContents)\n            header.setHighlightSections(True)\n            header.setSectionsClickable(False)\n        self.verticalHeader().setDefaultAlignment(\n            Qt.AlignRight | Qt.AlignVCenter)\n",
            "new_file_content": "from typing import NamedTuple, List, Optional, Dict, Any\n\nimport numpy as np\n\nfrom AnyQt.QtWidgets import QTableView, QHeaderView\nfrom AnyQt.QtGui import QColor, QBrush, QFont\nfrom AnyQt.QtCore import Qt, QAbstractTableModel\n\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets import gui\nfrom Orange.widgets.utils import colorpalettes\nfrom Orange.widgets.utils.itemdelegates import FixedFormatNumericColumnDelegate\n\n\nclass LabelData(NamedTuple):\n    labels: Optional[List[str]] = None\n    colors: Optional[np.ndarray] = None\n\n\nclass DistMatrixModel(QAbstractTableModel):\n    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))\n                         for i in range(256)])\n\n    _diverging_brushes = np.array([\n        QBrush(col) for col in\n        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'\n        ].qcolors])\n\n    def __init__(self):\n        super().__init__()\n        self.distances: Optional[DistMatrix] = None\n        self.colors: Optional[np.ndarray] = None\n        self.brushes: Optional[np.ndarray] = None\n        self.__header_data: Dict[Any, Optional[LabelData]] = {\n            Qt.Horizontal: LabelData(),\n            Qt.Vertical: LabelData()}\n        self.__zero_diag: bool = True\n        self.__span: Optional[float] = None\n\n        self.__header_font = QFont()\n        self.__header_font.setBold(True)\n\n    def set_data(self, distances):\n        self.beginResetModel()\n        self.distances = distances\n        self.__header_data = dict.fromkeys(self.__header_data, LabelData())\n        if distances is None or len(distances) == 0:\n            self.__span = self.colors = self.brushes = None\n            return\n        minc = min(0, np.min(distances))\n        maxc = np.max(distances)\n        if minc < 0:\n            self.__span = max(-minc, maxc)\n            self.brushes = self._diverging_brushes\n            self.colors = 127 + (distances / self.__span * 128).astype(int)\n        else:\n            self.__span = maxc\n            self.brushes = self._brushes\n            self.colors = (distances / self.__span * 255).astype(int)\n\n        self.__zero_diag = \\\n            distances.is_symmetric() and np.allclose(np.diag(distances), 0)\n        self.endResetModel()\n\n    def set_labels(self, orientation, labels: Optional[List[str]],\n                   colors: Optional[np.ndarray] = None):\n        self.__header_data[orientation] = LabelData(labels, colors)\n        rc, cc = self.rowCount() - 1, self.columnCount() - 1\n        self.headerDataChanged.emit(\n            orientation, 0, rc if orientation == Qt.Vertical else cc)\n        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))\n\n    def rowCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[0]\n\n    def columnCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[1]\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.TextAlignmentRole:\n            return Qt.AlignCenter | Qt.AlignVCenter\n        if self.distances is None:\n            return None\n\n        row, col = index.row(), index.column()\n        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):\n            return float(self.distances[row, col])\n        if role == Qt.BackgroundRole:\n            return self.brushes[self.colors[row, col]]\n        if role == Qt.ForegroundRole:\n            return QColor(Qt.black)  # the background is light-ish\n        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:\n            return 0., self.__span\n        return None\n\n    def headerData(self, ind, orientation, role):\n        if role == Qt.FontRole:\n            return self.__header_font\n\n        __header_data = self.__header_data[orientation]\n        if role == Qt.DisplayRole:\n            if __header_data.labels is not None \\\n                    and ind < len(__header_data.labels):\n                return __header_data.labels[ind]\n\n        colors = self.__header_data[orientation].colors\n        if colors is not None:\n            color = colors[ind].lighter(150)\n            if role == Qt.BackgroundRole:\n                return QBrush(color)\n            if role == Qt.ForegroundRole:\n                return QColor(Qt.black if color.value() > 128 else Qt.white)\n        return None\n\n\nclass DistMatrixView(gui.HScrollStepMixin, QTableView):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n\n        self.setWordWrap(False)\n        self.setTextElideMode(Qt.ElideNone)\n        self.setEditTriggers(QTableView.NoEditTriggers)\n        self.setItemDelegate(\n            FixedFormatNumericColumnDelegate(\n                roles=(Qt.DisplayRole, Qt.BackgroundRole, Qt.ForegroundRole,\n                       Qt.TextAlignmentRole)))\n        for header in (self.horizontalHeader(), self.verticalHeader()):\n            header.setResizeContentsPrecision(1)\n            header.setSectionResizeMode(QHeaderView.ResizeToContents)\n            header.setHighlightSections(True)\n            header.setSectionsClickable(False)\n        self.verticalHeader().setDefaultAlignment(\n            Qt.AlignRight | Qt.AlignVCenter)\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/utils/distmatrixmodel.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "b3b971a58",
                "new_commit_hash": "bfd66085e",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/utils/distmatrixmodel.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/utils/distmatrixmodel.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 44,
                            "length": 7
                        },
                        "new_range": {
                            "start": 44,
                            "length": 7
                        },
                        "section": "class DistMatrixModel(QAbstractTableModel):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.beginResetModel()",
                                "type": "context"
                            },
                            {
                                "content": "        self.distances = distances",
                                "type": "context"
                            },
                            {
                                "content": "        self.__header_data = dict.fromkeys(self.__header_data, LabelData())",
                                "type": "context"
                            },
                            {
                                "content": "        if distances is None:",
                                "type": "deleted"
                            },
                            {
                                "content": "        if distances is None or len(distances) == 0:",
                                "type": "added"
                            },
                            {
                                "content": "            self.__span = self.colors = self.brushes = None",
                                "type": "context"
                            },
                            {
                                "content": "            return",
                                "type": "context"
                            },
                            {
                                "content": "        minc = min(0, np.min(distances))",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/utils/distmatrixmodel.py",
                            "type": "method",
                            "name": "DistMatrixModel.set_data",
                            "content": "class DistMatrixModel(QAbstractTableModel):\n    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))\n                         for i in range(256)])\n\n    _diverging_brushes = np.array([\n        QBrush(col) for col in\n        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'\n        ].qcolors])\n\n    def __init__(self):\n        super().__init__()\n        self.distances: Optional[DistMatrix] = None\n        self.colors: Optional[np.ndarray] = None\n        self.brushes: Optional[np.ndarray] = None\n        self.__header_data: Dict[Any, Optional[LabelData]] = {\n            Qt.Horizontal: LabelData(),\n            Qt.Vertical: LabelData()}\n        self.__zero_diag: bool = True\n        self.__span: Optional[float] = None\n\n        self.__header_font = QFont()\n        self.__header_font.setBold(True)\n\n    def set_data(self, distances):\n        self.beginResetModel()\n        self.distances = distances\n        self.__header_data = dict.fromkeys(self.__header_data, LabelData())\n        if distances is None:\n            self.__span = self.colors = self.brushes = None\n            return\n        minc = min(0, np.min(distances))\n        maxc = np.max(distances)\n        if minc < 0:\n            self.__span = max(-minc, maxc)\n            self.brushes = self._diverging_brushes\n            self.colors = 127 + (distances / self.__span * 128).astype(int)\n        else:\n            self.__span = maxc\n            self.brushes = self._brushes\n            self.colors = (distances / self.__span * 255).astype(int)\n\n        self.__zero_diag = \\\n            distances.is_symmetric() and np.allclose(np.diag(distances), 0)\n        self.endResetModel()\n\n    def set_labels(self, orientation, labels: Optional[List[str]],\n                   colors: Optional[np.ndarray] = None):\n        self.__header_data[orientation] = LabelData(labels, colors)\n        rc, cc = self.rowCount() - 1, self.columnCount() - 1\n        self.headerDataChanged.emit(\n            orientation, 0, rc if orientation == Qt.Vertical else cc)\n        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))\n\n    def rowCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[0]\n\n    def columnCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[1]\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.TextAlignmentRole:\n            return Qt.AlignCenter | Qt.AlignVCenter\n        if self.distances is None:\n            return None\n\n        row, col = index.row(), index.column()\n        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):\n            return float(self.distances[row, col])\n        if role == Qt.BackgroundRole:\n            return self.brushes[self.colors[row, col]]\n        if role == Qt.ForegroundRole:\n            return QColor(Qt.black)  # the background is light-ish\n        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:\n            return 0., self.__span\n        return None\n\n    def headerData(self, ind, orientation, role):\n        if role == Qt.FontRole:\n            return self.__header_font\n\n        __header_data = self.__header_data[orientation]\n        if role == Qt.DisplayRole:\n            if __header_data.labels is not None \\\n                    and ind < len(__header_data.labels):\n                return __header_data.labels[ind]\n\n        colors = self.__header_data[orientation].colors\n        if colors is not None:\n            color = colors[ind].lighter(150)\n            if role == Qt.BackgroundRole:\n                return QBrush(color)\n            if role == Qt.ForegroundRole:\n                return QColor(Qt.black if color.value() > 128 else Qt.white)\n        return None",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 43,
                            "end_lineno": 63,
                            "parent": {
                                "file_name": "Orange/widgets/utils/distmatrixmodel.py",
                                "type": "class",
                                "name": "DistMatrixModel",
                                "content": "class DistMatrixModel(QAbstractTableModel):\n    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))\n                         for i in range(256)])\n\n    _diverging_brushes = np.array([\n        QBrush(col) for col in\n        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'\n        ].qcolors])\n\n    def __init__(self):\n        super().__init__()\n        self.distances: Optional[DistMatrix] = None\n        self.colors: Optional[np.ndarray] = None\n        self.brushes: Optional[np.ndarray] = None\n        self.__header_data: Dict[Any, Optional[LabelData]] = {\n            Qt.Horizontal: LabelData(),\n            Qt.Vertical: LabelData()}\n        self.__zero_diag: bool = True\n        self.__span: Optional[float] = None\n\n        self.__header_font = QFont()\n        self.__header_font.setBold(True)\n\n    def set_data(self, distances):\n        self.beginResetModel()\n        self.distances = distances\n        self.__header_data = dict.fromkeys(self.__header_data, LabelData())\n        if distances is None:\n            self.__span = self.colors = self.brushes = None\n            return\n        minc = min(0, np.min(distances))\n        maxc = np.max(distances)\n        if minc < 0:\n            self.__span = max(-minc, maxc)\n            self.brushes = self._diverging_brushes\n            self.colors = 127 + (distances / self.__span * 128).astype(int)\n        else:\n            self.__span = maxc\n            self.brushes = self._brushes\n            self.colors = (distances / self.__span * 255).astype(int)\n\n        self.__zero_diag = \\\n            distances.is_symmetric() and np.allclose(np.diag(distances), 0)\n        self.endResetModel()\n\n    def set_labels(self, orientation, labels: Optional[List[str]],\n                   colors: Optional[np.ndarray] = None):\n        self.__header_data[orientation] = LabelData(labels, colors)\n        rc, cc = self.rowCount() - 1, self.columnCount() - 1\n        self.headerDataChanged.emit(\n            orientation, 0, rc if orientation == Qt.Vertical else cc)\n        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))\n\n    def rowCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[0]\n\n    def columnCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[1]\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.TextAlignmentRole:\n            return Qt.AlignCenter | Qt.AlignVCenter\n        if self.distances is None:\n            return None\n\n        row, col = index.row(), index.column()\n        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):\n            return float(self.distances[row, col])\n        if role == Qt.BackgroundRole:\n            return self.brushes[self.colors[row, col]]\n        if role == Qt.ForegroundRole:\n            return QColor(Qt.black)  # the background is light-ish\n        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:\n            return 0., self.__span\n        return None\n\n    def headerData(self, ind, orientation, role):\n        if role == Qt.FontRole:\n            return self.__header_font\n\n        __header_data = self.__header_data[orientation]\n        if role == Qt.DisplayRole:\n            if __header_data.labels is not None \\\n                    and ind < len(__header_data.labels):\n                return __header_data.labels[ind]\n\n        colors = self.__header_data[orientation].colors\n        if colors is not None:\n            color = colors[ind].lighter(150)\n            if role == Qt.BackgroundRole:\n                return QBrush(color)\n            if role == Qt.ForegroundRole:\n                return QColor(Qt.black if color.value() > 128 else Qt.white)\n        return None",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 20,
                                "end_lineno": 117,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/utils/distmatrixmodel.py",
                            "type": "class",
                            "name": "DistMatrixModel",
                            "content": "class DistMatrixModel(QAbstractTableModel):\n    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))\n                         for i in range(256)])\n\n    _diverging_brushes = np.array([\n        QBrush(col) for col in\n        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'\n        ].qcolors])\n\n    def __init__(self):\n        super().__init__()\n        self.distances: Optional[DistMatrix] = None\n        self.colors: Optional[np.ndarray] = None\n        self.brushes: Optional[np.ndarray] = None\n        self.__header_data: Dict[Any, Optional[LabelData]] = {\n            Qt.Horizontal: LabelData(),\n            Qt.Vertical: LabelData()}\n        self.__zero_diag: bool = True\n        self.__span: Optional[float] = None\n\n        self.__header_font = QFont()\n        self.__header_font.setBold(True)\n\n    def set_data(self, distances):\n        self.beginResetModel()\n        self.distances = distances\n        self.__header_data = dict.fromkeys(self.__header_data, LabelData())\n        if distances is None:\n            self.__span = self.colors = self.brushes = None\n            return\n        minc = min(0, np.min(distances))\n        maxc = np.max(distances)\n        if minc < 0:\n            self.__span = max(-minc, maxc)\n            self.brushes = self._diverging_brushes\n            self.colors = 127 + (distances / self.__span * 128).astype(int)\n        else:\n            self.__span = maxc\n            self.brushes = self._brushes\n            self.colors = (distances / self.__span * 255).astype(int)\n\n        self.__zero_diag = \\\n            distances.is_symmetric() and np.allclose(np.diag(distances), 0)\n        self.endResetModel()\n\n    def set_labels(self, orientation, labels: Optional[List[str]],\n                   colors: Optional[np.ndarray] = None):\n        self.__header_data[orientation] = LabelData(labels, colors)\n        rc, cc = self.rowCount() - 1, self.columnCount() - 1\n        self.headerDataChanged.emit(\n            orientation, 0, rc if orientation == Qt.Vertical else cc)\n        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))\n\n    def rowCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[0]\n\n    def columnCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[1]\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.TextAlignmentRole:\n            return Qt.AlignCenter | Qt.AlignVCenter\n        if self.distances is None:\n            return None\n\n        row, col = index.row(), index.column()\n        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):\n            return float(self.distances[row, col])\n        if role == Qt.BackgroundRole:\n            return self.brushes[self.colors[row, col]]\n        if role == Qt.ForegroundRole:\n            return QColor(Qt.black)  # the background is light-ish\n        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:\n            return 0., self.__span\n        return None\n\n    def headerData(self, ind, orientation, role):\n        if role == Qt.FontRole:\n            return self.__header_font\n\n        __header_data = self.__header_data[orientation]\n        if role == Qt.DisplayRole:\n            if __header_data.labels is not None \\\n                    and ind < len(__header_data.labels):\n                return __header_data.labels[ind]\n\n        colors = self.__header_data[orientation].colors\n        if colors is not None:\n            color = colors[ind].lighter(150)\n            if role == Qt.BackgroundRole:\n                return QBrush(color)\n            if role == Qt.ForegroundRole:\n                return QColor(Qt.black if color.value() > 128 else Qt.white)\n        return None",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 20,
                            "end_lineno": 117,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import unittest\nfrom unittest.mock import patch, Mock\nimport datetime\nfrom collections import namedtuple\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt\n\nfrom orangecanvas.scheme.signalmanager import LazyValue\nfrom orangewidget.utils.signals import summarize\n\nfrom Orange.data import Table, Domain, StringVariable, ContinuousVariable, \\\n    DiscreteVariable, TimeVariable\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries\n\nVarDataPair = namedtuple('VarDataPair', ['variable', 'data'])\n\n# Continuous variable variations\ncontinuous_full = VarDataPair(\n    ContinuousVariable('continuous_full'),\n    np.array([0, 1, 2, 3, 4], dtype=float),\n)\ncontinuous_missing = VarDataPair(\n    ContinuousVariable('continuous_missing'),\n    np.array([0, 1, 2, np.nan, 4], dtype=float),\n)\n\n# Unordered discrete variable variations\nrgb_full = VarDataPair(\n    DiscreteVariable('rgb_full', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nrgb_missing = VarDataPair(\n    DiscreteVariable('rgb_missing', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n# Ordered discrete variable variations\nints_full = VarDataPair(\n    DiscreteVariable('ints_full', values=('2', '3', '4')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nints_missing = VarDataPair(\n    DiscreteVariable('ints_missing', values=('2', '3', '4')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n\ndef _to_timestamps(years):\n    return [datetime.datetime(year, 1, 1).timestamp() if not np.isnan(year)\n            else np.nan for year in years]\n\n\ntime_full = VarDataPair(\n    TimeVariable('time_full'),\n    np.array(_to_timestamps([2000, 2001, 2002, 2003, 2004]), dtype=float),\n)\ntime_missing = VarDataPair(\n    TimeVariable('time_missing'),\n    np.array(_to_timestamps([2000, np.nan, 2001, 2003, 2004]), dtype=float),\n)\n\n# String variable variations\nstring_full = VarDataPair(\n    StringVariable('string_full'),\n    np.array(['a', 'b', 'c', 'd', 'e'], dtype=object),\n)\nstring_missing = VarDataPair(\n    StringVariable('string_missing'),\n    np.array(['a', 'b', 'c', StringVariable.Unknown, 'e'], dtype=object),\n)\n\n\ndef make_table(attributes, target=None, metas=None):\n    \"\"\"Build an instance of a table given various variables.\n\n    Parameters\n    ----------\n    attributes : Iterable[Tuple[Variable, np.array]\n    target : Optional[Iterable[Tuple[Variable, np.array]]\n    metas : Optional[Iterable[Tuple[Variable, np.array]]\n\n    Returns\n    -------\n    Table\n\n    \"\"\"\n    attribute_vars, attribute_vals = list(zip(*attributes))\n    attribute_vals = np.array(attribute_vals).T\n\n    target_vars, target_vals = None, None\n    if target is not None:\n        target_vars, target_vals = list(zip(*target))\n        target_vals = np.array(target_vals).T\n\n    meta_vars, meta_vals = None, None\n    if metas is not None:\n        meta_vars, meta_vals = list(zip(*metas))\n        meta_vals = np.array(meta_vals).T\n\n    return Table.from_numpy(\n        Domain(attribute_vars, class_vars=target_vars, metas=meta_vars),\n        X=attribute_vals, Y=target_vals, metas=meta_vals,\n    )\n\n\nclass TestUtils(unittest.TestCase):\n    @WidgetTest.skipNonEnglish\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        details = f'Table with {n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data.domain))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'Table with {len(data):n} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric\\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            mock.assert_not_called()\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    @WidgetTest.skipNonEnglish\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instances, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instances, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))\n\n\nclass TestSummarize(unittest.TestCase):\n    @patch(\"Orange.widgets.utils.state_summary._table_previewer\")\n    def test_summarize_table(self, previewer):\n        data = Table('zoo')\n        summary = summarize(data)\n        self.assertEqual(summary.summary, len(data))\n        self.assertEqual(summary.details,\n                         format_summary_details(data, format=Qt.RichText))\n        previewer.assert_not_called()\n        summary.preview_func()\n        previewer.assert_called_with(data)\n\n    @patch(\"Orange.widgets.utils.state_summary._table_previewer\")\n    def test_summarize_lazy_table(self, previewer):\n        data = Table('zoo')\n\n        # lazy_data of unknown length and domain\n        lazy_data = LazyValue[Table](lambda: data)\n        lazy_data.get_value = Mock(return_value=data)\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, \"?\")\n        self.assertIsInstance(summary.details, str)\n        lazy_data.get_value.assert_not_called()\n        previewer.assert_not_called()\n        summary.preview_func()\n        lazy_data.get_value.assert_called()\n        previewer.assert_called_with(data)\n        previewer.reset_mock()\n\n        # lazy_data with length and domain hint\n        lazy_data = LazyValue[Table](\n            lambda: data, length=123, domain=data.domain)\n        lazy_data.get_value = Mock(return_value=data)\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, 123)\n        self.assertEqual(summary.details,\n                         format_summary_details(data.domain, format=Qt.RichText))\n        lazy_data.get_value.assert_not_called()\n        previewer.assert_not_called()\n        summary.preview_func()\n        lazy_data.get_value.assert_called()\n        previewer.assert_called_with(data)\n        previewer.reset_mock()\n\n        # lazy_data that is already cached: complete summary even without hints\n        lazy_data = LazyValue[Table](lambda: data)\n        lazy_data.get_value()\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, len(data))\n        self.assertEqual(summary.details,\n                         format_summary_details(data, format=Qt.RichText))\n        previewer.assert_not_called()\n        summary.preview_func()\n        previewer.assert_called_with(data)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "import unittest\nfrom unittest.mock import patch, Mock\nimport datetime\nfrom collections import namedtuple\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt\nfrom AnyQt.QtWidgets import QTableView\n\nfrom orangecanvas.scheme.signalmanager import LazyValue\nfrom orangewidget.utils.signals import summarize\n\nfrom Orange.data import Table, Domain, StringVariable, ContinuousVariable, \\\n    DiscreteVariable, TimeVariable\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries, summarize_matrix\n\nVarDataPair = namedtuple('VarDataPair', ['variable', 'data'])\n\n# Continuous variable variations\ncontinuous_full = VarDataPair(\n    ContinuousVariable('continuous_full'),\n    np.array([0, 1, 2, 3, 4], dtype=float),\n)\ncontinuous_missing = VarDataPair(\n    ContinuousVariable('continuous_missing'),\n    np.array([0, 1, 2, np.nan, 4], dtype=float),\n)\n\n# Unordered discrete variable variations\nrgb_full = VarDataPair(\n    DiscreteVariable('rgb_full', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nrgb_missing = VarDataPair(\n    DiscreteVariable('rgb_missing', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n# Ordered discrete variable variations\nints_full = VarDataPair(\n    DiscreteVariable('ints_full', values=('2', '3', '4')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nints_missing = VarDataPair(\n    DiscreteVariable('ints_missing', values=('2', '3', '4')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n\ndef _to_timestamps(years):\n    return [datetime.datetime(year, 1, 1).timestamp() if not np.isnan(year)\n            else np.nan for year in years]\n\n\ntime_full = VarDataPair(\n    TimeVariable('time_full'),\n    np.array(_to_timestamps([2000, 2001, 2002, 2003, 2004]), dtype=float),\n)\ntime_missing = VarDataPair(\n    TimeVariable('time_missing'),\n    np.array(_to_timestamps([2000, np.nan, 2001, 2003, 2004]), dtype=float),\n)\n\n# String variable variations\nstring_full = VarDataPair(\n    StringVariable('string_full'),\n    np.array(['a', 'b', 'c', 'd', 'e'], dtype=object),\n)\nstring_missing = VarDataPair(\n    StringVariable('string_missing'),\n    np.array(['a', 'b', 'c', StringVariable.Unknown, 'e'], dtype=object),\n)\n\n\ndef make_table(attributes, target=None, metas=None):\n    \"\"\"Build an instance of a table given various variables.\n\n    Parameters\n    ----------\n    attributes : Iterable[Tuple[Variable, np.array]\n    target : Optional[Iterable[Tuple[Variable, np.array]]\n    metas : Optional[Iterable[Tuple[Variable, np.array]]\n\n    Returns\n    -------\n    Table\n\n    \"\"\"\n    attribute_vars, attribute_vals = list(zip(*attributes))\n    attribute_vals = np.array(attribute_vals).T\n\n    target_vars, target_vals = None, None\n    if target is not None:\n        target_vars, target_vals = list(zip(*target))\n        target_vals = np.array(target_vals).T\n\n    meta_vars, meta_vals = None, None\n    if metas is not None:\n        meta_vars, meta_vals = list(zip(*metas))\n        meta_vals = np.array(meta_vals).T\n\n    return Table.from_numpy(\n        Domain(attribute_vars, class_vars=target_vars, metas=meta_vars),\n        X=attribute_vals, Y=target_vals, metas=meta_vals,\n    )\n\n\nclass TestUtils(unittest.TestCase):\n    @WidgetTest.skipNonEnglish\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        details = f'Table with {n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data.domain))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'Table with {len(data):n} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric\\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            mock.assert_not_called()\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    @WidgetTest.skipNonEnglish\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instances, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instances, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))\n\n\nclass TestSummarize(unittest.TestCase):\n    @patch(\"Orange.widgets.utils.state_summary._table_previewer\")\n    def test_summarize_table(self, previewer):\n        data = Table('zoo')\n        summary = summarize(data)\n        self.assertEqual(summary.summary, len(data))\n        self.assertEqual(summary.details,\n                         format_summary_details(data, format=Qt.RichText))\n        previewer.assert_not_called()\n        summary.preview_func()\n        previewer.assert_called_with(data)\n\n    @patch(\"Orange.widgets.utils.state_summary._table_previewer\")\n    def test_summarize_lazy_table(self, previewer):\n        data = Table('zoo')\n\n        # lazy_data of unknown length and domain\n        lazy_data = LazyValue[Table](lambda: data)\n        lazy_data.get_value = Mock(return_value=data)\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, \"?\")\n        self.assertIsInstance(summary.details, str)\n        lazy_data.get_value.assert_not_called()\n        previewer.assert_not_called()\n        summary.preview_func()\n        lazy_data.get_value.assert_called()\n        previewer.assert_called_with(data)\n        previewer.reset_mock()\n\n        # lazy_data with length and domain hint\n        lazy_data = LazyValue[Table](\n            lambda: data, length=123, domain=data.domain)\n        lazy_data.get_value = Mock(return_value=data)\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, 123)\n        self.assertEqual(summary.details,\n                         format_summary_details(data.domain, format=Qt.RichText))\n        lazy_data.get_value.assert_not_called()\n        previewer.assert_not_called()\n        summary.preview_func()\n        lazy_data.get_value.assert_called()\n        previewer.assert_called_with(data)\n        previewer.reset_mock()\n\n        # lazy_data that is already cached: complete summary even without hints\n        lazy_data = LazyValue[Table](lambda: data)\n        lazy_data.get_value()\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, len(data))\n        self.assertEqual(summary.details,\n                         format_summary_details(data, format=Qt.RichText))\n        previewer.assert_not_called()\n        summary.preview_func()\n        previewer.assert_called_with(data)\n\n\nclass TestSummarizeMatrix(WidgetTest):\n    def test_summarize_matrix(self):\n        matrix = DistMatrix(np.arange(9).reshape(3, 3))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"3×3\")\n        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/utils/tests/test_state_summary.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "fe5ea27ba",
                "new_commit_hash": "f49eec569",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/utils/tests/test_state_summary.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/utils/tests/test_state_summary.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 6,
                            "length": 15
                        },
                        "new_range": {
                            "start": 6,
                            "length": 17
                        },
                        "section": "from collections import namedtuple"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from AnyQt.QtCore import Qt",
                                "type": "context"
                            },
                            {
                                "content": "from AnyQt.QtWidgets import QTableView",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from orangecanvas.scheme.signalmanager import LazyValue",
                                "type": "context"
                            },
                            {
                                "content": "from orangewidget.utils.signals import summarize",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Table, Domain, StringVariable, ContinuousVariable, \\",
                                "type": "context"
                            },
                            {
                                "content": "    DiscreteVariable, TimeVariable",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.misc import DistMatrix",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.widgets.tests.base import WidgetTest",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.state_summary import format_summary_details, \\",
                                "type": "context"
                            },
                            {
                                "content": "    format_multiple_summaries",
                                "type": "deleted"
                            },
                            {
                                "content": "    format_multiple_summaries, summarize_matrix",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "VarDataPair = namedtuple('VarDataPair', ['variable', 'data'])",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries, summarize_matrix",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 18,
                            "end_lineno": 19,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.misc import DistMatrix",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 16,
                            "end_lineno": 16,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "statement",
                            "name": "",
                            "content": "from AnyQt.QtWidgets import QTableView",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 9,
                            "end_lineno": 9,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 16,
                            "end_lineno": 17,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 315,
                            "length": 5
                        },
                        "new_range": {
                            "start": 317,
                            "length": 23
                        },
                        "section": "class TestSummarize(unittest.TestCase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        previewer.assert_called_with(data)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class TestSummarizeMatrix(WidgetTest):",
                                "type": "added"
                            },
                            {
                                "content": "    def test_summarize_matrix(self):",
                                "type": "added"
                            },
                            {
                                "content": "        matrix = DistMatrix(np.arange(9).reshape(3, 3))",
                                "type": "added"
                            },
                            {
                                "content": "        summary = summarize_matrix(matrix)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(summary.summary, \"3×3\")",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")",
                                "type": "added"
                            },
                            {
                                "content": "        view = summary.preview_func()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIsInstance(view, QTableView)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_summarize_matrix_empty(self):",
                                "type": "added"
                            },
                            {
                                "content": "        matrix = DistMatrix(np.empty((0, 0)))",
                                "type": "added"
                            },
                            {
                                "content": "        summary = summarize_matrix(matrix)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(summary.summary, \"0×0\")",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")",
                                "type": "added"
                            },
                            {
                                "content": "        view = summary.preview_func()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIsInstance(view, QTableView)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "if __name__ == \"__main__\":",
                                "type": "context"
                            },
                            {
                                "content": "    unittest.main()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "method",
                            "name": "TestSummarizeMatrix.test_summarize_matrix_empty",
                            "content": "class TestSummarizeMatrix(WidgetTest):\n    def test_summarize_matrix(self):\n        matrix = DistMatrix(np.arange(9).reshape(3, 3))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"3×3\")\n        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 329,
                            "end_lineno": 335,
                            "parent": {
                                "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                                "type": "class",
                                "name": "TestSummarizeMatrix",
                                "content": "class TestSummarizeMatrix(WidgetTest):\n    def test_summarize_matrix(self):\n        matrix = DistMatrix(np.arange(9).reshape(3, 3))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"3×3\")\n        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 320,
                                "end_lineno": 335,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "class",
                            "name": "TestSummarizeMatrix",
                            "content": "class TestSummarizeMatrix(WidgetTest):\n    def test_summarize_matrix(self):\n        matrix = DistMatrix(np.arange(9).reshape(3, 3))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"3×3\")\n        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 320,
                            "end_lineno": 335,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "method",
                            "name": "TestSummarizeMatrix.test_summarize_matrix",
                            "content": "class TestSummarizeMatrix(WidgetTest):\n    def test_summarize_matrix(self):\n        matrix = DistMatrix(np.arange(9).reshape(3, 3))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"3×3\")\n        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 321,
                            "end_lineno": 327,
                            "parent": {
                                "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                                "type": "class",
                                "name": "TestSummarizeMatrix",
                                "content": "class TestSummarizeMatrix(WidgetTest):\n    def test_summarize_matrix(self):\n        matrix = DistMatrix(np.arange(9).reshape(3, 3))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"3×3\")\n        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 320,
                                "end_lineno": 335,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "fb238eb93c537ec9adaec28674ffda5be7d8df8a^",
    "new_commit_hash": "fb238eb93c537ec9adaec28674ffda5be7d8df8a",
    "commit_message": "Distance Matrix: Handle empty matrix",
    "commit_date": "2024-01-12T12:02:58+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "fb238eb93c537ec9adaec28674ffda5be7d8df8a",
    "test_file_codes": [
        "import unittest\nfrom unittest.mock import patch, Mock\nimport datetime\nfrom collections import namedtuple\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt\nfrom AnyQt.QtWidgets import QTableView\n\nfrom orangecanvas.scheme.signalmanager import LazyValue\nfrom orangewidget.utils.signals import summarize\n\nfrom Orange.data import Table, Domain, StringVariable, ContinuousVariable, \\\n    DiscreteVariable, TimeVariable\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries, summarize_matrix\n\nVarDataPair = namedtuple('VarDataPair', ['variable', 'data'])\n\n# Continuous variable variations\ncontinuous_full = VarDataPair(\n    ContinuousVariable('continuous_full'),\n    np.array([0, 1, 2, 3, 4], dtype=float),\n)\ncontinuous_missing = VarDataPair(\n    ContinuousVariable('continuous_missing'),\n    np.array([0, 1, 2, np.nan, 4], dtype=float),\n)\n\n# Unordered discrete variable variations\nrgb_full = VarDataPair(\n    DiscreteVariable('rgb_full', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nrgb_missing = VarDataPair(\n    DiscreteVariable('rgb_missing', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n# Ordered discrete variable variations\nints_full = VarDataPair(\n    DiscreteVariable('ints_full', values=('2', '3', '4')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nints_missing = VarDataPair(\n    DiscreteVariable('ints_missing', values=('2', '3', '4')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n\ndef _to_timestamps(years):\n    return [datetime.datetime(year, 1, 1).timestamp() if not np.isnan(year)\n            else np.nan for year in years]\n\n\ntime_full = VarDataPair(\n    TimeVariable('time_full'),\n    np.array(_to_timestamps([2000, 2001, 2002, 2003, 2004]), dtype=float),\n)\ntime_missing = VarDataPair(\n    TimeVariable('time_missing'),\n    np.array(_to_timestamps([2000, np.nan, 2001, 2003, 2004]), dtype=float),\n)\n\n# String variable variations\nstring_full = VarDataPair(\n    StringVariable('string_full'),\n    np.array(['a', 'b', 'c', 'd', 'e'], dtype=object),\n)\nstring_missing = VarDataPair(\n    StringVariable('string_missing'),\n    np.array(['a', 'b', 'c', StringVariable.Unknown, 'e'], dtype=object),\n)\n\n\ndef make_table(attributes, target=None, metas=None):\n    \"\"\"Build an instance of a table given various variables.\n\n    Parameters\n    ----------\n    attributes : Iterable[Tuple[Variable, np.array]\n    target : Optional[Iterable[Tuple[Variable, np.array]]\n    metas : Optional[Iterable[Tuple[Variable, np.array]]\n\n    Returns\n    -------\n    Table\n\n    \"\"\"\n    attribute_vars, attribute_vals = list(zip(*attributes))\n    attribute_vals = np.array(attribute_vals).T\n\n    target_vars, target_vals = None, None\n    if target is not None:\n        target_vars, target_vals = list(zip(*target))\n        target_vals = np.array(target_vals).T\n\n    meta_vars, meta_vals = None, None\n    if metas is not None:\n        meta_vars, meta_vals = list(zip(*metas))\n        meta_vals = np.array(meta_vals).T\n\n    return Table.from_numpy(\n        Domain(attribute_vars, class_vars=target_vars, metas=meta_vars),\n        X=attribute_vals, Y=target_vals, metas=meta_vals,\n    )\n\n\nclass TestUtils(unittest.TestCase):\n    @WidgetTest.skipNonEnglish\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        details = f'Table with {n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data.domain))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'Table with {len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'Table with {len(data):n} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric\\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            mock.assert_not_called()\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    @WidgetTest.skipNonEnglish\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instances, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instances, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))\n\n\nclass TestSummarize(unittest.TestCase):\n    @patch(\"Orange.widgets.utils.state_summary._table_previewer\")\n    def test_summarize_table(self, previewer):\n        data = Table('zoo')\n        summary = summarize(data)\n        self.assertEqual(summary.summary, len(data))\n        self.assertEqual(summary.details,\n                         format_summary_details(data, format=Qt.RichText))\n        previewer.assert_not_called()\n        summary.preview_func()\n        previewer.assert_called_with(data)\n\n    @patch(\"Orange.widgets.utils.state_summary._table_previewer\")\n    def test_summarize_lazy_table(self, previewer):\n        data = Table('zoo')\n\n        # lazy_data of unknown length and domain\n        lazy_data = LazyValue[Table](lambda: data)\n        lazy_data.get_value = Mock(return_value=data)\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, \"?\")\n        self.assertIsInstance(summary.details, str)\n        lazy_data.get_value.assert_not_called()\n        previewer.assert_not_called()\n        summary.preview_func()\n        lazy_data.get_value.assert_called()\n        previewer.assert_called_with(data)\n        previewer.reset_mock()\n\n        # lazy_data with length and domain hint\n        lazy_data = LazyValue[Table](\n            lambda: data, length=123, domain=data.domain)\n        lazy_data.get_value = Mock(return_value=data)\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, 123)\n        self.assertEqual(summary.details,\n                         format_summary_details(data.domain, format=Qt.RichText))\n        lazy_data.get_value.assert_not_called()\n        previewer.assert_not_called()\n        summary.preview_func()\n        lazy_data.get_value.assert_called()\n        previewer.assert_called_with(data)\n        previewer.reset_mock()\n\n        # lazy_data that is already cached: complete summary even without hints\n        lazy_data = LazyValue[Table](lambda: data)\n        lazy_data.get_value()\n        summary = summarize(lazy_data)\n        self.assertEqual(summary.summary, len(data))\n        self.assertEqual(summary.details,\n                         format_summary_details(data, format=Qt.RichText))\n        previewer.assert_not_called()\n        summary.preview_func()\n        previewer.assert_called_with(data)\n\n\nclass TestSummarizeMatrix(WidgetTest):\n    def test_summarize_matrix(self):\n        matrix = DistMatrix(np.arange(9).reshape(3, 3))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"3×3\")\n        self.assertEqual(summary.details, \"<nobr>3×3 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n        view = summary.preview_func()\n        self.assertIsInstance(view, QTableView)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
        "# pylint: disable=protected-access\n\nimport unittest\nfrom functools import partial\nfrom unittest.mock import patch\n\nimport numpy as np\nfrom AnyQt.QtCore import Qt\n\nfrom orangewidget.settings import Context\n\nfrom Orange.misc import DistMatrix\nfrom Orange.data import Table, Domain, ContinuousVariable, StringVariable\nfrom Orange.distance import Euclidean\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.unsupervised.owdistancematrix import OWDistanceMatrix\n\n\nclass TestOWDistanceMatrix(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDistanceMatrix)\n        self.iris = Table(\"iris\")[:5]\n        self.distances = Euclidean(self.iris)\n\n    def test_set_distances(self):\n        assert isinstance(self.widget, OWDistanceMatrix)\n\n        # Distances with row data\n        self.widget.set_distances(self.distances)\n        self.assertIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Distances without row data\n        self.distances.row_items = None\n        self.widget.set_distances(self.distances)\n        self.assertNotIn(self.iris.domain[0], self.widget.annot_combo.model())\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n        # Non-square distances, row labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, column labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, both labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        distances.row_items = list(\"ab\")\n        distances.col_items = list(\"def\")\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 3)\n        self.widget.send_report()\n\n        # Non-square distances, no labels\n        distances = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        self.widget.set_distances(distances)\n        self.assertEqual(self.widget.annot_combo.model().rowCount(), 2)\n        self.widget.send_report()\n\n    def test_context_attribute(self):\n        distances = Euclidean(self.iris, axis=0)\n        annotations = [\"None\", \"Enumerate\"]\n        self.widget.set_distances(distances)\n        self.widget.openContext(distances, annotations)\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget.commit, 'now') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.distances, self.distances)\n            commit.assert_called()\n\n    def test_labels(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        grades = Table.from_list(\n            Domain([x, y], [], [s]),\n            [[91.0, 89.0, \"Bill\"],\n             [51.0, 100.0, \"Cynthia\"],\n             [9.0, 61.0, \"Demi\"],\n             [49.0, 92.0, \"Fred\"],\n             [91.0, 49.0, \"George\"]\n             ]\n        )\n\n        header = self.widget.tablemodel.headerData\n\n        distances = Euclidean(grades)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(grades.domain.metas[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertEqual(header(2, Qt.Horizontal, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(2, Qt.Vertical, Qt.DisplayRole), \"Demi\")\n        self.assertIsNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n        idx = ac.model().indexOf(grades.domain.attributes[0])\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n        self.assertIn(\"9\", header(2, Qt.Horizontal, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertIn(\"9\", header(2, Qt.Vertical, Qt.DisplayRole))\n        self.assertIsNotNone(header(2, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_num_meta_labels_w_nan(self):\n        x, y = (ContinuousVariable(c) for c in \"xy\")\n        s = StringVariable(\"s\")\n        data = Table.from_list(\n            Domain([x], [], [y, s]),\n            [[0, 1, \"a\"],\n             [1, np.nan, \"b\"]]\n        )\n        distances = Euclidean(data)\n        self.widget.set_distances(distances)\n        ac = self.widget.annot_combo\n        idx = ac.model().indexOf(y)\n        ac.setCurrentIndex(idx)\n        ac.activated.emit(idx)\n\n        header = self.widget.tablemodel.headerData\n        self.assertEqual(header(0, Qt.Horizontal, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Horizontal, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Horizontal, Qt.BackgroundRole))\n        self.assertEqual(header(0, Qt.Vertical, Qt.DisplayRole), \"1\")\n        self.assertEqual(header(1, Qt.Vertical, Qt.DisplayRole), \"?\")\n        self.assertIsNotNone(header(1, Qt.Vertical, Qt.BackgroundRole))\n\n    def test_choose_label(self):\n        self.assertIs(OWDistanceMatrix._choose_label(self.iris),\n                      self.iris.domain.class_var)\n\n        domain = Domain([ContinuousVariable(x) for x in \"xyz\"],\n                        ContinuousVariable(\"t\"),\n                        [ContinuousVariable(\"m\")] +\n                        [StringVariable(c) for c in \"abc\"]\n                        )\n        data = Table.from_numpy(\n            domain,\n            np.zeros((4, 3), dtype=float),\n            np.arange(4, dtype=float),\n            np.array([[0, \"a\", \"a\", \"a\"],\n                      [1, \"b\", \"b\", \"b\"],\n                      [2, \"a\", \"c\", \"b\"],\n                      [0, \"b\", \"a\", \"a\"]])\n        )\n        self.assertIs(OWDistanceMatrix._choose_label(data),\n                      domain.metas[2])\n        domain2 = Domain(domain.attributes, domain.class_var, domain.metas[:-2])\n        self.assertIs(OWDistanceMatrix._choose_label(data.transform(domain2)),\n                      domain.metas[1])\n\n    def test_non_square_labels(self):\n        widget = self.widget\n        ac = self.widget.annot_combo\n\n        dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n        dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n        dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n        self.send_signal(widget.Inputs.distances, dist)\n        self.assertEqual(ac.model().rowCount(), 3)\n\n        header = partial(widget.tablemodel.headerData, role=Qt.DisplayRole)\n        ac.setCurrentIndex(0)\n        ac.activated.emit(0)\n        self.assertIsNone(header(1, Qt.Horizontal))\n        self.assertIsNone(header(1, Qt.Vertical))\n\n        ac.setCurrentIndex(1)\n        ac.activated.emit(1)\n        self.assertEqual(header(1, Qt.Horizontal), \"2\")\n        self.assertEqual(header(1, Qt.Vertical), \"2\")\n\n        ac.setCurrentIndex(2)\n        ac.activated.emit(2)\n        self.assertEqual(header(1, Qt.Horizontal), \"dd\")\n        self.assertEqual(header(1, Qt.Vertical), \"bb\")\n\n    @WidgetTest.skipNonEnglish\n    def test_migrate_settings_v1_and_use_them(self):\n        ind = [1, 2, 5, 6, 7, 8]\n        context = Context(\n            values={'__version__': 1},\n            dim=10,\n            annotations=['None', 'Enumerate',\n                         'sepal length', 'sepal width', 'petal length',\n                         'petal width', 'iris'],\n            annotation='petal length',\n            selection=ind)\n        widget = self.create_widget(\n            OWDistanceMatrix, stored_settings={\"__version__\": 1, \"context_settings\": [context]})\n        iris = Table(\"iris\")[:10]\n        distances = Euclidean(iris)\n        self.send_signal(widget.Inputs.distances, distances)\n        self.assertEqual(widget.annotation_idx, 4)\n        self.assertEqual(widget.tableview.selectionModel().selectedItems(), ind)\n        outm = self.get_output(widget.Outputs.distances)\n        np.testing.assert_equal(outm, distances.submatrix(ind, ind))\n\n    def test_square_settings(self):\n        widget = self.widget\n        self.send_signal(widget.Inputs.distances, self.distances)\n        widget._set_selection([0, 3, 4])\n        widget.annotation_idx = 3\n\n        self.send_signal(widget.Inputs.distances, None)\n        self.assertEqual(widget._get_selection(), ([], True))\n        self.assertEqual(widget.annotation_idx, 0)\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        matrix = DistMatrix(np.array([[1, 2, 3], [4, 5, 6]]))\n        matrix.row_items = list(\"ab\")\n\n        self.send_signal(widget.Inputs.distances,matrix)\n        self.assertEqual(widget._get_selection(), (([], []), False))\n        self.assertEqual(widget.annotation_idx, 2)\n\n        widget._set_selection(([0], [0, 2]))\n        widget.annotation_idx = 0\n\n        self.send_signal(widget.Inputs.distances, self.distances)\n        self.assertEqual(widget._get_selection(), ([0, 3, 4], True))\n        self.assertEqual(widget.annotation_idx, 3)\n\n        self.send_signal(widget.Inputs.distances, matrix)\n        self.assertEqual(widget._get_selection(), (([0], [0, 2]), False))\n        self.assertEqual(widget.annotation_idx, 0)\n\n    def test_empty_matrix(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        self.send_signal(self.widget.Inputs.distances, matrix)\n        self.assertTrue(self.widget.Error.empty_matrix.is_shown())\n        self.send_signal(self.widget.Inputs.distances, None)\n        self.assertFalse(self.widget.Error.empty_matrix.is_shown())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py",
        "test_2.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_contingency.c -o build/temp.linux-x86_64-3.7/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-3.7/Orange/data\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_io.c -o build/temp.linux-x86_64-3.7/Orange/data/_io.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_variable.c -o build/temp.linux-x86_64-3.7/Orange/data/_variable.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/distance/_distance.c -o build/temp.linux-x86_64-3.7/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-3.7/Orange/distance\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+fb238eb to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a\nProcessing dependencies for Orange3==3.37.0.dev0+fb238eb\nSearching for xlsxwriter\nReading https://pypi.org/simple/xlsxwriter/\nDownloading https://files.pythonhosted.org/packages/a7/ea/53d1fe468e63e092cf16e2c18d16f50c29851242f9dd12d6a66e0d7f0d02/XlsxWriter-3.2.0-py3-none-any.whl#sha256=ecfd5405b3e0e228219bcaf24c2ca0915e012ca9464a14048021d21a995d490e\nBest match: XlsxWriter 3.2.0\nProcessing XlsxWriter-3.2.0-py3-none-any.whl\nInstalling XlsxWriter-3.2.0-py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages\nAdding XlsxWriter 3.2.0 to easy-install.pth file\nInstalling vba_extract.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/XlsxWriter-3.2.0-py3.7.egg\nSearching for xlrd>=1.2.0\nReading https://pypi.org/simple/xlrd/\nDownloading https://files.pythonhosted.org/packages/a6/0c/c2a72d51fe56e08a08acc85d13013558a2d793028ae7385448a6ccdfae64/xlrd-2.0.1-py2.py3-none-any.whl#sha256=6a33ee89877bd9abc1158129f6e94be74e2679636b8a205b43b85206c3f0bbdd\nBest match: xlrd 2.0.1\nProcessing xlrd-2.0.1-py2.py3-none-any.whl\nInstalling xlrd-2.0.1-py2.py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages\nAdding xlrd 2.0.1 to easy-install.pth file\nInstalling runxlrd.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/xlrd-2.0.1-py3.7.egg\nSearching for xgboost>=1.7.4\nReading https://pypi.org/simple/xgboost/\nDownloading https://files.pythonhosted.org/packages/48/bc/05d7db90d421c5e3d681a12fd1eb087e37bf2e9bbe2b105422d6319ecc92/xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl#sha256=32a43526208fe676527c698cb852e0e9515e6d7294143780e476d335290a131b\nBest match: xgboost 2.1.3\nProcessing xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl\nInstalling xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages\nAdding xgboost 2.1.3 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/xgboost-2.1.3-py3.7-linux-x86_64.egg\nSearching for serverfiles\nReading https://pypi.org/simple/serverfiles/\nDownloading https://files.pythonhosted.org/packages/33/36/794fe1c4ed29b0f56a26d72e956baf0285d8fe9e29faf36797a28a8ad45b/serverfiles-0.3.1.tar.gz#sha256=5e10fc32e758791e3735bc08bce2ed4702a83b1e45ab96c5d59cc8aeecfbebe1\nBest match: serverfiles 0.3.1\nProcessing serverfiles-0.3.1.tar.gz\nWriting /tmp/easy_install-eru0xyuz/serverfiles-0.3.1/setup.cfg\nRunning serverfiles-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-eru0xyuz/serverfiles-0.3.1/egg-dist-tmp-l69q65go\ncreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nExtracting serverfiles-0.3.1-py3.7.egg to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nSearching for scipy>=1.9\nReading https://pypi.org/simple/scipy/\nDownloading https://files.pythonhosted.org/packages/d9/7b/2b8ac283cf32465ed08bc20a83d559fe7b174a484781702ba8accea001d6/scipy-1.15.0.tar.gz#sha256=300742e2cc94e36a2880ebe464a1c8b4352a7b0f3e36ec3d2ac006cdbe0219ac\nBest match: scipy 1.15.0\nProcessing scipy-1.15.0.tar.gz\nVerifying Orange installation...\n❌ Orange verification failed\nPython 3.7 installation failed, trying Python 3.8...\nAttempting installation with Python 3.8...\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_contingency.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/data\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_io.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_io.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_variable.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/distance/_distance.c -o build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/projection/_som.c -o build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+fb238eb to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a\nProcessing dependencies for Orange3==3.37.0.dev0+fb238eb\nSearching for XlsxWriter==3.2.0\nBest match: XlsxWriter 3.2.0\nAdding XlsxWriter 3.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for xgboost==2.1.3\nBest match: xgboost 2.1.3\nAdding xgboost 2.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for scipy==1.10.1\nBest match: scipy 1.10.1\nAdding scipy 1.10.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for scikit-learn==1.3.2\nBest match: scikit-learn 1.3.2\nAdding scikit-learn 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for requests==2.32.3\nBest match: requests 2.32.3\nAdding requests 2.32.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for qtconsole==5.6.1\nBest match: qtconsole 5.6.1\nAdding qtconsole 5.6.1 to easy-install.pth file\nInstalling jupyter-qtconsole script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for PyYAML==6.0.2\nBest match: PyYAML 6.0.2\nAdding PyYAML 6.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pyqtgraph==0.13.3\nBest match: pyqtgraph 0.13.3\nAdding pyqtgraph 0.13.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pygments==2.19.1\nBest match: pygments 2.19.1\nAdding pygments 2.19.1 to easy-install.pth file\nInstalling pygmentize script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pip==24.3.1\nBest match: pip 24.3.1\nAdding pip 24.3.1 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pandas==2.0.3\nBest match: pandas 2.0.3\nAdding pandas 2.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for packaging==24.2\nBest match: packaging 24.2\nAdding packaging 24.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for orange-widget-base==4.24.0\nBest match: orange-widget-base 4.24.0\nAdding orange-widget-base 4.24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for orange-canvas-core==0.2.2\nBest match: orange-canvas-core 0.2.2\nAdding orange-canvas-core 0.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for openpyxl==3.1.5\nBest match: openpyxl 3.1.5\nAdding openpyxl 3.1.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for numpy==1.24.4\nBest match: numpy 1.24.4\nAdding numpy 1.24.4 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling f2py3.8 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for networkx==3.1\nBest match: networkx 3.1\nAdding networkx 3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for matplotlib==3.7.5\nBest match: matplotlib 3.7.5\nAdding matplotlib 3.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for keyrings.alt==5.0.2\nBest match: keyrings.alt 5.0.2\nAdding keyrings.alt 5.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for keyring==25.5.0\nBest match: keyring 25.5.0\nAdding keyring 25.5.0 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for joblib==1.4.2\nBest match: joblib 1.4.2\nAdding joblib 1.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for httpx==0.28.1\nBest match: httpx 0.28.1\nAdding httpx 0.28.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for catboost==1.2.7\nBest match: catboost 1.2.7\nAdding catboost 1.2.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for nvidia-nccl-cu12==2.24.3\nBest match: nvidia-nccl-cu12 2.24.3\nAdding nvidia-nccl-cu12 2.24.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for threadpoolctl==3.5.0\nBest match: threadpoolctl 3.5.0\nAdding threadpoolctl 3.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for urllib3==2.2.3\nBest match: urllib3 2.2.3\nAdding urllib3 2.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for QtPy==2.4.2\nBest match: QtPy 2.4.2\nAdding QtPy 2.4.2 to easy-install.pth file\nInstalling qtpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for ipykernel==6.29.5\nBest match: ipykernel 6.29.5\nAdding ipykernel 6.29.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for jupyter-client==8.6.3\nBest match: jupyter-client 8.6.3\nAdding jupyter-client 8.6.3 to easy-install.pth file\nInstalling jupyter-kernel script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for jupyter-core==5.7.2\nBest match: jupyter-core 5.7.2\nAdding jupyter-core 5.7.2 to easy-install.pth file\nInstalling jupyter script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for traitlets==5.14.3\nBest match: traitlets 5.14.3\nAdding traitlets 5.14.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for tzdata==2024.2\nBest match: tzdata 2024.2\nAdding tzdata 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for importlib-resources==6.4.5\nBest match: importlib-resources 6.4.5\nAdding importlib-resources 6.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for typing-extensions==4.12.2\nBest match: typing-extensions 4.12.2\nAdding typing-extensions 4.12.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for importlib-metadata==8.5.0\nBest match: importlib-metadata 8.5.0\nAdding importlib-metadata 8.5.0 to easy-install.pth file\ndetected new path './setuptools/_vendor'\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for qasync==0.27.1\nBest match: qasync 0.27.1\nAdding qasync 0.27.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for requests-cache==1.2.1\nBest match: requests-cache 1.2.1\nAdding requests-cache 1.2.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for et-xmlfile==2.0.0\nBest match: et-xmlfile 2.0.0\nAdding et-xmlfile 2.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pillow==10.4.0\nBest match: pillow 10.4.0\nAdding pillow 10.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for kiwisolver==1.4.7\nBest match: kiwisolver 1.4.7\nAdding kiwisolver 1.4.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for fonttools==4.55.3\nBest match: fonttools 4.55.3\nAdding fonttools 4.55.3 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for cycler==0.12.1\nBest match: cycler 0.12.1\nAdding cycler 0.12.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for contourpy==1.1.1\nBest match: contourpy 1.1.1\nAdding contourpy 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for jaraco.context==6.0.1\nBest match: jaraco.context 6.0.1\nAdding jaraco.context 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for jaraco.classes==3.4.0\nBest match: jaraco.classes 3.4.0\nAdding jaraco.classes 3.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for jaraco.functools==4.1.0\nBest match: jaraco.functools 4.1.0\nAdding jaraco.functools 4.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for httpcore==1.0.7\nBest match: httpcore 1.0.7\nAdding httpcore 1.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for anyio==4.5.2\nBest match: anyio 4.5.2\nAdding anyio 4.5.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for plotly==5.24.1\nBest match: plotly 5.24.1\nAdding plotly 5.24.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for graphviz==0.20.3\nBest match: graphviz 0.20.3\nAdding graphviz 0.20.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for tornado==6.4.2\nBest match: tornado 6.4.2\nAdding tornado 6.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pyzmq==26.2.0\nBest match: pyzmq 26.2.0\nAdding pyzmq 26.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for psutil==6.1.1\nBest match: psutil 6.1.1\nAdding psutil 6.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for nest-asyncio==1.6.0\nBest match: nest-asyncio 1.6.0\nAdding nest-asyncio 1.6.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for matplotlib-inline==0.1.7\nBest match: matplotlib-inline 0.1.7\nAdding matplotlib-inline 0.1.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for ipython==8.12.3\nBest match: ipython 8.12.3\nAdding ipython 8.12.3 to easy-install.pth file\nInstalling ipython script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for debugpy==1.8.11\nBest match: debugpy 1.8.11\nAdding debugpy 1.8.11 to easy-install.pth file\nInstalling debugpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for comm==0.2.2\nBest match: comm 0.2.2\nAdding comm 0.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for platformdirs==4.3.6\nBest match: platformdirs 4.3.6\nAdding platformdirs 4.3.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for zipp==3.20.2\nBest match: zipp 3.20.2\nAdding zipp 3.20.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for cattrs==24.1.2\nBest match: cattrs 24.1.2\nAdding cattrs 24.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for attrs==24.3.0\nBest match: attrs 24.3.0\nAdding attrs 24.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for backports.tarfile==1.2.0\nBest match: backports.tarfile 1.2.0\nbackports.tarfile 1.2.0 is already the active version in easy-install.pth\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for more-itertools==10.5.0\nBest match: more-itertools 10.5.0\nAdding more-itertools 10.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for tenacity==9.0.0\nBest match: tenacity 9.0.0\nAdding tenacity 9.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pexpect==4.9.0\nBest match: pexpect 4.9.0\nAdding pexpect 4.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for stack-data==0.6.3\nBest match: stack-data 0.6.3\nAdding stack-data 0.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for prompt-toolkit==3.0.48\nBest match: prompt-toolkit 3.0.48\nAdding prompt-toolkit 3.0.48 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pickleshare==0.7.5\nBest match: pickleshare 0.7.5\nAdding pickleshare 0.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for jedi==0.19.2\nBest match: jedi 0.19.2\nAdding jedi 0.19.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for decorator==5.1.1\nBest match: decorator 5.1.1\nAdding decorator 5.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for backcall==0.2.0\nBest match: backcall 0.2.0\nAdding backcall 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for cffi==1.17.1\nBest match: cffi 1.17.1\nAdding cffi 1.17.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for ptyprocess==0.7.0\nBest match: ptyprocess 0.7.0\nAdding ptyprocess 0.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pure-eval==0.2.3\nBest match: pure-eval 0.2.3\nAdding pure-eval 0.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for asttokens==3.0.0\nBest match: asttokens 3.0.0\nAdding asttokens 3.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for executing==2.1.0\nBest match: executing 2.1.0\nAdding executing 2.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for wcwidth==0.2.13\nBest match: wcwidth 0.2.13\nAdding wcwidth 0.2.13 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for parso==0.8.4\nBest match: parso 0.8.4\nAdding parso 0.8.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nSearching for pycparser==2.22\nBest match: pycparser 2.22\nAdding pycparser 2.22 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages\nFinished processing dependencies for Orange3==3.37.0.dev0+fb238eb\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.8\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 163ms\nPrepared 18 packages in 1ms\nInstalled 18 packages in 167ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and all of:\n          pandas>=1.4.0,<=1.4.4\n          pandas>=1.5.1,<=1.5.3\n          pandas>=2.0.1,<=2.0.3\n      depend on Python>=3.8, we can conclude that all of:\n          pandas>=1.4.0,<=1.4.4\n          pandas>=1.5.1,<=1.5.3\n          pandas>=2.0.1,<=2.0.3\n       cannot be used.\n      And because only the following versions of pandas are available:\n          pandas<=1.4.0\n          pandas==1.4.1\n          pandas==1.4.2\n          pandas==1.4.3\n          pandas==1.4.4\n          pandas==1.5.0\n          pandas==1.5.1\n          pandas==1.5.2\n          pandas==1.5.3\n          pandas==2.0.0\n          pandas==2.0.1\n          pandas==2.0.2\n          pandas==2.0.3\n          pandas==2.1.0\n          pandas==2.1.1\n          pandas==2.1.2\n          pandas==2.1.3\n          pandas==2.1.4\n          pandas==2.2.0\n          pandas==2.2.1\n          pandas==2.2.2\n          pandas==2.2.3\n      we can conclude that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0,<2.1.0\n       cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pandas>=2.1.0 depends on Python>=3.9, we can\n      conclude that pandas>=2.1.0 cannot be used.\n      And because we know from (1) that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0,<2.1.0\n       cannot be used, we can conclude that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0\n       cannot be used.\n      And because you require one of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0\n      we can conclude that your requirements are unsatisfiable.\n\n      hint: Pre-releases are available for `pandas` in the requested range (e.g., 2.2.0rc0), but pre-releases weren't enabled\n      (try: `--prerelease=allow`)\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and pyqtgraph>=0.13.1,<=0.13.3 depends on\n      Python>=3.8, we can conclude that pyqtgraph>=0.13.1,<=0.13.3 cannot be used.\n      And because only the following versions of pyqtgraph are available:\n          pyqtgraph<=0.13.1\n          pyqtgraph==0.13.2\n          pyqtgraph==0.13.3\n          pyqtgraph==0.13.4\n          pyqtgraph==0.13.5\n          pyqtgraph==0.13.6\n          pyqtgraph==0.13.7\n      we can conclude that pyqtgraph>=0.13.1,<0.13.4 cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pyqtgraph>=0.13.4 depends on Python>=3.9, we\n      can conclude that pyqtgraph>=0.13.4 cannot be used.\n      And because we know from (1) that pyqtgraph>=0.13.1,<0.13.4 cannot be used, we can conclude that pyqtgraph>=0.13.1 cannot\n      be used.\n      And because you require pyqtgraph>=0.13.1, we can conclude that your requirements are unsatisfiable.\nResolved 2 packages in 50ms\nInstalled 2 packages in 33ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 5 packages in 30ms\nInstalled 4 packages in 184ms\n + joblib==1.3.2\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + threadpoolctl==3.1.0\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/setuptools/command/easy_install.py:159: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.\n  EasyInstallDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\nerror: Couldn't find a setup script in /tmp/easy_install-8s0njyfl/scipy-1.15.0.tar.gz\nUsing CPython 3.8.20\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 15 packages in 131ms\nPrepared 15 packages in 0.97ms\nInstalled 15 packages in 94ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + iniconfig==2.0.0\n + numpy==1.24.4\n + packaging==24.2\n + pluggy==1.5.0\n + pyqt5==5.15.11\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.15.0\n + pyqtwebengine==5.15.7\n + pyqtwebengine-qt5==5.15.16\n + pytest==8.3.4\n + setuptools==75.3.0\n + tomli==2.2.1\n + wheel==0.45.1\nResolved 64 packages in 100ms\nInstalled 61 packages in 752ms\n + anyio==4.5.2\n + backports-tarfile==1.2.0\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + catboost==1.2.7\n + certifi==2024.12.14\n + cffi==1.17.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + contourpy==1.1.1\n + cryptography==44.0.0\n + cycler==0.12.1\n + et-xmlfile==2.0.0\n + fonttools==4.55.3\n + graphviz==0.20.3\n + h11==0.14.0\n + httpcore==1.0.7\n + httpx==0.28.1\n + idna==3.10\n + importlib-metadata==8.5.0\n + importlib-resources==6.4.5\n + jaraco-classes==3.4.0\n + jaraco-context==6.0.1\n + jaraco-functools==4.1.0\n + jeepney==0.8.0\n + joblib==1.4.2\n + keyring==25.5.0\n + keyrings-alt==5.0.2\n + kiwisolver==1.4.7\n + matplotlib==3.7.5\n + more-itertools==10.5.0\n + networkx==3.1\n + nvidia-nccl-cu12==2.24.3\n + openpyxl==3.1.5\n + opentsne==1.0.1\n + pandas==2.0.3\n + pillow==10.4.0\n + pip==24.3.1\n + plotly==5.24.1\n + pycparser==2.22\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.2\n + requests==2.32.3\n + scikit-learn==1.3.2\n + scipy==1.10.1\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + tenacity==9.0.0\n + threadpoolctl==3.5.0\n + typing-extensions==4.12.2\n + tzdata==2024.2\n + urllib3==2.2.3\n + xgboost==2.1.3\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\n + zipp==3.20.2\nResolved 63 packages in 121ms\nInstalled 41 packages in 103ms\n + anyqt==0.2.0\n + asttokens==3.0.0\n + attrs==24.3.0\n + backcall==0.2.0\n + cattrs==24.1.2\n + comm==0.2.2\n + commonmark==0.9.1\n + debugpy==1.8.11\n + decorator==5.1.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + executing==2.1.0\n + ipykernel==6.29.5\n + ipython==8.12.3\n + jedi==0.19.2\n + jupyter-client==8.6.3\n + jupyter-core==5.7.2\n + matplotlib-inline==0.1.7\n + nest-asyncio==1.6.0\n + orange-canvas-core==0.2.2\n + orange-widget-base==4.24.0\n + parso==0.8.4\n + pexpect==4.9.0\n + pickleshare==0.7.5\n + platformdirs==4.3.6\n + prompt-toolkit==3.0.48\n + psutil==6.1.1\n + ptyprocess==0.7.0\n + pure-eval==0.2.3\n + pygments==2.19.1\n + pyqtgraph==0.13.3\n + pyzmq==26.2.0\n + qasync==0.27.1\n + qtconsole==5.6.1\n + qtpy==2.4.2\n + requests-cache==1.2.1\n + stack-data==0.6.3\n + tornado==6.4.2\n + traitlets==5.14.3\n + url-normalize==1.4.3\n + wcwidth==0.2.13\nResolved 2 packages in 2ms\nInstalled 2 packages in 4ms\n + psycopg2==2.9.10\n + pymssql==2.3.2\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` and ``easy_install``.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://github.com/pypa/setuptools/issues/917 for details.\n        ********************************************************************************\n\n!!\n  easy_install.initialize_options(self)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a/.venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` directly.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.\n        ********************************************************************************\n\n!!\n  self.initialize_options()\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 0,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 28 items\n\nr2e_tests/test_1.py sss....sss..                                         [ 42%]\nr2e_tests/test_2.py sss.............                                     [100%]\n\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestUtils::test_details\nPASSED r2e_tests/test_1.py::TestUtils::test_multiple_summaries\nPASSED r2e_tests/test_1.py::TestSummarize::test_summarize_lazy_table\nPASSED r2e_tests/test_1.py::TestSummarize::test_summarize_table\nPASSED r2e_tests/test_1.py::TestSummarizeMatrix::test_summarize_matrix\nPASSED r2e_tests/test_1.py::TestSummarizeMatrix::test_summarize_matrix_empty\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_choose_label\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_context_attribute\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_empty_matrix\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_image_export\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_labels\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_migrate_settings_v1_and_use_them\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_minimum_size\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_non_square_labels\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_num_meta_labels_w_nan\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_set_distances\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_square_settings\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_unconditional_commit_on_new_signal\nSKIPPED [3] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\n======================== 19 passed, 9 skipped in 4.39s =========================\nWidgets left: 0    Max widgets: 994 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fb238eb93c537ec9adaec28674ffda5be7d8df8a\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 28 items\n\nr2e_tests/test_1.py sss....sss.F                                         [ 42%]\nr2e_tests/test_2.py sss..F..........                                     [100%]\n\n=================================== FAILURES ===================================\n_______________ TestSummarizeMatrix.test_summarize_matrix_empty ________________\n\nself = <r2e_tests.test_1.TestSummarizeMatrix testMethod=test_summarize_matrix_empty>\n\n    def test_summarize_matrix_empty(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n        summary = summarize_matrix(matrix)\n        self.assertEqual(summary.summary, \"0×0\")\n        self.assertEqual(summary.details, \"<nobr>0×0 distance matrix</nobr>\")\n>       view = summary.preview_func()\n\nr2e_tests/test_1.py:334: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/utils/state_summary.py:213: in previewer\n    model.set_data(matrix)\nOrange/widgets/utils/distmatrixmodel.py:50: in set_data\n    minc = min(0, np.min(distances))\n<__array_function__ internals>:200: in amin\n    ???\n.venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py:2946: in amin\n    return _wrapreduction(a, np.minimum, 'min', axis, None, out,\n.venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py:84: in _wrapreduction\n    return reduction(axis=axis, out=out, **passkwargs)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\na = DistMatrix([], shape=(0, 0), dtype=float64), axis = None, out = None\nkeepdims = False, initial = <no value>, where = True\n\n    def _amin(a, axis=None, out=None, keepdims=False,\n              initial=_NoValue, where=True):\n>       return umr_minimum(a, axis, None, out, keepdims, initial, where)\nE       ValueError: zero-size array to reduction operation minimum which has no identity\n\n.venv/lib/python3.8/site-packages/numpy/core/_methods.py:45: ValueError\n____________________ TestOWDistanceMatrix.test_empty_matrix ____________________\n\nself = <r2e_tests.test_2.TestOWDistanceMatrix testMethod=test_empty_matrix>\n\n    def test_empty_matrix(self):\n        matrix = DistMatrix(np.empty((0, 0)))\n>       self.send_signal(self.widget.Inputs.distances, matrix)\n\nr2e_tests/test_2.py:248: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.8/site-packages/orangewidget/tests/base.py:445: in send_signal\n    return self.send_signals([(input, value)], *args,\n.venv/lib/python3.8/site-packages/orangewidget/tests/base.py:471: in send_signals\n    self._send_signal(widget, input, value, *args)\n.venv/lib/python3.8/site-packages/orangewidget/tests/base.py:490: in _send_signal\n    notify_input_helper(input, widget, value, *args, **kwargs)\n../../../../.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/functools.py:875: in wrapper\n    return dispatch(args[0].__class__)(*args, **kw)\n.venv/lib/python3.8/site-packages/orangewidget/utils/signals.py:735: in set_input_helper\n    handler(*args)\n.venv/lib/python3.8/site-packages/orangewidget/utils/signals.py:208: in summarize_wrapper\n    method(widget, value)\nOrange/widgets/unsupervised/owdistancematrix.py:112: in set_distances\n    self.tablemodel.set_data(self.distances)\nOrange/widgets/utils/distmatrixmodel.py:50: in set_data\n    minc = min(0, np.min(distances))\n<__array_function__ internals>:200: in amin\n    ???\n.venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py:2946: in amin\n    return _wrapreduction(a, np.minimum, 'min', axis, None, out,\n.venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py:84: in _wrapreduction\n    return reduction(axis=axis, out=out, **passkwargs)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\na = DistMatrix([], shape=(0, 0), dtype=float64), axis = None, out = None\nkeepdims = False, initial = <no value>, where = True\n\n    def _amin(a, axis=None, out=None, keepdims=False,\n              initial=_NoValue, where=True):\n>       return umr_minimum(a, axis, None, out, keepdims, initial, where)\nE       ValueError: zero-size array to reduction operation minimum which has no identity\n\n.venv/lib/python3.8/site-packages/numpy/core/_methods.py:45: ValueError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestUtils::test_details\nPASSED r2e_tests/test_1.py::TestUtils::test_multiple_summaries\nPASSED r2e_tests/test_1.py::TestSummarize::test_summarize_lazy_table\nPASSED r2e_tests/test_1.py::TestSummarize::test_summarize_table\nPASSED r2e_tests/test_1.py::TestSummarizeMatrix::test_summarize_matrix\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_choose_label\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_context_attribute\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_image_export\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_labels\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_migrate_settings_v1_and_use_them\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_minimum_size\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_non_square_labels\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_num_meta_labels_w_nan\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_set_distances\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_square_settings\nPASSED r2e_tests/test_2.py::TestOWDistanceMatrix::test_unconditional_commit_on_new_signal\nSKIPPED [3] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestSummarizeMatrix::test_summarize_matrix_empty\nFAILED r2e_tests/test_2.py::TestOWDistanceMatrix::test_empty_matrix - ValueEr...\n=================== 2 failed, 17 passed, 9 skipped in 3.25s ====================\nWidgets left: 0    Max widgets: 1013 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/unsupervised/owdistancematrix.py Orange/widgets/unsupervised/tests/test_owdistancematrix.py Orange/widgets/utils/distmatrixmodel.py Orange/widgets/utils/tests/test_state_summary.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Handling Empty Distance Matrices Causes Runtime Errors

**Description:**
When an empty distance matrix is provided to the Distance Matrix widget, the application raises a runtime error instead of handling the empty input gracefully. This prevents the widget from functioning correctly when no data is available.

**Steps to Reproduce:**
Provide an empty distance matrix to the Distance Matrix widget:

```python
from Orange.misc import DistMatrix
import numpy as np

matrix = DistMatrix(np.empty((0, 0)))
widget.set_distances(matrix)
```

**Expected Behavior:**
The widget should display a message indicating that the distance matrix is empty and avoid processing further, preventing any runtime errors.

**Actual Behavior:**
A `ValueError` is raised with the message:
```
ValueError: zero-size array to reduction operation minimum which has no identity
```

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/utils/distmatrixmodel.py
from typing import NamedTuple, List, Optional, Dict, Any

import numpy as np

from AnyQt.QtWidgets import QTableView, QHeaderView
from AnyQt.QtGui import QColor, QBrush, QFont
from AnyQt.QtCore import Qt, QAbstractTableModel

from Orange.misc import DistMatrix
from Orange.widgets import gui
from Orange.widgets.utils import colorpalettes
from Orange.widgets.utils.itemdelegates import FixedFormatNumericColumnDelegate


class LabelData(NamedTuple):
    labels: Optional[List[str]] = None
    colors: Optional[np.ndarray] = None


class DistMatrixModel(QAbstractTableModel):
    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))
                         for i in range(256)])

    _diverging_brushes = np.array([
        QBrush(col) for col in
        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'
        ].qcolors])

    def __init__(self):
        super().__init__()
        self.distances: Optional[DistMatrix] = None
        self.colors: Optional[np.ndarray] = None
        self.brushes: Optional[np.ndarray] = None
        self.__header_data: Dict[Any, Optional[LabelData]] = {
            Qt.Horizontal: LabelData(),
            Qt.Vertical: LabelData()}
        self.__zero_diag: bool = True
        self.__span: Optional[float] = None

        self.__header_font = QFont()
        self.__header_font.setBold(True)

    def set_data(self, distances):
        self.beginResetModel()
        self.distances = distances
        self.__header_data = dict.fromkeys(self.__header_data, LabelData())
        if distances is None:
            self.__span = self.colors = self.brushes = None
            return
        minc = min(0, np.min(distances))
        maxc = np.max(distances)
        if minc < 0:
            self.__span = max(-minc, maxc)
            self.brushes = self._diverging_brushes
            self.colors = 127 + (distances / self.__span * 128).astype(int)
        else:
            self.__span = maxc
            self.brushes = self._brushes
            self.colors = (distances / self.__span * 255).astype(int)

        self.__zero_diag = \
            distances.is_symmetric() and np.allclose(np.diag(distances), 0)
        self.endResetModel()

    def set_labels(self, orientation, labels: Optional[List[str]],
                   colors: Optional[np.ndarray] = None):
        self.__header_data[orientation] = LabelData(labels, colors)
        rc, cc = self.rowCount() - 1, self.columnCount() - 1
        self.headerDataChanged.emit(
            orientation, 0, rc if orientation == Qt.Vertical else cc)
        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))

    def rowCount(self, parent=None):
        if parent and parent.isValid() or self.distances is None:
            return 0
        return self.distances.shape[0]

    def columnCount(self, parent=None):
        if parent and parent.isValid() or self.distances is None:
            return 0
        return self.distances.shape[1]

    def data(self, index, role=Qt.DisplayRole):
        if role == Qt.TextAlignmentRole:
            return Qt.AlignCenter | Qt.AlignVCenter
        if self.distances is None:
            return None

        row, col = index.row(), index.column()
        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):
            return float(self.distances[row, col])
        if role == Qt.BackgroundRole:
            return self.brushes[self.colors[row, col]]
        if role == Qt.ForegroundRole:
            return QColor(Qt.black)  # the background is light-ish
        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:
            return 0., self.__span
        return None

    def headerData(self, ind, orientation, role):
        if role == Qt.FontRole:
            return self.__header_font

        __header_data = self.__header_data[orientation]
        if role == Qt.DisplayRole:
            if __header_data.labels is not None \
                    and ind < len(__header_data.labels):
                return __header_data.labels[ind]

        colors = self.__header_data[orientation].colors
        if colors is not None:
            color = colors[ind].lighter(150)
            if role == Qt.BackgroundRole:
                return QBrush(color)
            if role == Qt.ForegroundRole:
                return QColor(Qt.black if color.value() > 128 else Qt.white)
        return None


class DistMatrixView(gui.HScrollStepMixin, QTableView):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.setWordWrap(False)
        self.setTextElideMode(Qt.ElideNone)
        self.setEditTriggers(QTableView.NoEditTriggers)
        self.setItemDelegate(
            FixedFormatNumericColumnDelegate(
                roles=(Qt.DisplayRole, Qt.BackgroundRole, Qt.ForegroundRole,
                       Qt.TextAlignmentRole)))
        for header in (self.horizontalHeader(), self.verticalHeader()):
            header.setResizeContentsPrecision(1)
            header.setSectionResizeMode(QHeaderView.ResizeToContents)
            header.setHighlightSections(True)
            header.setSectionsClickable(False)
        self.verticalHeader().setDefaultAlignment(
            Qt.AlignRight | Qt.AlignVCenter)


### Orange/widgets/unsupervised/owdistancematrix.py
import itertools
import logging
from functools import partial

from AnyQt.QtWidgets import QTableView
from AnyQt.QtCore import Qt, QSize, QItemSelection, QItemSelectionRange

from Orange.data import Table, Variable, StringVariable
from Orange.misc import DistMatrix
from Orange.widgets.utils.distmatrixmodel import \
    DistMatrixModel, DistMatrixView
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting, ContextSetting, ContextHandler
from Orange.widgets.utils.itemmodels import VariableListModel
from Orange.widgets.utils.itemselectionmodel import SymmetricSelectionModel, \
    BlockSelectionModel, selection_blocks, ranges
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output

log = logging.getLogger(__name__)


class DistanceMatrixContextHandler(ContextHandler):
    @staticmethod
    def _var_names(annotations):
        return [a.name if isinstance(a, Variable) else a for a in annotations]

    # pylint: disable=arguments-differ
    def new_context(self, matrix, annotations):
        context = super().new_context()
        context.shape = matrix.shape
        context.symmetric = matrix.is_symmetric()
        context.annotations = self._var_names(annotations)
        context.annotation = context.annotations[1]
        context.selection = [] if context.symmetric else ([], [])
        return context

    # pylint: disable=arguments-differ
    def match(self, context, matrix, annotations):
        annotations = self._var_names(annotations)
        if context.shape != matrix.shape \
                or context.symmetric is not matrix.is_symmetric() \
                or context.annotation not in annotations:
            return 0
        return 1 + (context.annotations == annotations)

    def settings_from_widget(self, widget, *args):
        # pylint: disable=protected-access
        context = widget.current_context
        if context is not None:
            context.annotation = widget.annot_combo.currentText()
            context.selection, _ = widget._get_selection()

    def settings_to_widget(self, widget, *args):
        # pylint: disable=protected-access
        context = widget.current_context
        widget.annotation_idx = context.annotations.index(context.annotation)
        widget._set_selection(context.selection)


class OWDistanceMatrix(widget.OWWidget):
    name = "Distance Matrix"
    description = "View distance matrix."
    icon = "icons/DistanceMatrix.svg"
    priority = 200
    keywords = "distance matrix"

    class Inputs:
        distances = Input("Distances", DistMatrix)

    class Outputs:
        distances = Output("Distances", DistMatrix, dynamic=False)
        table = Output("Selected Data", Table, replaces=["Table"])

    settingsHandler = DistanceMatrixContextHandler()
    settings_version = 2
    auto_commit = Setting(True)
    annotation_idx = ContextSetting(1)
    selection = ContextSetting([])

    want_control_area = True
    want_main_area = False

    def __init__(self):
        super().__init__()
        self.distances = None
        self.items = None

        self.tablemodel = DistMatrixModel()
        view = self.tableview = DistMatrixView()
        view.setModel(self.tablemodel)
        view.setSelectionBehavior(QTableView.SelectItems)
        self.controlArea.layout().addWidget(view)

        self.annot_combo = gui.comboBox(
            self.buttonsArea, self, "annotation_idx", label="Labels: ",
            orientation=Qt.Horizontal,
            callback=self._invalidate_annotations, contentsLength=12)
        self.annot_combo.setModel(VariableListModel())
        self.annot_combo.model()[:] = ["None", "Enumeration"]
        gui.rubber(self.buttonsArea)
        acb = gui.auto_send(self.buttonsArea, self, "auto_commit", box=False)
        acb.setFixedWidth(200)

    def sizeHint(self):
        return QSize(800, 500)

    @Inputs.distances
    def set_distances(self, distances):
        self.closeContext()
        self.distances = distances
        self.tablemodel.set_data(self.distances)
        self.items = None

        annotations = ["None", "Enumerate"]
        view = self.tableview

        if distances is not None:
            pending_idx = 1

            if not distances.is_symmetric():
                seltype = BlockSelectionModel
                if distances.row_items is not None \
                        or distances.col_items is not None:
                    annotations.append("Labels")
                    pending_idx = 2
            else:
                seltype = SymmetricSelectionModel
                self.items = items = distances.row_items

                if items and not distances.axis:
                    annotations.append("Attribute names")
                    pending_idx = 2
                elif isinstance(items, list) and \
                        all(isinstance(item, Variable) for item in items):
                    annotations.append("Name")
                    pending_idx = 2
                elif isinstance(items, Table):
                    annotations.extend(
                        itertools.chain(items.domain.variables, items.domain.metas))
                    pending_idx = annotations.index(self._choose_label(items))

            selmodel = seltype(view.model(), view)
            selmodel.selectionChanged.connect(self.commit.deferred)
            view.setSelectionModel(selmodel)
        else:
            pending_idx = 0
            view.selectionModel().clear()

        self.annot_combo.model()[:] = annotations
        self.annotation_idx = pending_idx
        if distances is not None:
            self.openContext(distances, annotations)
        self._update_labels()
        view.resizeColumnsToContents()
        self.commit.now()

    @staticmethod
    def _choose_label(data: Table):
        attr = max((attr for attr in data.domain.metas
                    if isinstance(attr, StringVariable)),
                   key=lambda x: len(set(data.get_column(x))),
                   default=None)
        return attr or data.domain.class_var or "Enumerate"

    def _invalidate_annotations(self):
        if self.distances is not None:
            self._update_labels()

    def _update_labels(self):
        def enumeration(n):
            return [str(i + 1) for i in range(n)]

        hor_labels = ver_labels = None
        colors = None

        if self.annotation_idx == 0:
            pass

        elif self.annotation_idx == 1:
            ver_labels, hor_labels = map(enumeration, self.distances.shape)

        elif self.annot_combo.model()[self.annotation_idx] == "Attribute names":
            attr = self.distances.row_items.domain.attributes
            ver_labels = hor_labels = [
                str(attr[i]) for i in range(self.distances.shape[0])]

        elif self.annot_combo.model()[self.annotation_idx] == "Labels":
            if self.distances.col_items is not None:
                hor_labels = [
                    str(x)
                    for x in self.distances.get_labels(self.distances.col_items)]
            else:
                hor_labels = enumeration(self.distances.shape[1])
            if self.distances.row_items is not None:
                ver_labels = [
                    str(x)
                    for x in self.distances.get_labels(self.distances.row_items)]
            else:
                ver_labels = enumeration(self.distances.shape[0])

        elif self.annotation_idx == 2 and \
                isinstance(self.items, widget.AttributeList):
            ver_labels = hor_labels = [v.name for v in self.items]

        elif isinstance(self.items, Table):
            var = self.annot_combo.model()[self.annotation_idx]
            column = self.items.get_column(var)
            if var.is_primitive():
                colors = var.palette.values_to_qcolors(column)
            ver_labels = hor_labels = [var.str_val(value) for value in column]

        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),
                               (self.tableview.verticalHeader(), ver_labels)):
            self.tablemodel.set_labels(header.orientation(), labels, colors)
            if labels is None:
                header.hide()
            else:
                header.show()
        self.tableview.resizeColumnsToContents()

    @gui.deferred
    def commit(self):
        sub_table = sub_distances = None
        if self.distances is not None:
            inds, symmetric = self._get_selection()
            if symmetric:
                if inds:
                    sub_distances = self.distances.submatrix(inds)
                    if self.distances.axis and isinstance(self.items, Table):
                        sub_table = self.items[inds]
            elif all(inds):
                sub_distances = self.distances.submatrix(*inds)
        self.Outputs.distances.send(sub_distances)
        self.Outputs.table.send(sub_table)

    def _get_selection(self):
        selmodel = self.tableview.selectionModel()
        if isinstance(selmodel, SymmetricSelectionModel):
            return self.tableview.selectionModel().selectedItems(), True
        else:
            row_spans, col_spans = selection_blocks(selmodel.selection())
            rows = list(itertools.chain.from_iterable(
                itertools.starmap(range, row_spans)))
            cols = list(itertools.chain.from_iterable(
                itertools.starmap(range, col_spans)))
            return (rows, cols), False

    def _set_selection(self, selection):
        selmodel = self.tableview.selectionModel()
        if isinstance(selmodel, SymmetricSelectionModel):
            if not isinstance(selection, list):
                log.error("wrong data for symmetric selection")
                return
            selmodel.setSelectedItems(selection)
        else:
            if not isinstance(selection, tuple) and len(selection) == 2:
                log.error("wrong data for asymmetric selection")
                return
            rows, cols = selection
            selection = QItemSelection()
            rowranges = list(ranges(rows))
            colranges = list(ranges(cols))

            index = self.tablemodel.index
            for rowstart, rowend in rowranges:
                for colstart, colend in colranges:
                    selection.append(
                        QItemSelectionRange(
                            index(rowstart, colstart),
                            index(rowend - 1, colend - 1)
                        )
                    )
            selmodel.select(selection, selmodel.ClearAndSelect)

    def send_report(self):
        if self.distances is None:
            return
        model = self.tablemodel
        index = model.index
        ndec = self.tableview.itemDelegate().ndecimals
        header = model.headerData
        h, w = self.distances.shape

        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))
        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))

        def cell(func, num):
            label, brush = (func(role)
                            for role in (Qt.DisplayRole, Qt.BackgroundRole))
            if brush:
                style = f' style="background-color: {brush.color().name()}"'
            else:
                style = ""
            label = "" if label is None else f"{label:.{ndec}f}" if num else label
            self.report_raw(f"<td {style}>{label}</td>\n")

        self.report_raw('<table style="border-collapse:collapse">')
        if hor_header:
            self.report_raw("<tr>")
            if ver_header:
                self.report_raw("<td></td>")
            for col in range(w):
                cell(partial(header, col, Qt.Horizontal), False)
            self.report_raw("</tr>")

        for row in range(h):
            self.report_raw("<tr>")
            if ver_header:
                cell(partial(header, row, Qt.Vertical), False)
            for col in range(w):
                cell(index(row, col).data, True)
            self.report_raw("</tr>")
        self.report_raw("</table>")

    @classmethod
    def migrate_context(cls, context, version):
        if version < 2:
            context.shape = (context.dim, context.dim)
            context.symmetric = True


if __name__ == "__main__":  # pragma: no cover
    import Orange.distance
    data = Orange.data.Table("zoo")
    dist = Orange.distance.Euclidean(data)
    # dist = DistMatrix([[1, 2, 3], [4, 5, 6]])
    # dist.row_items = DistMatrix._labels_to_tables(["aa", "bb"])
    # dist.col_items = DistMatrix._labels_to_tables(["cc", "dd", "ee"])
    WidgetPreview(OWDistanceMatrix).run(dist)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
[ISSUE]
**Title:** Handling Empty Distance Matrices Causes Runtime Errors

**Description:**
When an empty distance matrix is provided to the Distance Matrix widget, the application raises a runtime error instead of handling the empty input gracefully. This prevents the widget from functioning correctly when no data is available.

**Steps to Reproduce:**
Provide an empty distance matrix to the Distance Matrix widget:

```python
from Orange.misc import DistMatrix
import numpy as np

matrix = DistMatrix(np.empty((0, 0)))
widget.set_distances(matrix)
```

**Expected Behavior:**
The widget should display a message indicating that the distance matrix is empty and avoid processing further, preventing any runtime errors.

**Actual Behavior:**
A `ValueError` is raised with the message:
```
ValueError: zero-size array to reduction operation minimum which has no identity
```

[/ISSUE]
{
    "TestUtils.test_details": "PASSED",
    "TestUtils.test_multiple_summaries": "PASSED",
    "TestSummarize.test_summarize_lazy_table": "PASSED",
    "TestSummarize.test_summarize_table": "PASSED",
    "TestSummarizeMatrix.test_summarize_matrix": "PASSED",
    "TestSummarizeMatrix.test_summarize_matrix_empty": "PASSED",
    "TestOWDistanceMatrix.test_choose_label": "PASSED",
    "TestOWDistanceMatrix.test_context_attribute": "PASSED",
    "TestOWDistanceMatrix.test_empty_matrix": "PASSED",
    "TestOWDistanceMatrix.test_image_export": "PASSED",
    "TestOWDistanceMatrix.test_labels": "PASSED",
    "TestOWDistanceMatrix.test_migrate_settings_v1_and_use_them": "PASSED",
    "TestOWDistanceMatrix.test_minimum_size": "PASSED",
    "TestOWDistanceMatrix.test_msg_base_class": "PASSED",
    "TestOWDistanceMatrix.test_non_square_labels": "PASSED",
    "TestOWDistanceMatrix.test_num_meta_labels_w_nan": "PASSED",
    "TestOWDistanceMatrix.test_set_distances": "PASSED",
    "TestOWDistanceMatrix.test_square_settings": "PASSED",
    "TestOWDistanceMatrix.test_unconditional_commit_on_new_signal": "PASSED"
}
diff --git a/Orange/widgets/unsupervised/owdistancematrix.py b/Orange/widgets/unsupervised/owdistancematrix.py
index 5edd2215f..e9e5c6ca1 100644
--- a/Orange/widgets/unsupervised/owdistancematrix.py
+++ b/Orange/widgets/unsupervised/owdistancematrix.py
@@ -72,6 +72,9 @@ class OWDistanceMatrix(widget.OWWidget):
         distances = Output("Distances", DistMatrix, dynamic=False)
         table = Output("Selected Data", Table, replaces=["Table"])
 
+    class Error(widget.OWWidget.Error):
+        empty_matrix = widget.Msg("Distance matrix is empty.")
+
     settingsHandler = DistanceMatrixContextHandler()
     settings_version = 2
     auto_commit = Setting(True)
@@ -107,7 +110,12 @@ class OWDistanceMatrix(widget.OWWidget):
 
     @Inputs.distances
     def set_distances(self, distances):
+        self.clear_messages()
         self.closeContext()
+        if distances is not None:
+            if len(distances) == 0:
+                distances = None
+                self.Error.empty_matrix()
         self.distances = distances
         self.tablemodel.set_data(self.distances)
         self.items = None
diff --git a/Orange/widgets/utils/distmatrixmodel.py b/Orange/widgets/utils/distmatrixmodel.py
index b3b971a58..bfd66085e 100644
--- a/Orange/widgets/utils/distmatrixmodel.py
+++ b/Orange/widgets/utils/distmatrixmodel.py
@@ -44,7 +44,7 @@ class DistMatrixModel(QAbstractTableModel):
         self.beginResetModel()
         self.distances = distances
         self.__header_data = dict.fromkeys(self.__header_data, LabelData())
-        if distances is None:
+        if distances is None or len(distances) == 0:
             self.__span = self.colors = self.brushes = None
             return
         minc = min(0, np.min(distances))

{"Orange/widgets/unsupervised/owdistancematrix.py": "import itertools\nimport logging\nfrom functools import partial\n\nfrom AnyQt.QtWidgets import QTableView\nfrom AnyQt.QtCore import Qt, QSize, QItemSelection, QItemSelectionRange\n\nfrom Orange.data import Table, Variable, StringVariable\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets.utils.distmatrixmodel import \\\n    DistMatrixModel, DistMatrixView\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.settings import Setting, ContextSetting, ContextHandler\nfrom Orange.widgets.utils.itemmodels import VariableListModel\nfrom Orange.widgets.utils.itemselectionmodel import SymmetricSelectionModel, \\\n    BlockSelectionModel, selection_blocks, ranges\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\nlog = logging.getLogger(__name__)\n\n\nclass DistanceMatrixContextHandler(ContextHandler):\n    @staticmethod\n    def _var_names(annotations):\n        return [a.name if isinstance(a, Variable) else a for a in annotations]\n\n    # pylint: disable=arguments-differ\n    def new_context(self, matrix, annotations):\n        context = super().new_context()\n        context.shape = matrix.shape\n        context.symmetric = matrix.is_symmetric()\n        context.annotations = self._var_names(annotations)\n        context.annotation = context.annotations[1]\n        context.selection = [] if context.symmetric else ([], [])\n        return context\n\n    # pylint: disable=arguments-differ\n    def match(self, context, matrix, annotations):\n        annotations = self._var_names(annotations)\n        if context.shape != matrix.shape \\\n                or context.symmetric is not matrix.is_symmetric() \\\n                or context.annotation not in annotations:\n            return 0\n        return 1 + (context.annotations == annotations)\n\n    def settings_from_widget(self, widget, *args):\n        # pylint: disable=protected-access\n        context = widget.current_context\n        if context is not None:\n            context.annotation = widget.annot_combo.currentText()\n            context.selection, _ = widget._get_selection()\n\n    def settings_to_widget(self, widget, *args):\n        # pylint: disable=protected-access\n        context = widget.current_context\n        widget.annotation_idx = context.annotations.index(context.annotation)\n        widget._set_selection(context.selection)\n\n\nclass OWDistanceMatrix(widget.OWWidget):\n    name = \"Distance Matrix\"\n    description = \"View distance matrix.\"\n    icon = \"icons/DistanceMatrix.svg\"\n    priority = 200\n    keywords = \"distance matrix\"\n\n    class Inputs:\n        distances = Input(\"Distances\", DistMatrix)\n\n    class Outputs:\n        distances = Output(\"Distances\", DistMatrix, dynamic=False)\n        table = Output(\"Selected Data\", Table, replaces=[\"Table\"])\n\n    settingsHandler = DistanceMatrixContextHandler()\n    settings_version = 2\n    auto_commit = Setting(True)\n    annotation_idx = ContextSetting(1)\n    selection = ContextSetting([])\n\n    want_control_area = True\n    want_main_area = False\n\n    def __init__(self):\n        super().__init__()\n        self.distances = None\n        self.items = None\n\n        self.tablemodel = DistMatrixModel()\n        view = self.tableview = DistMatrixView()\n        view.setModel(self.tablemodel)\n        view.setSelectionBehavior(QTableView.SelectItems)\n        self.controlArea.layout().addWidget(view)\n\n        self.annot_combo = gui.comboBox(\n            self.buttonsArea, self, \"annotation_idx\", label=\"Labels: \",\n            orientation=Qt.Horizontal,\n            callback=self._invalidate_annotations, contentsLength=12)\n        self.annot_combo.setModel(VariableListModel())\n        self.annot_combo.model()[:] = [\"None\", \"Enumeration\"]\n        gui.rubber(self.buttonsArea)\n        acb = gui.auto_send(self.buttonsArea, self, \"auto_commit\", box=False)\n        acb.setFixedWidth(200)\n\n    def sizeHint(self):\n        return QSize(800, 500)\n\n    @Inputs.distances\n    def set_distances(self, distances):\n        self.closeContext()\n        self.distances = distances\n        self.tablemodel.set_data(self.distances)\n        self.items = None\n\n        annotations = [\"None\", \"Enumerate\"]\n        view = self.tableview\n\n        if distances is not None:\n            pending_idx = 1\n\n            if not distances.is_symmetric():\n                seltype = BlockSelectionModel\n                if distances.row_items is not None \\\n                        or distances.col_items is not None:\n                    annotations.append(\"Labels\")\n                    pending_idx = 2\n            else:\n                seltype = SymmetricSelectionModel\n                self.items = items = distances.row_items\n\n                if items and not distances.axis:\n                    annotations.append(\"Attribute names\")\n                    pending_idx = 2\n                elif isinstance(items, list) and \\\n                        all(isinstance(item, Variable) for item in items):\n                    annotations.append(\"Name\")\n                    pending_idx = 2\n                elif isinstance(items, Table):\n                    annotations.extend(\n                        itertools.chain(items.domain.variables, items.domain.metas))\n                    pending_idx = annotations.index(self._choose_label(items))\n\n            selmodel = seltype(view.model(), view)\n            selmodel.selectionChanged.connect(self.commit.deferred)\n            view.setSelectionModel(selmodel)\n        else:\n            pending_idx = 0\n            view.selectionModel().clear()\n\n        self.annot_combo.model()[:] = annotations\n        self.annotation_idx = pending_idx\n        if distances is not None:\n            self.openContext(distances, annotations)\n        self._update_labels()\n        view.resizeColumnsToContents()\n        self.commit.now()\n\n    @staticmethod\n    def _choose_label(data: Table):\n        attr = max((attr for attr in data.domain.metas\n                    if isinstance(attr, StringVariable)),\n                   key=lambda x: len(set(data.get_column(x))),\n                   default=None)\n        return attr or data.domain.class_var or \"Enumerate\"\n\n    def _invalidate_annotations(self):\n        if self.distances is not None:\n            self._update_labels()\n\n    def _update_labels(self):\n        def enumeration(n):\n            return [str(i + 1) for i in range(n)]\n\n        hor_labels = ver_labels = None\n        colors = None\n\n        if self.annotation_idx == 0:\n            pass\n\n        elif self.annotation_idx == 1:\n            ver_labels, hor_labels = map(enumeration, self.distances.shape)\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Attribute names\":\n            attr = self.distances.row_items.domain.attributes\n            ver_labels = hor_labels = [\n                str(attr[i]) for i in range(self.distances.shape[0])]\n\n        elif self.annot_combo.model()[self.annotation_idx] == \"Labels\":\n            if self.distances.col_items is not None:\n                hor_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.col_items)]\n            else:\n                hor_labels = enumeration(self.distances.shape[1])\n            if self.distances.row_items is not None:\n                ver_labels = [\n                    str(x)\n                    for x in self.distances.get_labels(self.distances.row_items)]\n            else:\n                ver_labels = enumeration(self.distances.shape[0])\n\n        elif self.annotation_idx == 2 and \\\n                isinstance(self.items, widget.AttributeList):\n            ver_labels = hor_labels = [v.name for v in self.items]\n\n        elif isinstance(self.items, Table):\n            var = self.annot_combo.model()[self.annotation_idx]\n            column = self.items.get_column(var)\n            if var.is_primitive():\n                colors = var.palette.values_to_qcolors(column)\n            ver_labels = hor_labels = [var.str_val(value) for value in column]\n\n        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),\n                               (self.tableview.verticalHeader(), ver_labels)):\n            self.tablemodel.set_labels(header.orientation(), labels, colors)\n            if labels is None:\n                header.hide()\n            else:\n                header.show()\n        self.tableview.resizeColumnsToContents()\n\n    @gui.deferred\n    def commit(self):\n        sub_table = sub_distances = None\n        if self.distances is not None:\n            inds, symmetric = self._get_selection()\n            if symmetric:\n                if inds:\n                    sub_distances = self.distances.submatrix(inds)\n                    if self.distances.axis and isinstance(self.items, Table):\n                        sub_table = self.items[inds]\n            elif all(inds):\n                sub_distances = self.distances.submatrix(*inds)\n        self.Outputs.distances.send(sub_distances)\n        self.Outputs.table.send(sub_table)\n\n    def _get_selection(self):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            return self.tableview.selectionModel().selectedItems(), True\n        else:\n            row_spans, col_spans = selection_blocks(selmodel.selection())\n            rows = list(itertools.chain.from_iterable(\n                itertools.starmap(range, row_spans)))\n            cols = list(itertools.chain.from_iterable(\n                itertools.starmap(range, col_spans)))\n            return (rows, cols), False\n\n    def _set_selection(self, selection):\n        selmodel = self.tableview.selectionModel()\n        if isinstance(selmodel, SymmetricSelectionModel):\n            if not isinstance(selection, list):\n                log.error(\"wrong data for symmetric selection\")\n                return\n            selmodel.setSelectedItems(selection)\n        else:\n            if not isinstance(selection, tuple) and len(selection) == 2:\n                log.error(\"wrong data for asymmetric selection\")\n                return\n            rows, cols = selection\n            selection = QItemSelection()\n            rowranges = list(ranges(rows))\n            colranges = list(ranges(cols))\n\n            index = self.tablemodel.index\n            for rowstart, rowend in rowranges:\n                for colstart, colend in colranges:\n                    selection.append(\n                        QItemSelectionRange(\n                            index(rowstart, colstart),\n                            index(rowend - 1, colend - 1)\n                        )\n                    )\n            selmodel.select(selection, selmodel.ClearAndSelect)\n\n    def send_report(self):\n        if self.distances is None:\n            return\n        model = self.tablemodel\n        index = model.index\n        ndec = self.tableview.itemDelegate().ndecimals\n        header = model.headerData\n        h, w = self.distances.shape\n\n        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))\n        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))\n\n        def cell(func, num):\n            label, brush = (func(role)\n                            for role in (Qt.DisplayRole, Qt.BackgroundRole))\n            if brush:\n                style = f' style=\"background-color: {brush.color().name()}\"'\n            else:\n                style = \"\"\n            label = \"\" if label is None else f\"{label:.{ndec}f}\" if num else label\n            self.report_raw(f\"<td {style}>{label}</td>\\n\")\n\n        self.report_raw('<table style=\"border-collapse:collapse\">')\n        if hor_header:\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                self.report_raw(\"<td></td>\")\n            for col in range(w):\n                cell(partial(header, col, Qt.Horizontal), False)\n            self.report_raw(\"</tr>\")\n\n        for row in range(h):\n            self.report_raw(\"<tr>\")\n            if ver_header:\n                cell(partial(header, row, Qt.Vertical), False)\n            for col in range(w):\n                cell(index(row, col).data, True)\n            self.report_raw(\"</tr>\")\n        self.report_raw(\"</table>\")\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 2:\n            context.shape = (context.dim, context.dim)\n            context.symmetric = True\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    import Orange.distance\n    data = Orange.data.Table(\"zoo\")\n    dist = Orange.distance.Euclidean(data)\n    # dist = DistMatrix([[1, 2, 3], [4, 5, 6]])\n    # dist.row_items = DistMatrix._labels_to_tables([\"aa\", \"bb\"])\n    # dist.col_items = DistMatrix._labels_to_tables([\"cc\", \"dd\", \"ee\"])\n    WidgetPreview(OWDistanceMatrix).run(dist)\n", "Orange/widgets/utils/distmatrixmodel.py": "from typing import NamedTuple, List, Optional, Dict, Any\n\nimport numpy as np\n\nfrom AnyQt.QtWidgets import QTableView, QHeaderView\nfrom AnyQt.QtGui import QColor, QBrush, QFont\nfrom AnyQt.QtCore import Qt, QAbstractTableModel\n\nfrom Orange.misc import DistMatrix\nfrom Orange.widgets import gui\nfrom Orange.widgets.utils import colorpalettes\nfrom Orange.widgets.utils.itemdelegates import FixedFormatNumericColumnDelegate\n\n\nclass LabelData(NamedTuple):\n    labels: Optional[List[str]] = None\n    colors: Optional[np.ndarray] = None\n\n\nclass DistMatrixModel(QAbstractTableModel):\n    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))\n                         for i in range(256)])\n\n    _diverging_brushes = np.array([\n        QBrush(col) for col in\n        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'\n        ].qcolors])\n\n    def __init__(self):\n        super().__init__()\n        self.distances: Optional[DistMatrix] = None\n        self.colors: Optional[np.ndarray] = None\n        self.brushes: Optional[np.ndarray] = None\n        self.__header_data: Dict[Any, Optional[LabelData]] = {\n            Qt.Horizontal: LabelData(),\n            Qt.Vertical: LabelData()}\n        self.__zero_diag: bool = True\n        self.__span: Optional[float] = None\n\n        self.__header_font = QFont()\n        self.__header_font.setBold(True)\n\n    def set_data(self, distances):\n        self.beginResetModel()\n        self.distances = distances\n        self.__header_data = dict.fromkeys(self.__header_data, LabelData())\n        if distances is None:\n            self.__span = self.colors = self.brushes = None\n            return\n        minc = min(0, np.min(distances))\n        maxc = np.max(distances)\n        if minc < 0:\n            self.__span = max(-minc, maxc)\n            self.brushes = self._diverging_brushes\n            self.colors = 127 + (distances / self.__span * 128).astype(int)\n        else:\n            self.__span = maxc\n            self.brushes = self._brushes\n            self.colors = (distances / self.__span * 255).astype(int)\n\n        self.__zero_diag = \\\n            distances.is_symmetric() and np.allclose(np.diag(distances), 0)\n        self.endResetModel()\n\n    def set_labels(self, orientation, labels: Optional[List[str]],\n                   colors: Optional[np.ndarray] = None):\n        self.__header_data[orientation] = LabelData(labels, colors)\n        rc, cc = self.rowCount() - 1, self.columnCount() - 1\n        self.headerDataChanged.emit(\n            orientation, 0, rc if orientation == Qt.Vertical else cc)\n        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))\n\n    def rowCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[0]\n\n    def columnCount(self, parent=None):\n        if parent and parent.isValid() or self.distances is None:\n            return 0\n        return self.distances.shape[1]\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.TextAlignmentRole:\n            return Qt.AlignCenter | Qt.AlignVCenter\n        if self.distances is None:\n            return None\n\n        row, col = index.row(), index.column()\n        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):\n            return float(self.distances[row, col])\n        if role == Qt.BackgroundRole:\n            return self.brushes[self.colors[row, col]]\n        if role == Qt.ForegroundRole:\n            return QColor(Qt.black)  # the background is light-ish\n        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:\n            return 0., self.__span\n        return None\n\n    def headerData(self, ind, orientation, role):\n        if role == Qt.FontRole:\n            return self.__header_font\n\n        __header_data = self.__header_data[orientation]\n        if role == Qt.DisplayRole:\n            if __header_data.labels is not None \\\n                    and ind < len(__header_data.labels):\n                return __header_data.labels[ind]\n\n        colors = self.__header_data[orientation].colors\n        if colors is not None:\n            color = colors[ind].lighter(150)\n            if role == Qt.BackgroundRole:\n                return QBrush(color)\n            if role == Qt.ForegroundRole:\n                return QColor(Qt.black if color.value() > 128 else Qt.white)\n        return None\n\n\nclass DistMatrixView(gui.HScrollStepMixin, QTableView):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n\n        self.setWordWrap(False)\n        self.setTextElideMode(Qt.ElideNone)\n        self.setEditTriggers(QTableView.NoEditTriggers)\n        self.setItemDelegate(\n            FixedFormatNumericColumnDelegate(\n                roles=(Qt.DisplayRole, Qt.BackgroundRole, Qt.ForegroundRole,\n                       Qt.TextAlignmentRole)))\n        for header in (self.horizontalHeader(), self.verticalHeader()):\n            header.setResizeContentsPrecision(1)\n            header.setSectionResizeMode(QHeaderView.ResizeToContents)\n            header.setHighlightSections(True)\n            header.setSectionsClickable(False)\n        self.verticalHeader().setDefaultAlignment(\n            Qt.AlignRight | Qt.AlignVCenter)\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

Your response format must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct solution.
</think>
<solution>
Final solution presented to the user.
</solution>
system
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Handling Empty Distance Matrices Causes Runtime Errors

**Description:**
When an empty distance matrix is provided to the Distance Matrix widget, the application raises a runtime error instead of handling the empty input gracefully. This prevents the widget from functioning correctly when no data is available.

**Steps to Reproduce:**
Provide an empty distance matrix to the Distance Matrix widget:

```python
from Orange.misc import DistMatrix
import numpy as np

matrix = DistMatrix(np.empty((0, 0)))
widget.set_distances(matrix)
```

**Expected Behavior:**
The widget should display a message indicating that the distance matrix is empty and avoid processing further, preventing any runtime errors.

**Actual Behavior:**
A `ValueError` is raised with the message:
```
ValueError: zero-size array to reduction operation minimum which has no identity
```

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/utils/distmatrixmodel.py
from typing import NamedTuple, List, Optional, Dict, Any

import numpy as np

from AnyQt.QtWidgets import QTableView, QHeaderView
from AnyQt.QtGui import QColor, QBrush, QFont
from AnyQt.QtCore import Qt, QAbstractTableModel

from Orange.misc import DistMatrix
from Orange.widgets import gui
from Orange.widgets.utils import colorpalettes
from Orange.widgets.utils.itemdelegates import FixedFormatNumericColumnDelegate


class LabelData(NamedTuple):
    labels: Optional[List[str]] = None
    colors: Optional[np.ndarray] = None


class DistMatrixModel(QAbstractTableModel):
    _brushes = np.array([QBrush(QColor.fromHsv(120, int(i / 255 * 170), 255))
                         for i in range(256)])

    _diverging_brushes = np.array([
        QBrush(col) for col in
        colorpalettes.ContinuousPalettes['diverging_tritanopic_cwr_75_98_c20'
        ].qcolors])

    def __init__(self):
        super().__init__()
        self.distances: Optional[DistMatrix] = None
        self.colors: Optional[np.ndarray] = None
        self.brushes: Optional[np.ndarray] = None
        self.__header_data: Dict[Any, Optional[LabelData]] = {
            Qt.Horizontal: LabelData(),
            Qt.Vertical: LabelData()}
        self.__zero_diag: bool = True
        self.__span: Optional[float] = None

        self.__header_font = QFont()
        self.__header_font.setBold(True)

    def set_data(self, distances):
        self.beginResetModel()
        self.distances = distances
        self.__header_data = dict.fromkeys(self.__header_data, LabelData())
        if distances is None:
            self.__span = self.colors = self.brushes = None
            return
        minc = min(0, np.min(distances))
        maxc = np.max(distances)
        if minc < 0:
            self.__span = max(-minc, maxc)
            self.brushes = self._diverging_brushes
            self.colors = 127 + (distances / self.__span * 128).astype(int)
        else:
            self.__span = maxc
            self.brushes = self._brushes
            self.colors = (distances / self.__span * 255).astype(int)

        self.__zero_diag = \
            distances.is_symmetric() and np.allclose(np.diag(distances), 0)
        self.endResetModel()

    def set_labels(self, orientation, labels: Optional[List[str]],
                   colors: Optional[np.ndarray] = None):
        self.__header_data[orientation] = LabelData(labels, colors)
        rc, cc = self.rowCount() - 1, self.columnCount() - 1
        self.headerDataChanged.emit(
            orientation, 0, rc if orientation == Qt.Vertical else cc)
        self.dataChanged.emit(self.index(0, 0), self.index(rc, cc))

    def rowCount(self, parent=None):
        if parent and parent.isValid() or self.distances is None:
            return 0
        return self.distances.shape[0]

    def columnCount(self, parent=None):
        if parent and parent.isValid() or self.distances is None:
            return 0
        return self.distances.shape[1]

    def data(self, index, role=Qt.DisplayRole):
        if role == Qt.TextAlignmentRole:
            return Qt.AlignCenter | Qt.AlignVCenter
        if self.distances is None:
            return None

        row, col = index.row(), index.column()
        if role == Qt.DisplayRole and not (self.__zero_diag and row == col):
            return float(self.distances[row, col])
        if role == Qt.BackgroundRole:
            return self.brushes[self.colors[row, col]]
        if role == Qt.ForegroundRole:
            return QColor(Qt.black)  # the background is light-ish
        if role == FixedFormatNumericColumnDelegate.ColumnDataSpanRole:
            return 0., self.__span
        return None

    def headerData(self, ind, orientation, role):
        if role == Qt.FontRole:
            return self.__header_font

        __header_data = self.__header_data[orientation]
        if role == Qt.DisplayRole:
            if __header_data.labels is not None \
                    and ind < len(__header_data.labels):
                return __header_data.labels[ind]

        colors = self.__header_data[orientation].colors
        if colors is not None:
            color = colors[ind].lighter(150)
            if role == Qt.BackgroundRole:
                return QBrush(color)
            if role == Qt.ForegroundRole:
                return QColor(Qt.black if color.value() > 128 else Qt.white)
        return None


class DistMatrixView(gui.HScrollStepMixin, QTableView):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.setWordWrap(False)
        self.setTextElideMode(Qt.ElideNone)
        self.setEditTriggers(QTableView.NoEditTriggers)
        self.setItemDelegate(
            FixedFormatNumericColumnDelegate(
                roles=(Qt.DisplayRole, Qt.BackgroundRole, Qt.ForegroundRole,
                       Qt.TextAlignmentRole)))
        for header in (self.horizontalHeader(), self.verticalHeader()):
            header.setResizeContentsPrecision(1)
            header.setSectionResizeMode(QHeaderView.ResizeToContents)
            header.setHighlightSections(True)
            header.setSectionsClickable(False)
        self.verticalHeader().setDefaultAlignment(
            Qt.AlignRight | Qt.AlignVCenter)


### Orange/widgets/unsupervised/owdistancematrix.py
import itertools
import logging
from functools import partial

from AnyQt.QtWidgets import QTableView
from AnyQt.QtCore import Qt, QSize, QItemSelection, QItemSelectionRange

from Orange.data import Table, Variable, StringVariable
from Orange.misc import DistMatrix
from Orange.widgets.utils.distmatrixmodel import \
    DistMatrixModel, DistMatrixView
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting, ContextSetting, ContextHandler
from Orange.widgets.utils.itemmodels import VariableListModel
from Orange.widgets.utils.itemselectionmodel import SymmetricSelectionModel, \
    BlockSelectionModel, selection_blocks, ranges
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output

log = logging.getLogger(__name__)


class DistanceMatrixContextHandler(ContextHandler):
    @staticmethod
    def _var_names(annotations):
        return [a.name if isinstance(a, Variable) else a for a in annotations]

    # pylint: disable=arguments-differ
    def new_context(self, matrix, annotations):
        context = super().new_context()
        context.shape = matrix.shape
        context.symmetric = matrix.is_symmetric()
        context.annotations = self._var_names(annotations)
        context.annotation = context.annotations[1]
        context.selection = [] if context.symmetric else ([], [])
        return context

    # pylint: disable=arguments-differ
    def match(self, context, matrix, annotations):
        annotations = self._var_names(annotations)
        if context.shape != matrix.shape \
                or context.symmetric is not matrix.is_symmetric() \
                or context.annotation not in annotations:
            return 0
        return 1 + (context.annotations == annotations)

    def settings_from_widget(self, widget, *args):
        # pylint: disable=protected-access
        context = widget.current_context
        if context is not None:
            context.annotation = widget.annot_combo.currentText()
            context.selection, _ = widget._get_selection()

    def settings_to_widget(self, widget, *args):
        # pylint: disable=protected-access
        context = widget.current_context
        widget.annotation_idx = context.annotations.index(context.annotation)
        widget._set_selection(context.selection)


class OWDistanceMatrix(widget.OWWidget):
    name = "Distance Matrix"
    description = "View distance matrix."
    icon = "icons/DistanceMatrix.svg"
    priority = 200
    keywords = "distance matrix"

    class Inputs:
        distances = Input("Distances", DistMatrix)

    class Outputs:
        distances = Output("Distances", DistMatrix, dynamic=False)
        table = Output("Selected Data", Table, replaces=["Table"])

    settingsHandler = DistanceMatrixContextHandler()
    settings_version = 2
    auto_commit = Setting(True)
    annotation_idx = ContextSetting(1)
    selection = ContextSetting([])

    want_control_area = True
    want_main_area = False

    def __init__(self):
        super().__init__()
        self.distances = None
        self.items = None

        self.tablemodel = DistMatrixModel()
        view = self.tableview = DistMatrixView()
        view.setModel(self.tablemodel)
        view.setSelectionBehavior(QTableView.SelectItems)
        self.controlArea.layout().addWidget(view)

        self.annot_combo = gui.comboBox(
            self.buttonsArea, self, "annotation_idx", label="Labels: ",
            orientation=Qt.Horizontal,
            callback=self._invalidate_annotations, contentsLength=12)
        self.annot_combo.setModel(VariableListModel())
        self.annot_combo.model()[:] = ["None", "Enumeration"]
        gui.rubber(self.buttonsArea)
        acb = gui.auto_send(self.buttonsArea, self, "auto_commit", box=False)
        acb.setFixedWidth(200)

    def sizeHint(self):
        return QSize(800, 500)

    @Inputs.distances
    def set_distances(self, distances):
        self.closeContext()
        self.distances = distances
        self.tablemodel.set_data(self.distances)
        self.items = None

        annotations = ["None", "Enumerate"]
        view = self.tableview

        if distances is not None:
            pending_idx = 1

            if not distances.is_symmetric():
                seltype = BlockSelectionModel
                if distances.row_items is not None \
                        or distances.col_items is not None:
                    annotations.append("Labels")
                    pending_idx = 2
            else:
                seltype = SymmetricSelectionModel
                self.items = items = distances.row_items

                if items and not distances.axis:
                    annotations.append("Attribute names")
                    pending_idx = 2
                elif isinstance(items, list) and \
                        all(isinstance(item, Variable) for item in items):
                    annotations.append("Name")
                    pending_idx = 2
                elif isinstance(items, Table):
                    annotations.extend(
                        itertools.chain(items.domain.variables, items.domain.metas))
                    pending_idx = annotations.index(self._choose_label(items))

            selmodel = seltype(view.model(), view)
            selmodel.selectionChanged.connect(self.commit.deferred)
            view.setSelectionModel(selmodel)
        else:
            pending_idx = 0
            view.selectionModel().clear()

        self.annot_combo.model()[:] = annotations
        self.annotation_idx = pending_idx
        if distances is not None:
            self.openContext(distances, annotations)
        self._update_labels()
        view.resizeColumnsToContents()
        self.commit.now()

    @staticmethod
    def _choose_label(data: Table):
        attr = max((attr for attr in data.domain.metas
                    if isinstance(attr, StringVariable)),
                   key=lambda x: len(set(data.get_column(x))),
                   default=None)
        return attr or data.domain.class_var or "Enumerate"

    def _invalidate_annotations(self):
        if self.distances is not None:
            self._update_labels()

    def _update_labels(self):
        def enumeration(n):
            return [str(i + 1) for i in range(n)]

        hor_labels = ver_labels = None
        colors = None

        if self.annotation_idx == 0:
            pass

        elif self.annotation_idx == 1:
            ver_labels, hor_labels = map(enumeration, self.distances.shape)

        elif self.annot_combo.model()[self.annotation_idx] == "Attribute names":
            attr = self.distances.row_items.domain.attributes
            ver_labels = hor_labels = [
                str(attr[i]) for i in range(self.distances.shape[0])]

        elif self.annot_combo.model()[self.annotation_idx] == "Labels":
            if self.distances.col_items is not None:
                hor_labels = [
                    str(x)
                    for x in self.distances.get_labels(self.distances.col_items)]
            else:
                hor_labels = enumeration(self.distances.shape[1])
            if self.distances.row_items is not None:
                ver_labels = [
                    str(x)
                    for x in self.distances.get_labels(self.distances.row_items)]
            else:
                ver_labels = enumeration(self.distances.shape[0])

        elif self.annotation_idx == 2 and \
                isinstance(self.items, widget.AttributeList):
            ver_labels = hor_labels = [v.name for v in self.items]

        elif isinstance(self.items, Table):
            var = self.annot_combo.model()[self.annotation_idx]
            column = self.items.get_column(var)
            if var.is_primitive():
                colors = var.palette.values_to_qcolors(column)
            ver_labels = hor_labels = [var.str_val(value) for value in column]

        for header, labels in ((self.tableview.horizontalHeader(), hor_labels),
                               (self.tableview.verticalHeader(), ver_labels)):
            self.tablemodel.set_labels(header.orientation(), labels, colors)
            if labels is None:
                header.hide()
            else:
                header.show()
        self.tableview.resizeColumnsToContents()

    @gui.deferred
    def commit(self):
        sub_table = sub_distances = None
        if self.distances is not None:
            inds, symmetric = self._get_selection()
            if symmetric:
                if inds:
                    sub_distances = self.distances.submatrix(inds)
                    if self.distances.axis and isinstance(self.items, Table):
                        sub_table = self.items[inds]
            elif all(inds):
                sub_distances = self.distances.submatrix(*inds)
        self.Outputs.distances.send(sub_distances)
        self.Outputs.table.send(sub_table)

    def _get_selection(self):
        selmodel = self.tableview.selectionModel()
        if isinstance(selmodel, SymmetricSelectionModel):
            return self.tableview.selectionModel().selectedItems(), True
        else:
            row_spans, col_spans = selection_blocks(selmodel.selection())
            rows = list(itertools.chain.from_iterable(
                itertools.starmap(range, row_spans)))
            cols = list(itertools.chain.from_iterable(
                itertools.starmap(range, col_spans)))
            return (rows, cols), False

    def _set_selection(self, selection):
        selmodel = self.tableview.selectionModel()
        if isinstance(selmodel, SymmetricSelectionModel):
            if not isinstance(selection, list):
                log.error("wrong data for symmetric selection")
                return
            selmodel.setSelectedItems(selection)
        else:
            if not isinstance(selection, tuple) and len(selection) == 2:
                log.error("wrong data for asymmetric selection")
                return
            rows, cols = selection
            selection = QItemSelection()
            rowranges = list(ranges(rows))
            colranges = list(ranges(cols))

            index = self.tablemodel.index
            for rowstart, rowend in rowranges:
                for colstart, colend in colranges:
                    selection.append(
                        QItemSelectionRange(
                            index(rowstart, colstart),
                            index(rowend - 1, colend - 1)
                        )
                    )
            selmodel.select(selection, selmodel.ClearAndSelect)

    def send_report(self):
        if self.distances is None:
            return
        model = self.tablemodel
        index = model.index
        ndec = self.tableview.itemDelegate().ndecimals
        header = model.headerData
        h, w = self.distances.shape

        hor_header = bool(header(0, Qt.Horizontal, Qt.DisplayRole))
        ver_header = bool(header(0, Qt.Vertical, Qt.DisplayRole))

        def cell(func, num):
            label, brush = (func(role)
                            for role in (Qt.DisplayRole, Qt.BackgroundRole))
            if brush:
                style = f' style="background-color: {brush.color().name()}"'
            else:
                style = ""
            label = "" if label is None else f"{label:.{ndec}f}" if num else label
            self.report_raw(f"<td {style}>{label}</td>\n")

        self.report_raw('<table style="border-collapse:collapse">')
        if hor_header:
            self.report_raw("<tr>")
            if ver_header:
                self.report_raw("<td></td>")
            for col in range(w):
                cell(partial(header, col, Qt.Horizontal), False)
            self.report_raw("</tr>")

        for row in range(h):
            self.report_raw("<tr>")
            if ver_header:
                cell(partial(header, row, Qt.Vertical), False)
            for col in range(w):
                cell(index(row, col).data, True)
            self.report_raw("</tr>")
        self.report_raw("</table>")

    @classmethod
    def migrate_context(cls, context, version):
        if version < 2:
            context.shape = (context.dim, context.dim)
            context.symmetric = True


if __name__ == "__main__":  # pragma: no cover
    import Orange.distance
    data = Orange.data.Table("zoo")
    dist = Orange.distance.Euclidean(data)
    # dist = DistMatrix([[1, 2, 3], [4, 5, 6]])
    # dist.row_items = DistMatrix._labels_to_tables(["aa", "bb"])
    # dist.col_items = DistMatrix._labels_to_tables(["cc", "dd", "ee"])
    WidgetPreview(OWDistanceMatrix).run(dist)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
user