{
    "file_diffs": [
        {
            "old_file_content": "import sys\n\nimport numpy as np\nfrom AnyQt.QtWidgets import QApplication\nfrom AnyQt.QtGui import QColor\nfrom sklearn.metrics import pairwise_distances\n\nfrom Orange.preprocess import Normalize, Continuize, SklImpute\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.utils.slidergraph import SliderGraph\nfrom Orange.widgets.settings import Setting\nfrom Orange.data import Table, Domain, DiscreteVariable\nfrom Orange.clustering import DBSCAN\nfrom Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME\nfrom Orange.widgets.utils.signals import Input, Output\nfrom Orange.widgets.widget import Msg\n\n\nDEFAULT_CUT_POINT = 0.1\nPREPROCESSORS = [Continuize(), Normalize(), SklImpute()]\nEPS_BOTTOM_LIMIT = 0.01\n\n\ndef get_kth_distances(data, metric, k=5):\n    \"\"\"\n    The function computes the epsilon parameter for DBSCAN through method\n    proposed in the paper.\n    Parameters\n    ----------\n    data : Orange.data.Table\n        Visualisation coordinates - embeddings\n    metric : callable or str\n        The metric to compute the distance.\n    k : int\n        Number kth observed neighbour\n\n    Returns\n    -------\n    np.ndarray\n        Epsilon parameter for DBSCAN\n    \"\"\"\n    x = data.X\n    if x.shape[0] > 1000:  # subsample\n        x = x[np.random.randint(x.shape[0], size=1000), :]\n\n    dist = pairwise_distances(x, metric=metric)\n    k = min(k+1, len(data) - 1)  # k+1 since first one is item itself\n    kth_point = np.argpartition(dist, k, axis=1)[:, k]\n    kth_dist = np.sort(dist[np.arange(0, len(kth_point)), kth_point])[::-1]\n\n    return kth_dist\n\n\nclass OWDBSCAN(widget.OWWidget):\n    name = \"DBSCAN\"\n    description = \"Density-based spatial clustering.\"\n    icon = \"icons/DBSCAN.svg\"\n    priority = 2150\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    class Error(widget.OWWidget.Error):\n        not_enough_instances = Msg(\"Not enough unique data instances. \"\n                                   \"At least two are required.\")\n\n    METRICS = [\n        (\"Euclidean\", \"euclidean\"),\n        (\"Manhattan\", \"cityblock\"),\n        (\"Cosine\", \"cosine\")\n    ]\n\n    min_samples = Setting(4)\n    eps = Setting(0.5)\n    metric_idx = Setting(0)\n    auto_commit = Setting(True)\n    k_distances = None\n    cut_point = None\n\n    def __init__(self):\n        super().__init__()\n\n        self.data = None\n        self.data_normalized = None\n        self.db = None\n        self.model = None\n\n        box = gui.widgetBox(self.controlArea, \"Parameters\")\n        gui.spin(box, self, \"min_samples\", 1, 100, 1,\n                 callback=self._min_samples_changed,\n                 label=\"Core point neighbors\")\n        gui.doubleSpin(box, self, \"eps\", EPS_BOTTOM_LIMIT, 1000, 0.01,\n                       callback=self._eps_changed,\n                       label=\"Neighborhood distance\")\n\n        box = gui.widgetBox(self.controlArea, self.tr(\"Distance Metric\"))\n        gui.comboBox(box, self, \"metric_idx\",\n                     items=list(zip(*self.METRICS))[0],\n                     callback=self._metirc_changed)\n\n        gui.auto_apply(self.controlArea, self, \"auto_commit\")\n        gui.rubber(self.controlArea)\n\n        self.controlArea.layout().addStretch()\n\n        self.plot = SliderGraph(\n            x_axis_label=\"Data items sorted by score\",\n            y_axis_label=\"Distance to the k-th nearest neighbour\",\n            callback=self._on_cut_changed\n        )\n\n        self.mainArea.layout().addWidget(self.plot)\n\n    def check_data_size(self, data):\n        if data is None:\n            return False\n        if len(data) < 2:\n            self.Error.not_enough_instances()\n            return False\n        return True\n\n    def commit(self):\n        self.cluster()\n\n    def cluster(self):\n        if not self.check_data_size(self.data):\n            return\n        self.model = DBSCAN(\n            eps=self.eps,\n            min_samples=self.min_samples,\n            metric=self.METRICS[self.metric_idx][1]\n        ).get_model(self.data_normalized)\n        self.send_data()\n\n    def _compute_and_plot(self, cut_point=None):\n        self._compute_kdistances()\n        if cut_point is None:\n            self._compute_cut_point()\n        self._plot_graph()\n\n    def _plot_graph(self):\n        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)\n        self.plot.update(np.arange(len(self.k_distances)),\n                         [self.k_distances],\n                         colors=[QColor('red')],\n                         cutpoint_x=self.cut_point,\n                         selection_limit=(0, nonzero - 1))\n\n    def _compute_kdistances(self):\n        self.k_distances = get_kth_distances(\n            self.data_normalized, metric=self.METRICS[self.metric_idx][1],\n            k=self.min_samples\n        )\n\n    def _compute_cut_point(self):\n        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))\n        self.eps = self.k_distances[self.cut_point]\n\n        if self.eps < EPS_BOTTOM_LIMIT:\n            self.eps = np.min(\n                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])\n            self.cut_point = self._find_nearest_dist(self.eps)\n\n    @Inputs.data\n    def set_data(self, data):\n        self.Error.clear()\n        if not self.check_data_size(data):\n            data = None\n        self.data = self.data_normalized = data\n        if self.data is None:\n            self.Outputs.annotated_data.send(None)\n            self.plot.clear_plot()\n            return\n\n        if self.data is None:\n            return\n\n        # preprocess data\n        for pp in PREPROCESSORS:\n            self.data_normalized = pp(self.data_normalized)\n\n        self._compute_and_plot()\n        self.unconditional_commit()\n\n    def send_data(self):\n        model = self.model\n\n        clusters = [c if c >= 0 else np.nan for c in model.labels]\n        k = len(set(clusters) - {np.nan})\n        clusters = np.array(clusters).reshape(len(self.data), 1)\n        core_samples = set(model.projector.core_sample_indices_)\n        in_core = np.array([1 if (i in core_samples) else 0\n                            for i in range(len(self.data))])\n        in_core = in_core.reshape(len(self.data), 1)\n\n        clust_var = DiscreteVariable(\n            \"Cluster\", values=[\"C%d\" % (x + 1) for x in range(k)])\n        in_core_var = DiscreteVariable(\"DBSCAN Core\", values=(\"0\", \"1\"))\n\n        domain = self.data.domain\n        attributes, classes = domain.attributes, domain.class_vars\n        meta_attrs = domain.metas\n        x, y, metas = self.data.X, self.data.Y, self.data.metas\n\n        meta_attrs += (clust_var, )\n        metas = np.hstack((metas, clusters))\n        meta_attrs += (in_core_var, )\n        metas = np.hstack((metas, in_core))\n\n        domain = Domain(attributes, classes, meta_attrs)\n        new_table = Table(domain, x, y, metas, self.data.W)\n\n        self.Outputs.annotated_data.send(new_table)\n\n    def _invalidate(self):\n        self.commit()\n\n    def _find_nearest_dist(self, value):\n        array = np.asarray(self.k_distances)\n        idx = (np.abs(array - value)).argmin()\n        return idx\n\n    def _eps_changed(self):\n        # find the closest value to eps\n        if self.data is None:\n            return\n        self.cut_point = self._find_nearest_dist(self.eps)\n        self.plot.set_cut_point(self.cut_point)\n        self._invalidate()\n\n    def _metirc_changed(self):\n        if self.data is not None:\n            self._compute_and_plot()\n            self._invalidate()\n\n    def _on_cut_changed(self, value):\n        # cut changed by means of a cut line over the scree plot.\n        self.cut_point = value\n        self.eps = self.k_distances[value]\n\n        self.commit()\n\n    def _min_samples_changed(self):\n        if self.data is None:\n            return\n        self._compute_and_plot(cut_point=self.cut_point)\n        self._invalidate()\n\n\nif __name__ == \"__main__\":\n    a = QApplication(sys.argv)\n    ow = OWDBSCAN()\n    d = Table(\"iris.tab\")\n    ow.set_data(d)\n    ow.show()\n    a.exec()\n    ow.saveSettings()\n",
            "new_file_content": "import sys\nfrom itertools import chain\n\nimport numpy as np\nfrom AnyQt.QtWidgets import QApplication\nfrom AnyQt.QtGui import QColor\nfrom sklearn.metrics import pairwise_distances\n\nfrom Orange.preprocess import Normalize, Continuize, SklImpute\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.utils.slidergraph import SliderGraph\nfrom Orange.widgets.settings import Setting\nfrom Orange.data import Table, Domain, DiscreteVariable\nfrom Orange.data.util import get_unique_names\nfrom Orange.clustering import DBSCAN\nfrom Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME\nfrom Orange.widgets.utils.signals import Input, Output\nfrom Orange.widgets.widget import Msg\n\n\nDEFAULT_CUT_POINT = 0.1\nPREPROCESSORS = [Continuize(), Normalize(), SklImpute()]\nEPS_BOTTOM_LIMIT = 0.01\n\n\ndef get_kth_distances(data, metric, k=5):\n    \"\"\"\n    The function computes the epsilon parameter for DBSCAN through method\n    proposed in the paper.\n    Parameters\n    ----------\n    data : Orange.data.Table\n        Visualisation coordinates - embeddings\n    metric : callable or str\n        The metric to compute the distance.\n    k : int\n        Number kth observed neighbour\n\n    Returns\n    -------\n    np.ndarray\n        Epsilon parameter for DBSCAN\n    \"\"\"\n    x = data.X\n    if x.shape[0] > 1000:  # subsample\n        x = x[np.random.randint(x.shape[0], size=1000), :]\n\n    dist = pairwise_distances(x, metric=metric)\n    k = min(k+1, len(data) - 1)  # k+1 since first one is item itself\n    kth_point = np.argpartition(dist, k, axis=1)[:, k]\n    kth_dist = np.sort(dist[np.arange(0, len(kth_point)), kth_point])[::-1]\n\n    return kth_dist\n\n\nclass OWDBSCAN(widget.OWWidget):\n    name = \"DBSCAN\"\n    description = \"Density-based spatial clustering.\"\n    icon = \"icons/DBSCAN.svg\"\n    priority = 2150\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    class Error(widget.OWWidget.Error):\n        not_enough_instances = Msg(\"Not enough unique data instances. \"\n                                   \"At least two are required.\")\n\n    METRICS = [\n        (\"Euclidean\", \"euclidean\"),\n        (\"Manhattan\", \"cityblock\"),\n        (\"Cosine\", \"cosine\")\n    ]\n\n    min_samples = Setting(4)\n    eps = Setting(0.5)\n    metric_idx = Setting(0)\n    auto_commit = Setting(True)\n    k_distances = None\n    cut_point = None\n\n    def __init__(self):\n        super().__init__()\n\n        self.data = None\n        self.data_normalized = None\n        self.db = None\n        self.model = None\n\n        box = gui.widgetBox(self.controlArea, \"Parameters\")\n        gui.spin(box, self, \"min_samples\", 1, 100, 1,\n                 callback=self._min_samples_changed,\n                 label=\"Core point neighbors\")\n        gui.doubleSpin(box, self, \"eps\", EPS_BOTTOM_LIMIT, 1000, 0.01,\n                       callback=self._eps_changed,\n                       label=\"Neighborhood distance\")\n\n        box = gui.widgetBox(self.controlArea, self.tr(\"Distance Metric\"))\n        gui.comboBox(box, self, \"metric_idx\",\n                     items=list(zip(*self.METRICS))[0],\n                     callback=self._metirc_changed)\n\n        gui.auto_apply(self.controlArea, self, \"auto_commit\")\n        gui.rubber(self.controlArea)\n\n        self.controlArea.layout().addStretch()\n\n        self.plot = SliderGraph(\n            x_axis_label=\"Data items sorted by score\",\n            y_axis_label=\"Distance to the k-th nearest neighbour\",\n            callback=self._on_cut_changed\n        )\n\n        self.mainArea.layout().addWidget(self.plot)\n\n    def check_data_size(self, data):\n        if data is None:\n            return False\n        if len(data) < 2:\n            self.Error.not_enough_instances()\n            return False\n        return True\n\n    def commit(self):\n        self.cluster()\n\n    def cluster(self):\n        if not self.check_data_size(self.data):\n            return\n        self.model = DBSCAN(\n            eps=self.eps,\n            min_samples=self.min_samples,\n            metric=self.METRICS[self.metric_idx][1]\n        ).get_model(self.data_normalized)\n        self.send_data()\n\n    def _compute_and_plot(self, cut_point=None):\n        self._compute_kdistances()\n        if cut_point is None:\n            self._compute_cut_point()\n        self._plot_graph()\n\n    def _plot_graph(self):\n        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)\n        self.plot.update(np.arange(len(self.k_distances)),\n                         [self.k_distances],\n                         colors=[QColor('red')],\n                         cutpoint_x=self.cut_point,\n                         selection_limit=(0, nonzero - 1))\n\n    def _compute_kdistances(self):\n        self.k_distances = get_kth_distances(\n            self.data_normalized, metric=self.METRICS[self.metric_idx][1],\n            k=self.min_samples\n        )\n\n    def _compute_cut_point(self):\n        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))\n        self.eps = self.k_distances[self.cut_point]\n\n        if self.eps < EPS_BOTTOM_LIMIT:\n            self.eps = np.min(\n                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])\n            self.cut_point = self._find_nearest_dist(self.eps)\n\n    @Inputs.data\n    def set_data(self, data):\n        self.Error.clear()\n        if not self.check_data_size(data):\n            data = None\n        self.data = self.data_normalized = data\n        if self.data is None:\n            self.Outputs.annotated_data.send(None)\n            self.plot.clear_plot()\n            return\n\n        if self.data is None:\n            return\n\n        # preprocess data\n        for pp in PREPROCESSORS:\n            self.data_normalized = pp(self.data_normalized)\n\n        self._compute_and_plot()\n        self.unconditional_commit()\n\n    def send_data(self):\n        model = self.model\n\n        clusters = [c if c >= 0 else np.nan for c in model.labels]\n        k = len(set(clusters) - {np.nan})\n        clusters = np.array(clusters).reshape(len(self.data), 1)\n        core_samples = set(model.projector.core_sample_indices_)\n        in_core = np.array([1 if (i in core_samples) else 0\n                            for i in range(len(self.data))])\n        in_core = in_core.reshape(len(self.data), 1)\n\n        domain = self.data.domain\n        attributes, classes = domain.attributes, domain.class_vars\n        meta_attrs = domain.metas\n        names = [var.name for var in chain(attributes, classes, meta_attrs) if var]\n\n        u_clust_var = get_unique_names(names, \"Cluster\")\n        clust_var = DiscreteVariable(\n            u_clust_var, values=[\"C%d\" % (x + 1) for x in range(k)])\n\n        u_in_core = get_unique_names(names + [u_clust_var], \"DBSCAN Core\")\n        in_core_var = DiscreteVariable(u_in_core, values=(\"0\", \"1\"))\n\n        x, y, metas = self.data.X, self.data.Y, self.data.metas\n\n        meta_attrs += (clust_var, )\n        metas = np.hstack((metas, clusters))\n        meta_attrs += (in_core_var, )\n        metas = np.hstack((metas, in_core))\n\n        domain = Domain(attributes, classes, meta_attrs)\n        new_table = Table(domain, x, y, metas, self.data.W)\n\n        self.Outputs.annotated_data.send(new_table)\n\n    def _invalidate(self):\n        self.commit()\n\n    def _find_nearest_dist(self, value):\n        array = np.asarray(self.k_distances)\n        idx = (np.abs(array - value)).argmin()\n        return idx\n\n    def _eps_changed(self):\n        # find the closest value to eps\n        if self.data is None:\n            return\n        self.cut_point = self._find_nearest_dist(self.eps)\n        self.plot.set_cut_point(self.cut_point)\n        self._invalidate()\n\n    def _metirc_changed(self):\n        if self.data is not None:\n            self._compute_and_plot()\n            self._invalidate()\n\n    def _on_cut_changed(self, value):\n        # cut changed by means of a cut line over the scree plot.\n        self.cut_point = value\n        self.eps = self.k_distances[value]\n\n        self.commit()\n\n    def _min_samples_changed(self):\n        if self.data is None:\n            return\n        self._compute_and_plot(cut_point=self.cut_point)\n        self._invalidate()\n\n\nif __name__ == \"__main__\":\n    a = QApplication(sys.argv)\n    ow = OWDBSCAN()\n    d = Table(\"iris.tab\")\n    ow.set_data(d)\n    ow.show()\n    a.exec()\n    ow.saveSettings()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/unsupervised/owdbscan.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "8253ceb18",
                "new_commit_hash": "d5cf64292",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/unsupervised/owdbscan.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/unsupervised/owdbscan.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 1,
                            "length": 4
                        },
                        "new_range": {
                            "start": 1,
                            "length": 5
                        },
                        "section": ""
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "import sys",
                                "type": "context"
                            },
                            {
                                "content": "from itertools import chain",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "from AnyQt.QtWidgets import QApplication",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owdbscan.py",
                            "type": "statement",
                            "name": "",
                            "content": "from itertools import chain",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 2,
                            "end_lineno": 2,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 10,
                            "length": 6
                        },
                        "new_range": {
                            "start": 11,
                            "length": 7
                        },
                        "section": "from Orange.widgets import widget, gui"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from Orange.widgets.utils.slidergraph import SliderGraph",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.settings import Setting",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Table, Domain, DiscreteVariable",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data.util import get_unique_names",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.clustering import DBSCAN",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.signals import Input, Output",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owdbscan.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.data.util import get_unique_names",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 14,
                            "end_lineno": 14,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 196,
                            "length": 13
                        },
                        "new_range": {
                            "start": 198,
                            "length": 18
                        },
                        "section": "class OWDBSCAN(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "                            for i in range(len(self.data))])",
                                "type": "context"
                            },
                            {
                                "content": "        in_core = in_core.reshape(len(self.data), 1)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        clust_var = DiscreteVariable(",
                                "type": "deleted"
                            },
                            {
                                "content": "            \"Cluster\", values=[\"C%d\" % (x + 1) for x in range(k)])",
                                "type": "deleted"
                            },
                            {
                                "content": "        in_core_var = DiscreteVariable(\"DBSCAN Core\", values=(\"0\", \"1\"))",
                                "type": "deleted"
                            },
                            {
                                "content": "",
                                "type": "deleted"
                            },
                            {
                                "content": "        domain = self.data.domain",
                                "type": "context"
                            },
                            {
                                "content": "        attributes, classes = domain.attributes, domain.class_vars",
                                "type": "context"
                            },
                            {
                                "content": "        meta_attrs = domain.metas",
                                "type": "context"
                            },
                            {
                                "content": "        names = [var.name for var in chain(attributes, classes, meta_attrs) if var]",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        u_clust_var = get_unique_names(names, \"Cluster\")",
                                "type": "added"
                            },
                            {
                                "content": "        clust_var = DiscreteVariable(",
                                "type": "added"
                            },
                            {
                                "content": "            u_clust_var, values=[\"C%d\" % (x + 1) for x in range(k)])",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        u_in_core = get_unique_names(names + [u_clust_var], \"DBSCAN Core\")",
                                "type": "added"
                            },
                            {
                                "content": "        in_core_var = DiscreteVariable(u_in_core, values=(\"0\", \"1\"))",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        x, y, metas = self.data.X, self.data.Y, self.data.metas",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        meta_attrs += (clust_var, )",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owdbscan.py",
                            "type": "method",
                            "name": "OWDBSCAN.send_data",
                            "content": "class OWDBSCAN(widget.OWWidget):\n    name = \"DBSCAN\"\n    description = \"Density-based spatial clustering.\"\n    icon = \"icons/DBSCAN.svg\"\n    priority = 2150\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    class Error(widget.OWWidget.Error):\n        not_enough_instances = Msg(\"Not enough unique data instances. \"\n                                   \"At least two are required.\")\n\n    METRICS = [\n        (\"Euclidean\", \"euclidean\"),\n        (\"Manhattan\", \"cityblock\"),\n        (\"Cosine\", \"cosine\")\n    ]\n\n    min_samples = Setting(4)\n    eps = Setting(0.5)\n    metric_idx = Setting(0)\n    auto_commit = Setting(True)\n    k_distances = None\n    cut_point = None\n\n    def __init__(self):\n        super().__init__()\n\n        self.data = None\n        self.data_normalized = None\n        self.db = None\n        self.model = None\n\n        box = gui.widgetBox(self.controlArea, \"Parameters\")\n        gui.spin(box, self, \"min_samples\", 1, 100, 1,\n                 callback=self._min_samples_changed,\n                 label=\"Core point neighbors\")\n        gui.doubleSpin(box, self, \"eps\", EPS_BOTTOM_LIMIT, 1000, 0.01,\n                       callback=self._eps_changed,\n                       label=\"Neighborhood distance\")\n\n        box = gui.widgetBox(self.controlArea, self.tr(\"Distance Metric\"))\n        gui.comboBox(box, self, \"metric_idx\",\n                     items=list(zip(*self.METRICS))[0],\n                     callback=self._metirc_changed)\n\n        gui.auto_apply(self.controlArea, self, \"auto_commit\")\n        gui.rubber(self.controlArea)\n\n        self.controlArea.layout().addStretch()\n\n        self.plot = SliderGraph(\n            x_axis_label=\"Data items sorted by score\",\n            y_axis_label=\"Distance to the k-th nearest neighbour\",\n            callback=self._on_cut_changed\n        )\n\n        self.mainArea.layout().addWidget(self.plot)\n\n    def check_data_size(self, data):\n        if data is None:\n            return False\n        if len(data) < 2:\n            self.Error.not_enough_instances()\n            return False\n        return True\n\n    def commit(self):\n        self.cluster()\n\n    def cluster(self):\n        if not self.check_data_size(self.data):\n            return\n        self.model = DBSCAN(\n            eps=self.eps,\n            min_samples=self.min_samples,\n            metric=self.METRICS[self.metric_idx][1]\n        ).get_model(self.data_normalized)\n        self.send_data()\n\n    def _compute_and_plot(self, cut_point=None):\n        self._compute_kdistances()\n        if cut_point is None:\n            self._compute_cut_point()\n        self._plot_graph()\n\n    def _plot_graph(self):\n        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)\n        self.plot.update(np.arange(len(self.k_distances)),\n                         [self.k_distances],\n                         colors=[QColor('red')],\n                         cutpoint_x=self.cut_point,\n                         selection_limit=(0, nonzero - 1))\n\n    def _compute_kdistances(self):\n        self.k_distances = get_kth_distances(\n            self.data_normalized, metric=self.METRICS[self.metric_idx][1],\n            k=self.min_samples\n        )\n\n    def _compute_cut_point(self):\n        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))\n        self.eps = self.k_distances[self.cut_point]\n\n        if self.eps < EPS_BOTTOM_LIMIT:\n            self.eps = np.min(\n                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])\n            self.cut_point = self._find_nearest_dist(self.eps)\n\n    @Inputs.data\n    def set_data(self, data):\n        self.Error.clear()\n        if not self.check_data_size(data):\n            data = None\n        self.data = self.data_normalized = data\n        if self.data is None:\n            self.Outputs.annotated_data.send(None)\n            self.plot.clear_plot()\n            return\n\n        if self.data is None:\n            return\n\n        # preprocess data\n        for pp in PREPROCESSORS:\n            self.data_normalized = pp(self.data_normalized)\n\n        self._compute_and_plot()\n        self.unconditional_commit()\n\n    def send_data(self):\n        model = self.model\n\n        clusters = [c if c >= 0 else np.nan for c in model.labels]\n        k = len(set(clusters) - {np.nan})\n        clusters = np.array(clusters).reshape(len(self.data), 1)\n        core_samples = set(model.projector.core_sample_indices_)\n        in_core = np.array([1 if (i in core_samples) else 0\n                            for i in range(len(self.data))])\n        in_core = in_core.reshape(len(self.data), 1)\n\n        clust_var = DiscreteVariable(\n            \"Cluster\", values=[\"C%d\" % (x + 1) for x in range(k)])\n        in_core_var = DiscreteVariable(\"DBSCAN Core\", values=(\"0\", \"1\"))\n\n        domain = self.data.domain\n        attributes, classes = domain.attributes, domain.class_vars\n        meta_attrs = domain.metas\n        x, y, metas = self.data.X, self.data.Y, self.data.metas\n\n        meta_attrs += (clust_var, )\n        metas = np.hstack((metas, clusters))\n        meta_attrs += (in_core_var, )\n        metas = np.hstack((metas, in_core))\n\n        domain = Domain(attributes, classes, meta_attrs)\n        new_table = Table(domain, x, y, metas, self.data.W)\n\n        self.Outputs.annotated_data.send(new_table)\n\n    def _invalidate(self):\n        self.commit()\n\n    def _find_nearest_dist(self, value):\n        array = np.asarray(self.k_distances)\n        idx = (np.abs(array - value)).argmin()\n        return idx\n\n    def _eps_changed(self):\n        # find the closest value to eps\n        if self.data is None:\n            return\n        self.cut_point = self._find_nearest_dist(self.eps)\n        self.plot.set_cut_point(self.cut_point)\n        self._invalidate()\n\n    def _metirc_changed(self):\n        if self.data is not None:\n            self._compute_and_plot()\n            self._invalidate()\n\n    def _on_cut_changed(self, value):\n        # cut changed by means of a cut line over the scree plot.\n        self.cut_point = value\n        self.eps = self.k_distances[value]\n\n        self.commit()\n\n    def _min_samples_changed(self):\n        if self.data is None:\n            return\n        self._compute_and_plot(cut_point=self.cut_point)\n        self._invalidate()",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 188,
                            "end_lineno": 216,
                            "parent": {
                                "file_name": "Orange/widgets/unsupervised/owdbscan.py",
                                "type": "class",
                                "name": "OWDBSCAN",
                                "content": "class OWDBSCAN(widget.OWWidget):\n    name = \"DBSCAN\"\n    description = \"Density-based spatial clustering.\"\n    icon = \"icons/DBSCAN.svg\"\n    priority = 2150\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    class Error(widget.OWWidget.Error):\n        not_enough_instances = Msg(\"Not enough unique data instances. \"\n                                   \"At least two are required.\")\n\n    METRICS = [\n        (\"Euclidean\", \"euclidean\"),\n        (\"Manhattan\", \"cityblock\"),\n        (\"Cosine\", \"cosine\")\n    ]\n\n    min_samples = Setting(4)\n    eps = Setting(0.5)\n    metric_idx = Setting(0)\n    auto_commit = Setting(True)\n    k_distances = None\n    cut_point = None\n\n    def __init__(self):\n        super().__init__()\n\n        self.data = None\n        self.data_normalized = None\n        self.db = None\n        self.model = None\n\n        box = gui.widgetBox(self.controlArea, \"Parameters\")\n        gui.spin(box, self, \"min_samples\", 1, 100, 1,\n                 callback=self._min_samples_changed,\n                 label=\"Core point neighbors\")\n        gui.doubleSpin(box, self, \"eps\", EPS_BOTTOM_LIMIT, 1000, 0.01,\n                       callback=self._eps_changed,\n                       label=\"Neighborhood distance\")\n\n        box = gui.widgetBox(self.controlArea, self.tr(\"Distance Metric\"))\n        gui.comboBox(box, self, \"metric_idx\",\n                     items=list(zip(*self.METRICS))[0],\n                     callback=self._metirc_changed)\n\n        gui.auto_apply(self.controlArea, self, \"auto_commit\")\n        gui.rubber(self.controlArea)\n\n        self.controlArea.layout().addStretch()\n\n        self.plot = SliderGraph(\n            x_axis_label=\"Data items sorted by score\",\n            y_axis_label=\"Distance to the k-th nearest neighbour\",\n            callback=self._on_cut_changed\n        )\n\n        self.mainArea.layout().addWidget(self.plot)\n\n    def check_data_size(self, data):\n        if data is None:\n            return False\n        if len(data) < 2:\n            self.Error.not_enough_instances()\n            return False\n        return True\n\n    def commit(self):\n        self.cluster()\n\n    def cluster(self):\n        if not self.check_data_size(self.data):\n            return\n        self.model = DBSCAN(\n            eps=self.eps,\n            min_samples=self.min_samples,\n            metric=self.METRICS[self.metric_idx][1]\n        ).get_model(self.data_normalized)\n        self.send_data()\n\n    def _compute_and_plot(self, cut_point=None):\n        self._compute_kdistances()\n        if cut_point is None:\n            self._compute_cut_point()\n        self._plot_graph()\n\n    def _plot_graph(self):\n        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)\n        self.plot.update(np.arange(len(self.k_distances)),\n                         [self.k_distances],\n                         colors=[QColor('red')],\n                         cutpoint_x=self.cut_point,\n                         selection_limit=(0, nonzero - 1))\n\n    def _compute_kdistances(self):\n        self.k_distances = get_kth_distances(\n            self.data_normalized, metric=self.METRICS[self.metric_idx][1],\n            k=self.min_samples\n        )\n\n    def _compute_cut_point(self):\n        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))\n        self.eps = self.k_distances[self.cut_point]\n\n        if self.eps < EPS_BOTTOM_LIMIT:\n            self.eps = np.min(\n                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])\n            self.cut_point = self._find_nearest_dist(self.eps)\n\n    @Inputs.data\n    def set_data(self, data):\n        self.Error.clear()\n        if not self.check_data_size(data):\n            data = None\n        self.data = self.data_normalized = data\n        if self.data is None:\n            self.Outputs.annotated_data.send(None)\n            self.plot.clear_plot()\n            return\n\n        if self.data is None:\n            return\n\n        # preprocess data\n        for pp in PREPROCESSORS:\n            self.data_normalized = pp(self.data_normalized)\n\n        self._compute_and_plot()\n        self.unconditional_commit()\n\n    def send_data(self):\n        model = self.model\n\n        clusters = [c if c >= 0 else np.nan for c in model.labels]\n        k = len(set(clusters) - {np.nan})\n        clusters = np.array(clusters).reshape(len(self.data), 1)\n        core_samples = set(model.projector.core_sample_indices_)\n        in_core = np.array([1 if (i in core_samples) else 0\n                            for i in range(len(self.data))])\n        in_core = in_core.reshape(len(self.data), 1)\n\n        clust_var = DiscreteVariable(\n            \"Cluster\", values=[\"C%d\" % (x + 1) for x in range(k)])\n        in_core_var = DiscreteVariable(\"DBSCAN Core\", values=(\"0\", \"1\"))\n\n        domain = self.data.domain\n        attributes, classes = domain.attributes, domain.class_vars\n        meta_attrs = domain.metas\n        x, y, metas = self.data.X, self.data.Y, self.data.metas\n\n        meta_attrs += (clust_var, )\n        metas = np.hstack((metas, clusters))\n        meta_attrs += (in_core_var, )\n        metas = np.hstack((metas, in_core))\n\n        domain = Domain(attributes, classes, meta_attrs)\n        new_table = Table(domain, x, y, metas, self.data.W)\n\n        self.Outputs.annotated_data.send(new_table)\n\n    def _invalidate(self):\n        self.commit()\n\n    def _find_nearest_dist(self, value):\n        array = np.asarray(self.k_distances)\n        idx = (np.abs(array - value)).argmin()\n        return idx\n\n    def _eps_changed(self):\n        # find the closest value to eps\n        if self.data is None:\n            return\n        self.cut_point = self._find_nearest_dist(self.eps)\n        self.plot.set_cut_point(self.cut_point)\n        self._invalidate()\n\n    def _metirc_changed(self):\n        if self.data is not None:\n            self._compute_and_plot()\n            self._invalidate()\n\n    def _on_cut_changed(self, value):\n        # cut changed by means of a cut line over the scree plot.\n        self.cut_point = value\n        self.eps = self.k_distances[value]\n\n        self.commit()\n\n    def _min_samples_changed(self):\n        if self.data is None:\n            return\n        self._compute_and_plot(cut_point=self.cut_point)\n        self._invalidate()",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 54,
                                "end_lineno": 250,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/unsupervised/owdbscan.py",
                            "type": "class",
                            "name": "OWDBSCAN",
                            "content": "class OWDBSCAN(widget.OWWidget):\n    name = \"DBSCAN\"\n    description = \"Density-based spatial clustering.\"\n    icon = \"icons/DBSCAN.svg\"\n    priority = 2150\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    class Error(widget.OWWidget.Error):\n        not_enough_instances = Msg(\"Not enough unique data instances. \"\n                                   \"At least two are required.\")\n\n    METRICS = [\n        (\"Euclidean\", \"euclidean\"),\n        (\"Manhattan\", \"cityblock\"),\n        (\"Cosine\", \"cosine\")\n    ]\n\n    min_samples = Setting(4)\n    eps = Setting(0.5)\n    metric_idx = Setting(0)\n    auto_commit = Setting(True)\n    k_distances = None\n    cut_point = None\n\n    def __init__(self):\n        super().__init__()\n\n        self.data = None\n        self.data_normalized = None\n        self.db = None\n        self.model = None\n\n        box = gui.widgetBox(self.controlArea, \"Parameters\")\n        gui.spin(box, self, \"min_samples\", 1, 100, 1,\n                 callback=self._min_samples_changed,\n                 label=\"Core point neighbors\")\n        gui.doubleSpin(box, self, \"eps\", EPS_BOTTOM_LIMIT, 1000, 0.01,\n                       callback=self._eps_changed,\n                       label=\"Neighborhood distance\")\n\n        box = gui.widgetBox(self.controlArea, self.tr(\"Distance Metric\"))\n        gui.comboBox(box, self, \"metric_idx\",\n                     items=list(zip(*self.METRICS))[0],\n                     callback=self._metirc_changed)\n\n        gui.auto_apply(self.controlArea, self, \"auto_commit\")\n        gui.rubber(self.controlArea)\n\n        self.controlArea.layout().addStretch()\n\n        self.plot = SliderGraph(\n            x_axis_label=\"Data items sorted by score\",\n            y_axis_label=\"Distance to the k-th nearest neighbour\",\n            callback=self._on_cut_changed\n        )\n\n        self.mainArea.layout().addWidget(self.plot)\n\n    def check_data_size(self, data):\n        if data is None:\n            return False\n        if len(data) < 2:\n            self.Error.not_enough_instances()\n            return False\n        return True\n\n    def commit(self):\n        self.cluster()\n\n    def cluster(self):\n        if not self.check_data_size(self.data):\n            return\n        self.model = DBSCAN(\n            eps=self.eps,\n            min_samples=self.min_samples,\n            metric=self.METRICS[self.metric_idx][1]\n        ).get_model(self.data_normalized)\n        self.send_data()\n\n    def _compute_and_plot(self, cut_point=None):\n        self._compute_kdistances()\n        if cut_point is None:\n            self._compute_cut_point()\n        self._plot_graph()\n\n    def _plot_graph(self):\n        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)\n        self.plot.update(np.arange(len(self.k_distances)),\n                         [self.k_distances],\n                         colors=[QColor('red')],\n                         cutpoint_x=self.cut_point,\n                         selection_limit=(0, nonzero - 1))\n\n    def _compute_kdistances(self):\n        self.k_distances = get_kth_distances(\n            self.data_normalized, metric=self.METRICS[self.metric_idx][1],\n            k=self.min_samples\n        )\n\n    def _compute_cut_point(self):\n        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))\n        self.eps = self.k_distances[self.cut_point]\n\n        if self.eps < EPS_BOTTOM_LIMIT:\n            self.eps = np.min(\n                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])\n            self.cut_point = self._find_nearest_dist(self.eps)\n\n    @Inputs.data\n    def set_data(self, data):\n        self.Error.clear()\n        if not self.check_data_size(data):\n            data = None\n        self.data = self.data_normalized = data\n        if self.data is None:\n            self.Outputs.annotated_data.send(None)\n            self.plot.clear_plot()\n            return\n\n        if self.data is None:\n            return\n\n        # preprocess data\n        for pp in PREPROCESSORS:\n            self.data_normalized = pp(self.data_normalized)\n\n        self._compute_and_plot()\n        self.unconditional_commit()\n\n    def send_data(self):\n        model = self.model\n\n        clusters = [c if c >= 0 else np.nan for c in model.labels]\n        k = len(set(clusters) - {np.nan})\n        clusters = np.array(clusters).reshape(len(self.data), 1)\n        core_samples = set(model.projector.core_sample_indices_)\n        in_core = np.array([1 if (i in core_samples) else 0\n                            for i in range(len(self.data))])\n        in_core = in_core.reshape(len(self.data), 1)\n\n        clust_var = DiscreteVariable(\n            \"Cluster\", values=[\"C%d\" % (x + 1) for x in range(k)])\n        in_core_var = DiscreteVariable(\"DBSCAN Core\", values=(\"0\", \"1\"))\n\n        domain = self.data.domain\n        attributes, classes = domain.attributes, domain.class_vars\n        meta_attrs = domain.metas\n        x, y, metas = self.data.X, self.data.Y, self.data.metas\n\n        meta_attrs += (clust_var, )\n        metas = np.hstack((metas, clusters))\n        meta_attrs += (in_core_var, )\n        metas = np.hstack((metas, in_core))\n\n        domain = Domain(attributes, classes, meta_attrs)\n        new_table = Table(domain, x, y, metas, self.data.W)\n\n        self.Outputs.annotated_data.send(new_table)\n\n    def _invalidate(self):\n        self.commit()\n\n    def _find_nearest_dist(self, value):\n        array = np.asarray(self.k_distances)\n        idx = (np.abs(array - value)).argmin()\n        return idx\n\n    def _eps_changed(self):\n        # find the closest value to eps\n        if self.data is None:\n            return\n        self.cut_point = self._find_nearest_dist(self.eps)\n        self.plot.set_cut_point(self.cut_point)\n        self._invalidate()\n\n    def _metirc_changed(self):\n        if self.data is not None:\n            self._compute_and_plot()\n            self._invalidate()\n\n    def _on_cut_changed(self, value):\n        # cut changed by means of a cut line over the scree plot.\n        self.cut_point = value\n        self.eps = self.k_distances[value]\n\n        self.commit()\n\n    def _min_samples_changed(self):\n        if self.data is None:\n            return\n        self._compute_and_plot(cut_point=self.cut_point)\n        self._invalidate()",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 54,
                            "end_lineno": 250,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import numpy as np\nfrom scipy.sparse import csr_matrix, csc_matrix\n\nfrom Orange.data import Table\nfrom Orange.distance import Euclidean\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.tests.utils import simulate\nfrom Orange.widgets.unsupervised.owdbscan import OWDBSCAN, get_kth_distances\n\n\nclass TestOWDBSCAN(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDBSCAN)\n        self.iris = Table(\"iris\")\n\n    def tearDown(self):\n        self.widgets.remove(self.widget)\n        self.widget.onDeleteWidget()\n        self.widget = None\n\n    def test_cluster(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_bad_input(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris[:1])\n        self.assertTrue(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris[:2])\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris)\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n    def test_data_none(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, None)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_eps(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.eps.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data higher eps has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n\n    def test_change_min_samples(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.min_samples.valueChanged.emit(5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.min_samples.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data lower min_samples has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.min_samples.valueChanged.emit(3)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_metric_idx(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n        output1 = self.get_output(w.Outputs.annotated_data)\n        simulate.combobox_activate_index(cbox, 1)  # Manhattan\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # Manhattan has more nan clusters\n        self.assertGreater(np.nansum(output1.metas[:, 0]),\n                           np.nansum(output2.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n\n    def test_sparse_csr_data(self):\n        self.iris.X = csr_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_sparse_csc_data(self):\n        self.iris.X = csc_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_get_kth_distances(self):\n        dists = get_kth_distances(self.iris, \"euclidean\", k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n        # test with different distance - e.g. Orange distance\n        dists = get_kth_distances(self.iris, Euclidean, k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n    def test_metric_changed(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n        cbox = w.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 2)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n\n    def test_large_data(self):\n        \"\"\"\n        When data has less than 1000 instances they are subsampled in k-values\n        computation.\n        \"\"\"\n        w = self.widget\n\n        data = Table(self.iris.domain,\n            np.repeat(self.iris.X, 10, axis=0),\n            np.repeat(self.iris.Y, 10, axis=0))\n\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n\n        self.assertEqual(len(data), len(output))\n        self.assertTupleEqual(data.X.shape, output.X.shape)\n        self.assertTupleEqual(data.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n    def test_titanic(self):\n        \"\"\"\n        Titanic is a data-set with many 0 in k-nearest neighbours and thus some\n        manipulation is required to set cut-point.\n        This test checks whether widget works on those type of data.\n        \"\"\"\n        w = self.widget\n        data = Table(\"titanic\")\n        self.send_signal(w.Inputs.data, data)\n\n    def test_missing_data(self):\n        w = self.widget\n        self.iris[1:5, 1] = np.nan\n        self.send_signal(w.Inputs.data, self.iris)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertTupleEqual((150, 1), output[:, \"Cluster\"].metas.shape)\n",
            "new_file_content": "import numpy as np\nfrom scipy.sparse import csr_matrix, csc_matrix\n\nfrom Orange.data import Table\nfrom Orange.distance import Euclidean\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.tests.utils import simulate, possible_duplicate_table\nfrom Orange.widgets.unsupervised.owdbscan import OWDBSCAN, get_kth_distances\n\n\nclass TestOWDBSCAN(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDBSCAN)\n        self.iris = Table(\"iris\")\n\n    def tearDown(self):\n        self.widgets.remove(self.widget)\n        self.widget.onDeleteWidget()\n        self.widget = None\n\n    def test_cluster(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_unique_domain(self):\n        w = self.widget\n        data = possible_duplicate_table(\"Cluster\")\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertEqual(output.domain.metas[0].name, \"Cluster (1)\")\n\n    def test_bad_input(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris[:1])\n        self.assertTrue(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris[:2])\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris)\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n    def test_data_none(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, None)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_eps(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.eps.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data higher eps has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n\n    def test_change_min_samples(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.min_samples.valueChanged.emit(5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.min_samples.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data lower min_samples has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.min_samples.valueChanged.emit(3)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_metric_idx(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n        output1 = self.get_output(w.Outputs.annotated_data)\n        simulate.combobox_activate_index(cbox, 1)  # Manhattan\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # Manhattan has more nan clusters\n        self.assertGreater(np.nansum(output1.metas[:, 0]),\n                           np.nansum(output2.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n\n    def test_sparse_csr_data(self):\n        self.iris.X = csr_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_sparse_csc_data(self):\n        self.iris.X = csc_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_get_kth_distances(self):\n        dists = get_kth_distances(self.iris, \"euclidean\", k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n        # test with different distance - e.g. Orange distance\n        dists = get_kth_distances(self.iris, Euclidean, k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n    def test_metric_changed(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n        cbox = w.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 2)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n\n    def test_large_data(self):\n        \"\"\"\n        When data has less than 1000 instances they are subsampled in k-values\n        computation.\n        \"\"\"\n        w = self.widget\n\n        data = Table(self.iris.domain,\n            np.repeat(self.iris.X, 10, axis=0),\n            np.repeat(self.iris.Y, 10, axis=0))\n\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n\n        self.assertEqual(len(data), len(output))\n        self.assertTupleEqual(data.X.shape, output.X.shape)\n        self.assertTupleEqual(data.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n    def test_titanic(self):\n        \"\"\"\n        Titanic is a data-set with many 0 in k-nearest neighbours and thus some\n        manipulation is required to set cut-point.\n        This test checks whether widget works on those type of data.\n        \"\"\"\n        w = self.widget\n        data = Table(\"titanic\")\n        self.send_signal(w.Inputs.data, data)\n\n    def test_missing_data(self):\n        w = self.widget\n        self.iris[1:5, 1] = np.nan\n        self.send_signal(w.Inputs.data, self.iris)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertTupleEqual((150, 1), output[:, \"Cluster\"].metas.shape)\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/unsupervised/tests/test_owdbscan.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "ccb961f91",
                "new_commit_hash": "a830662ad",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/unsupervised/tests/test_owdbscan.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/unsupervised/tests/test_owdbscan.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 4,
                            "length": 7
                        },
                        "new_range": {
                            "start": 4,
                            "length": 7
                        },
                        "section": "from scipy.sparse import csr_matrix, csc_matrix"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from Orange.data import Table",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.distance import Euclidean",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.tests.base import WidgetTest",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.tests.utils import simulate",
                                "type": "deleted"
                            },
                            {
                                "content": "from Orange.widgets.tests.utils import simulate, possible_duplicate_table",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.widgets.unsupervised.owdbscan import OWDBSCAN, get_kth_distances",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owdbscan.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.tests.utils import simulate, possible_duplicate_table",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 7,
                            "end_lineno": 7,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owdbscan.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.tests.utils import simulate",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 7,
                            "end_lineno": 7,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 33,
                            "length": 6
                        },
                        "new_range": {
                            "start": 33,
                            "length": 13
                        },
                        "section": "class TestOWDBSCAN(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_unique_domain(self):",
                                "type": "added"
                            },
                            {
                                "content": "        w = self.widget",
                                "type": "added"
                            },
                            {
                                "content": "        data = possible_duplicate_table(\"Cluster\")",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, data)",
                                "type": "added"
                            },
                            {
                                "content": "        output = self.get_output(w.Outputs.annotated_data)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(output.domain.metas[0].name, \"Cluster (1)\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_bad_input(self):",
                                "type": "context"
                            },
                            {
                                "content": "        w = self.widget",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owdbscan.py",
                            "type": "class",
                            "name": "TestOWDBSCAN",
                            "content": "class TestOWDBSCAN(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDBSCAN)\n        self.iris = Table(\"iris\")\n\n    def tearDown(self):\n        self.widgets.remove(self.widget)\n        self.widget.onDeleteWidget()\n        self.widget = None\n\n    def test_cluster(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_unique_domain(self):\n        w = self.widget\n        data = possible_duplicate_table(\"Cluster\")\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertEqual(output.domain.metas[0].name, \"Cluster (1)\")\n\n    def test_bad_input(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris[:1])\n        self.assertTrue(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris[:2])\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris)\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n    def test_data_none(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, None)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_eps(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.eps.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data higher eps has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n\n    def test_change_min_samples(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.min_samples.valueChanged.emit(5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.min_samples.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data lower min_samples has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.min_samples.valueChanged.emit(3)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_metric_idx(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n        output1 = self.get_output(w.Outputs.annotated_data)\n        simulate.combobox_activate_index(cbox, 1)  # Manhattan\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # Manhattan has more nan clusters\n        self.assertGreater(np.nansum(output1.metas[:, 0]),\n                           np.nansum(output2.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n\n    def test_sparse_csr_data(self):\n        self.iris.X = csr_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_sparse_csc_data(self):\n        self.iris.X = csc_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_get_kth_distances(self):\n        dists = get_kth_distances(self.iris, \"euclidean\", k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n        # test with different distance - e.g. Orange distance\n        dists = get_kth_distances(self.iris, Euclidean, k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n    def test_metric_changed(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n        cbox = w.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 2)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n\n    def test_large_data(self):\n        \"\"\"\n        When data has less than 1000 instances they are subsampled in k-values\n        computation.\n        \"\"\"\n        w = self.widget\n\n        data = Table(self.iris.domain,\n            np.repeat(self.iris.X, 10, axis=0),\n            np.repeat(self.iris.Y, 10, axis=0))\n\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n\n        self.assertEqual(len(data), len(output))\n        self.assertTupleEqual(data.X.shape, output.X.shape)\n        self.assertTupleEqual(data.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n    def test_titanic(self):\n        \"\"\"\n        Titanic is a data-set with many 0 in k-nearest neighbours and thus some\n        manipulation is required to set cut-point.\n        This test checks whether widget works on those type of data.\n        \"\"\"\n        w = self.widget\n        data = Table(\"titanic\")\n        self.send_signal(w.Inputs.data, data)\n\n    def test_missing_data(self):\n        w = self.widget\n        self.iris[1:5, 1] = np.nan\n        self.send_signal(w.Inputs.data, self.iris)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertTupleEqual((150, 1), output[:, \"Cluster\"].metas.shape)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 11,
                            "end_lineno": 222,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owdbscan.py",
                            "type": "method",
                            "name": "TestOWDBSCAN.test_unique_domain",
                            "content": "class TestOWDBSCAN(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDBSCAN)\n        self.iris = Table(\"iris\")\n\n    def tearDown(self):\n        self.widgets.remove(self.widget)\n        self.widget.onDeleteWidget()\n        self.widget = None\n\n    def test_cluster(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_unique_domain(self):\n        w = self.widget\n        data = possible_duplicate_table(\"Cluster\")\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertEqual(output.domain.metas[0].name, \"Cluster (1)\")\n\n    def test_bad_input(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris[:1])\n        self.assertTrue(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris[:2])\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris)\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n    def test_data_none(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, None)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_eps(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.eps.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data higher eps has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n\n    def test_change_min_samples(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.min_samples.valueChanged.emit(5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.min_samples.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data lower min_samples has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.min_samples.valueChanged.emit(3)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_metric_idx(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n        output1 = self.get_output(w.Outputs.annotated_data)\n        simulate.combobox_activate_index(cbox, 1)  # Manhattan\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # Manhattan has more nan clusters\n        self.assertGreater(np.nansum(output1.metas[:, 0]),\n                           np.nansum(output2.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n\n    def test_sparse_csr_data(self):\n        self.iris.X = csr_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_sparse_csc_data(self):\n        self.iris.X = csc_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_get_kth_distances(self):\n        dists = get_kth_distances(self.iris, \"euclidean\", k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n        # test with different distance - e.g. Orange distance\n        dists = get_kth_distances(self.iris, Euclidean, k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n    def test_metric_changed(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n        cbox = w.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 2)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n\n    def test_large_data(self):\n        \"\"\"\n        When data has less than 1000 instances they are subsampled in k-values\n        computation.\n        \"\"\"\n        w = self.widget\n\n        data = Table(self.iris.domain,\n            np.repeat(self.iris.X, 10, axis=0),\n            np.repeat(self.iris.Y, 10, axis=0))\n\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n\n        self.assertEqual(len(data), len(output))\n        self.assertTupleEqual(data.X.shape, output.X.shape)\n        self.assertTupleEqual(data.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n    def test_titanic(self):\n        \"\"\"\n        Titanic is a data-set with many 0 in k-nearest neighbours and thus some\n        manipulation is required to set cut-point.\n        This test checks whether widget works on those type of data.\n        \"\"\"\n        w = self.widget\n        data = Table(\"titanic\")\n        self.send_signal(w.Inputs.data, data)\n\n    def test_missing_data(self):\n        w = self.widget\n        self.iris[1:5, 1] = np.nan\n        self.send_signal(w.Inputs.data, self.iris)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertTupleEqual((150, 1), output[:, \"Cluster\"].metas.shape)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 36,
                            "end_lineno": 41,
                            "parent": {
                                "file_name": "Orange/widgets/unsupervised/tests/test_owdbscan.py",
                                "type": "class",
                                "name": "TestOWDBSCAN",
                                "content": "class TestOWDBSCAN(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDBSCAN)\n        self.iris = Table(\"iris\")\n\n    def tearDown(self):\n        self.widgets.remove(self.widget)\n        self.widget.onDeleteWidget()\n        self.widget = None\n\n    def test_cluster(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_unique_domain(self):\n        w = self.widget\n        data = possible_duplicate_table(\"Cluster\")\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertEqual(output.domain.metas[0].name, \"Cluster (1)\")\n\n    def test_bad_input(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris[:1])\n        self.assertTrue(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris[:2])\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris)\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n    def test_data_none(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, None)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_eps(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.eps.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data higher eps has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n\n    def test_change_min_samples(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.min_samples.valueChanged.emit(5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.min_samples.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data lower min_samples has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.min_samples.valueChanged.emit(3)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_metric_idx(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n        output1 = self.get_output(w.Outputs.annotated_data)\n        simulate.combobox_activate_index(cbox, 1)  # Manhattan\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # Manhattan has more nan clusters\n        self.assertGreater(np.nansum(output1.metas[:, 0]),\n                           np.nansum(output2.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n\n    def test_sparse_csr_data(self):\n        self.iris.X = csr_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_sparse_csc_data(self):\n        self.iris.X = csc_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_get_kth_distances(self):\n        dists = get_kth_distances(self.iris, \"euclidean\", k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n        # test with different distance - e.g. Orange distance\n        dists = get_kth_distances(self.iris, Euclidean, k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n    def test_metric_changed(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n        cbox = w.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 2)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n\n    def test_large_data(self):\n        \"\"\"\n        When data has less than 1000 instances they are subsampled in k-values\n        computation.\n        \"\"\"\n        w = self.widget\n\n        data = Table(self.iris.domain,\n            np.repeat(self.iris.X, 10, axis=0),\n            np.repeat(self.iris.Y, 10, axis=0))\n\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n\n        self.assertEqual(len(data), len(output))\n        self.assertTupleEqual(data.X.shape, output.X.shape)\n        self.assertTupleEqual(data.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n    def test_titanic(self):\n        \"\"\"\n        Titanic is a data-set with many 0 in k-nearest neighbours and thus some\n        manipulation is required to set cut-point.\n        This test checks whether widget works on those type of data.\n        \"\"\"\n        w = self.widget\n        data = Table(\"titanic\")\n        self.send_signal(w.Inputs.data, data)\n\n    def test_missing_data(self):\n        w = self.widget\n        self.iris[1:5, 1] = np.nan\n        self.send_signal(w.Inputs.data, self.iris)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertTupleEqual((150, 1), output[:, \"Cluster\"].metas.shape)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 11,
                                "end_lineno": 222,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e^",
    "new_commit_hash": "3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e",
    "commit_message": "Owdbscan: rename new vars if necessary",
    "commit_date": "2020-05-16T18:40:27+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e",
    "test_file_codes": [
        "import numpy as np\nfrom scipy.sparse import csr_matrix, csc_matrix\n\nfrom Orange.data import Table\nfrom Orange.distance import Euclidean\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.tests.utils import simulate, possible_duplicate_table\nfrom Orange.widgets.unsupervised.owdbscan import OWDBSCAN, get_kth_distances\n\n\nclass TestOWDBSCAN(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDBSCAN)\n        self.iris = Table(\"iris\")\n\n    def tearDown(self):\n        self.widgets.remove(self.widget)\n        self.widget.onDeleteWidget()\n        self.widget = None\n\n    def test_cluster(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_unique_domain(self):\n        w = self.widget\n        data = possible_duplicate_table(\"Cluster\")\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertEqual(output.domain.metas[0].name, \"Cluster (1)\")\n\n    def test_bad_input(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris[:1])\n        self.assertTrue(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris[:2])\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n        self.send_signal(w.Inputs.data, self.iris)\n        self.assertFalse(w.Error.not_enough_instances.is_shown())\n\n    def test_data_none(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, None)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_eps(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.eps.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data higher eps has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.eps.valueChanged.emit(0.5)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n\n    def test_change_min_samples(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        self.widget.controls.min_samples.valueChanged.emit(5)\n        output1 = self.get_output(w.Outputs.annotated_data)\n        self.widget.controls.min_samples.valueChanged.emit(1)\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # on this data lower min_samples has greater sum of clusters - less nan\n        # values\n        self.assertGreater(np.nansum(output2.metas[:, 0]),\n                           np.nansum(output1.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        self.widget.controls.min_samples.valueChanged.emit(3)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNone(output)\n\n    def test_change_metric_idx(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        # change parameters\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n        output1 = self.get_output(w.Outputs.annotated_data)\n        simulate.combobox_activate_index(cbox, 1)  # Manhattan\n        output2 = self.get_output(w.Outputs.annotated_data)\n\n        # Manhattan has more nan clusters\n        self.assertGreater(np.nansum(output1.metas[:, 0]),\n                           np.nansum(output2.metas[:, 0]))\n\n        # try when no data\n        self.send_signal(w.Inputs.data, None)\n        cbox = self.widget.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 0)  # Euclidean\n\n    def test_sparse_csr_data(self):\n        self.iris.X = csr_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_sparse_csc_data(self):\n        self.iris.X = csc_matrix(self.iris.X)\n\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n        self.assertEqual(\"Cluster\", str(output.domain.metas[0]))\n        self.assertEqual(\"DBSCAN Core\", str(output.domain.metas[1]))\n\n    def test_get_kth_distances(self):\n        dists = get_kth_distances(self.iris, \"euclidean\", k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n        # test with different distance - e.g. Orange distance\n        dists = get_kth_distances(self.iris, Euclidean, k=5)\n        self.assertEqual(len(self.iris), len(dists))\n        # dists must be sorted\n        np.testing.assert_array_equal(dists, np.sort(dists)[::-1])\n\n    def test_metric_changed(self):\n        w = self.widget\n\n        self.send_signal(w.Inputs.data, self.iris)\n        cbox = w.controls.metric_idx\n        simulate.combobox_activate_index(cbox, 2)\n\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertIsNotNone(output)\n        self.assertEqual(len(self.iris), len(output))\n        self.assertTupleEqual(self.iris.X.shape, output.X.shape)\n        self.assertTupleEqual(self.iris.Y.shape, output.Y.shape)\n\n    def test_large_data(self):\n        \"\"\"\n        When data has less than 1000 instances they are subsampled in k-values\n        computation.\n        \"\"\"\n        w = self.widget\n\n        data = Table(self.iris.domain,\n            np.repeat(self.iris.X, 10, axis=0),\n            np.repeat(self.iris.Y, 10, axis=0))\n\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n\n        self.assertEqual(len(data), len(output))\n        self.assertTupleEqual(data.X.shape, output.X.shape)\n        self.assertTupleEqual(data.Y.shape, output.Y.shape)\n        self.assertEqual(2, output.metas.shape[1])\n\n    def test_titanic(self):\n        \"\"\"\n        Titanic is a data-set with many 0 in k-nearest neighbours and thus some\n        manipulation is required to set cut-point.\n        This test checks whether widget works on those type of data.\n        \"\"\"\n        w = self.widget\n        data = Table(\"titanic\")\n        self.send_signal(w.Inputs.data, data)\n\n    def test_missing_data(self):\n        w = self.widget\n        self.iris[1:5, 1] = np.nan\n        self.send_signal(w.Inputs.data, self.iris)\n        output = self.get_output(w.Outputs.annotated_data)\n        self.assertTupleEqual((150, 1), output[:, \"Cluster\"].metas.shape)\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpnep2mhep/tmp\ncreating /tmp/tmpnep2mhep/tmp/tmpnep2mhep\ncompile options: '-MMD -MF /tmp/tmpnep2mhep/file.c.d -c'\ncc: /tmp/tmpnep2mhep/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpcbt15b4x/tmp\ncreating /tmp/tmpcbt15b4x/tmp/tmpcbt15b4x\ncompile options: '-MMD -MF /tmp/tmpcbt15b4x/file.c.d -c'\ncc: /tmp/tmpcbt15b4x/file.c\ncustomize UnixCCompiler using build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_simple_tree.c\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 Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_tree_scorers.c\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 Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_valuecount.c\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 Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_contingency.c\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 Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_io.c\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 Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_variable.c\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 Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/distance/_distance.c\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 Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/preprocess/_discretize.c\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 Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/preprocess/_relieff.cpp\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 Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/projection/_som.c\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 Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/widgets/utils/_grid_density.cpp\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 Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nrunning develop\nrunning build_scripts\nrunning egg_info\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\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'\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 '*.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 'COPYING'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpkpp_9e4j/tmp\ncreating /tmp/tmpkpp_9e4j/tmp/tmpkpp_9e4j\ncompile options: '-MMD -MF /tmp/tmpkpp_9e4j/file.c.d -c'\ncc: /tmp/tmpkpp_9e4j/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmp1qc_6px4/tmp\ncreating /tmp/tmp1qc_6px4/tmp/tmp1qc_6px4\ncompile options: '-MMD -MF /tmp/tmp1qc_6px4/file.c.d -c'\ncc: /tmp/tmp1qc_6px4/file.c\ncustomize UnixCCompiler using build_ext\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.26.0.dev0+3be8d0e to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e\nProcessing dependencies for Orange3==3.26.0.dev0+3be8d0e\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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for setuptools==59.8.0\nBest match: setuptools 59.8.0\nAdding setuptools 59.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for scipy==1.7.3\nBest match: scipy 1.7.3\nAdding scipy 1.7.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==0.22.2.post1\nBest match: scikit-learn 0.22.2.post1\nAdding scikit-learn 0.22.2.post1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for requests==2.31.0\nBest match: requests 2.31.0\nAdding requests 2.31.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for PyYAML==6.0.1\nBest match: PyYAML 6.0.1\nAdding PyYAML 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.4\nBest match: pyqtgraph 0.12.4\nAdding pyqtgraph 0.12.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for pip==24.0\nBest match: pip 24.0\nAdding pip 24.0 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for pandas==1.3.5\nBest match: pandas 1.3.5\nAdding pandas 1.3.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for openpyxl==3.1.3\nBest match: openpyxl 3.1.3\nAdding openpyxl 3.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for numpy==1.17.5\nBest match: numpy 1.17.5\nAdding numpy 1.17.5 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for networkx==2.6.3\nBest match: networkx 2.6.3\nAdding networkx 2.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for matplotlib==3.5.3\nBest match: matplotlib 3.5.3\nAdding matplotlib 3.5.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for keyrings.alt==4.2.0\nBest match: keyrings.alt 4.2.0\nAdding keyrings.alt 4.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for keyring==24.1.1\nBest match: keyring 24.1.1\nAdding keyring 24.1.1 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for joblib==1.3.2\nBest match: joblib 1.3.2\nAdding joblib 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for httpx==0.24.1\nBest match: httpx 0.24.1\nAdding httpx 0.24.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for urllib3==2.0.7\nBest match: urllib3 2.0.7\nAdding urllib3 2.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for typing-extensions==4.7.1\nBest match: typing-extensions 4.7.1\nAdding typing-extensions 4.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for requests-cache==1.1.1\nBest match: requests-cache 1.1.1\nAdding requests-cache 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for importlib-metadata==6.7.0\nBest match: importlib-metadata 6.7.0\nAdding importlib-metadata 6.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for qasync==0.25.0\nBest match: qasync 0.25.0\nAdding qasync 0.25.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for packaging==24.0\nBest match: packaging 24.0\nAdding packaging 24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for et-xmlfile==1.1.0\nBest match: et-xmlfile 1.1.0\nAdding et-xmlfile 1.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for kiwisolver==1.4.5\nBest match: kiwisolver 1.4.5\nAdding kiwisolver 1.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for Pillow==9.5.0\nBest match: Pillow 9.5.0\nAdding Pillow 9.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for fonttools==4.38.0\nBest match: fonttools 4.38.0\nAdding fonttools 4.38.0 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for cycler==0.11.0\nBest match: cycler 0.11.0\nAdding cycler 0.11.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for jaraco.classes==3.2.3\nBest match: jaraco.classes 3.2.3\nAdding jaraco.classes 3.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for importlib-resources==5.12.0\nBest match: importlib-resources 5.12.0\nAdding importlib-resources 5.12.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.17.3\nBest match: httpcore 0.17.3\nAdding httpcore 0.17.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for platformdirs==4.0.0\nBest match: platformdirs 4.0.0\nAdding platformdirs 4.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for cattrs==23.1.2\nBest match: cattrs 23.1.2\nAdding cattrs 23.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for attrs==24.2.0\nBest match: attrs 24.2.0\nAdding attrs 24.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for zipp==3.15.0\nBest match: zipp 3.15.0\nAdding zipp 3.15.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for more-itertools==9.1.0\nBest match: more-itertools 9.1.0\nAdding more-itertools 9.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for anyio==3.7.1\nBest match: anyio 3.7.1\nAdding anyio 3.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for cffi==1.15.1\nBest match: cffi 1.15.1\nAdding cffi 1.15.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nSearching for pycparser==2.21\nBest match: pycparser 2.21\nAdding pycparser 2.21 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.26.0.dev0+3be8d0e\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.7\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 90ms\nPrepared 18 packages in 22ms\nInstalled 18 packages in 90ms\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\nResolved 53 packages in 470ms\nInstalled 46 packages in 572ms\n + anyio==3.7.1\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + h11==0.14.0\n + httpcore==0.17.3\n + httpx==0.24.1\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\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.1\n + requests==2.31.0\n + scikit-learn==0.22.2.post1\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 34 packages in 120ms\nInstalled 13 packages in 339ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + platformdirs==4.0.0\n + pyqtgraph==0.12.4\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 3ms\nInstalled 2 packages in 5ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nAudited 1 package in 10ms\nAudited 2 packages in 12ms\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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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:3115:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3115 |   __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:4619:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4619 |   __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:5396:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5396 |           for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5517:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5517 |           __pyx_t_27 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5523:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5523 |           __pyx_t_27 = (((__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:7051:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7051 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7741:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7741 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7801:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7801 |               __pyx_t_17 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_18 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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:3881:24: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3881 |           __pyx_v_decs = (__pyx_v_decs / 10.0);\n      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:4070:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4070 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:480:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  480 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1301:7: note: ‘__pyx_v_attr_index’ was declared here\n 1301 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:2935:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2935 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:627:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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:3655:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3655 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3654:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3654 |   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:4547:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4547 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4114:7: note: ‘__pyx_v_win_y’ was declared here\n 4114 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4536:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4536 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4113:7: note: ‘__pyx_v_win_x’ was declared here\n 4113 |   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:4746:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4746 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4745:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4745 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3141:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3141 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:2964:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2964 |           *__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:2665:7: note: ‘__pyx_v_win_y’ was declared here\n 2665 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:2953:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2953 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2664:7: note: ‘__pyx_v_win_x’ was declared here\n 2664 |   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:5515:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5515 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5514:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5514 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.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_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e/.venv/lib/python3.7/site-packages/setuptools/command/egg_info.py:628: SetuptoolsDeprecationWarning: Custom 'build_py' does not implement 'get_data_files_without_manifest'.\nPlease extend command classes from setuptools instead of distutils.\n  SetuptoolsDeprecationWarning\n",
    "new_commit_res_code": 0,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e\nplugins: anyio-3.7.1\ncollected 20 items\n\nr2e_tests/test_1.py sss.................                                 [100%]\n\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_bad_input\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_change_eps\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_change_metric_idx\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_change_min_samples\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_cluster\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_data_none\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_get_kth_distances\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_image_export\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_large_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_metric_changed\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_missing_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_sparse_csc_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_sparse_csr_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_titanic\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_unique_domain\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\n======================== 17 passed, 3 skipped in 7.31s =========================\nWidgets left: 0    Max widgets: 1539 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_3be8d0eba7cc2f9704d65ea76938b63d3a57ca0e\nplugins: anyio-3.7.1\ncollected 20 items\n\nr2e_tests/test_1.py sss................F                                 [100%]\n\n=================================== FAILURES ===================================\n_______________________ TestOWDBSCAN.test_unique_domain ________________________\n\nself = <r2e_tests.test_1.TestOWDBSCAN testMethod=test_unique_domain>\n\n    def test_unique_domain(self):\n        w = self.widget\n        data = possible_duplicate_table(\"Cluster\")\n        self.send_signal(w.Inputs.data, data)\n        output = self.get_output(w.Outputs.annotated_data)\n>       self.assertEqual(output.domain.metas[0].name, \"Cluster (1)\")\nE       AssertionError: 'Cluster' != 'Cluster (1)'\nE       - Cluster\nE       + Cluster (1)\nE       ?        ++++\n\nr2e_tests/test_1.py:41: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_bad_input\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_change_eps\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_change_metric_idx\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_change_min_samples\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_cluster\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_data_none\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_get_kth_distances\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_image_export\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_large_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_metric_changed\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_missing_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_sparse_csc_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_sparse_csr_data\nPASSED r2e_tests/test_1.py::TestOWDBSCAN::test_titanic\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWDBSCAN::test_unique_domain - AssertionError...\n=================== 1 failed, 16 passed, 3 skipped in 5.67s ====================\nWidgets left: 0    Max widgets: 1654 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/unsupervised/owdbscan.py Orange/widgets/unsupervised/tests/test_owdbscan.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** OWDBSCAN Widget Fails to Assign Unique Meta Variable Names with Duplicate Attributes

**Description:**
When using the OWDBSCAN widget with datasets that contain duplicate attribute names, the widget does not assign unique names to the resulting meta variables. This leads to conflicts and unexpected behavior in subsequent processes that rely on these unique names.

For instance, when the input data includes multiple attributes named "Cluster", the widget is expected to rename them to ensure each meta variable has a distinct name. However, the current implementation maintains the original name, causing ambiguity.

**Example Buggy Code:**
```python
def test_duplicate_attribute_names():
    widget = OWDBSCAN()
    data = possible_duplicate_table("Cluster")  # Creates a table with duplicate "Cluster" attributes
    widget.send_signal(widget.Inputs.data, data)
    output = widget.get_output(widget.Outputs.annotated_data)
    print(output.domain.metas[0].name)  # Expected: "Cluster (1)"
                                       # Actual: "Cluster"
```

**Expected Behavior:**
Each meta variable in the output domain should have a unique name when the input data contains duplicate attribute names. In this case, the first meta variable should be renamed to "Cluster (1)" to differentiate it from others.

**Actual Behavior:**
The meta variable retains the original name "Cluster" instead of being renamed to "Cluster (1)", leading to naming conflicts and failed assertions in tests that expect unique names.

[/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/unsupervised/owdbscan.py
import sys

import numpy as np
from AnyQt.QtWidgets import QApplication
from AnyQt.QtGui import QColor
from sklearn.metrics import pairwise_distances

from Orange.preprocess import Normalize, Continuize, SklImpute
from Orange.widgets import widget, gui
from Orange.widgets.utils.slidergraph import SliderGraph
from Orange.widgets.settings import Setting
from Orange.data import Table, Domain, DiscreteVariable
from Orange.clustering import DBSCAN
from Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME
from Orange.widgets.utils.signals import Input, Output
from Orange.widgets.widget import Msg


DEFAULT_CUT_POINT = 0.1
PREPROCESSORS = [Continuize(), Normalize(), SklImpute()]
EPS_BOTTOM_LIMIT = 0.01


def get_kth_distances(data, metric, k=5):
    """
    The function computes the epsilon parameter for DBSCAN through method
    proposed in the paper.
    Parameters
    ----------
    data : Orange.data.Table
        Visualisation coordinates - embeddings
    metric : callable or str
        The metric to compute the distance.
    k : int
        Number kth observed neighbour

    Returns
    -------
    np.ndarray
        Epsilon parameter for DBSCAN
    """
    x = data.X
    if x.shape[0] > 1000:  # subsample
        x = x[np.random.randint(x.shape[0], size=1000), :]

    dist = pairwise_distances(x, metric=metric)
    k = min(k+1, len(data) - 1)  # k+1 since first one is item itself
    kth_point = np.argpartition(dist, k, axis=1)[:, k]
    kth_dist = np.sort(dist[np.arange(0, len(kth_point)), kth_point])[::-1]

    return kth_dist


class OWDBSCAN(widget.OWWidget):
    name = "DBSCAN"
    description = "Density-based spatial clustering."
    icon = "icons/DBSCAN.svg"
    priority = 2150

    class Inputs:
        data = Input("Data", Table)

    class Outputs:
        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)

    class Error(widget.OWWidget.Error):
        not_enough_instances = Msg("Not enough unique data instances. "
                                   "At least two are required.")

    METRICS = [
        ("Euclidean", "euclidean"),
        ("Manhattan", "cityblock"),
        ("Cosine", "cosine")
    ]

    min_samples = Setting(4)
    eps = Setting(0.5)
    metric_idx = Setting(0)
    auto_commit = Setting(True)
    k_distances = None
    cut_point = None

    def __init__(self):
        super().__init__()

        self.data = None
        self.data_normalized = None
        self.db = None
        self.model = None

        box = gui.widgetBox(self.controlArea, "Parameters")
        gui.spin(box, self, "min_samples", 1, 100, 1,
                 callback=self._min_samples_changed,
                 label="Core point neighbors")
        gui.doubleSpin(box, self, "eps", EPS_BOTTOM_LIMIT, 1000, 0.01,
                       callback=self._eps_changed,
                       label="Neighborhood distance")

        box = gui.widgetBox(self.controlArea, self.tr("Distance Metric"))
        gui.comboBox(box, self, "metric_idx",
                     items=list(zip(*self.METRICS))[0],
                     callback=self._metirc_changed)

        gui.auto_apply(self.controlArea, self, "auto_commit")
        gui.rubber(self.controlArea)

        self.controlArea.layout().addStretch()

        self.plot = SliderGraph(
            x_axis_label="Data items sorted by score",
            y_axis_label="Distance to the k-th nearest neighbour",
            callback=self._on_cut_changed
        )

        self.mainArea.layout().addWidget(self.plot)

    def check_data_size(self, data):
        if data is None:
            return False
        if len(data) < 2:
            self.Error.not_enough_instances()
            return False
        return True

    def commit(self):
        self.cluster()

    def cluster(self):
        if not self.check_data_size(self.data):
            return
        self.model = DBSCAN(
            eps=self.eps,
            min_samples=self.min_samples,
            metric=self.METRICS[self.metric_idx][1]
        ).get_model(self.data_normalized)
        self.send_data()

    def _compute_and_plot(self, cut_point=None):
        self._compute_kdistances()
        if cut_point is None:
            self._compute_cut_point()
        self._plot_graph()

    def _plot_graph(self):
        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)
        self.plot.update(np.arange(len(self.k_distances)),
                         [self.k_distances],
                         colors=[QColor('red')],
                         cutpoint_x=self.cut_point,
                         selection_limit=(0, nonzero - 1))

    def _compute_kdistances(self):
        self.k_distances = get_kth_distances(
            self.data_normalized, metric=self.METRICS[self.metric_idx][1],
            k=self.min_samples
        )

    def _compute_cut_point(self):
        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))
        self.eps = self.k_distances[self.cut_point]

        if self.eps < EPS_BOTTOM_LIMIT:
            self.eps = np.min(
                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])
            self.cut_point = self._find_nearest_dist(self.eps)

    @Inputs.data
    def set_data(self, data):
        self.Error.clear()
        if not self.check_data_size(data):
            data = None
        self.data = self.data_normalized = data
        if self.data is None:
            self.Outputs.annotated_data.send(None)
            self.plot.clear_plot()
            return

        if self.data is None:
            return

        # preprocess data
        for pp in PREPROCESSORS:
            self.data_normalized = pp(self.data_normalized)

        self._compute_and_plot()
        self.unconditional_commit()

    def send_data(self):
        model = self.model

        clusters = [c if c >= 0 else np.nan for c in model.labels]
        k = len(set(clusters) - {np.nan})
        clusters = np.array(clusters).reshape(len(self.data), 1)
        core_samples = set(model.projector.core_sample_indices_)
        in_core = np.array([1 if (i in core_samples) else 0
                            for i in range(len(self.data))])
        in_core = in_core.reshape(len(self.data), 1)

        clust_var = DiscreteVariable(
            "Cluster", values=["C%d" % (x + 1) for x in range(k)])
        in_core_var = DiscreteVariable("DBSCAN Core", values=("0", "1"))

        domain = self.data.domain
        attributes, classes = domain.attributes, domain.class_vars
        meta_attrs = domain.metas
        x, y, metas = self.data.X, self.data.Y, self.data.metas

        meta_attrs += (clust_var, )
        metas = np.hstack((metas, clusters))
        meta_attrs += (in_core_var, )
        metas = np.hstack((metas, in_core))

        domain = Domain(attributes, classes, meta_attrs)
        new_table = Table(domain, x, y, metas, self.data.W)

        self.Outputs.annotated_data.send(new_table)

    def _invalidate(self):
        self.commit()

    def _find_nearest_dist(self, value):
        array = np.asarray(self.k_distances)
        idx = (np.abs(array - value)).argmin()
        return idx

    def _eps_changed(self):
        # find the closest value to eps
        if self.data is None:
            return
        self.cut_point = self._find_nearest_dist(self.eps)
        self.plot.set_cut_point(self.cut_point)
        self._invalidate()

    def _metirc_changed(self):
        if self.data is not None:
            self._compute_and_plot()
            self._invalidate()

    def _on_cut_changed(self, value):
        # cut changed by means of a cut line over the scree plot.
        self.cut_point = value
        self.eps = self.k_distances[value]

        self.commit()

    def _min_samples_changed(self):
        if self.data is None:
            return
        self._compute_and_plot(cut_point=self.cut_point)
        self._invalidate()


if __name__ == "__main__":
    a = QApplication(sys.argv)
    ow = OWDBSCAN()
    d = Table("iris.tab")
    ow.set_data(d)
    ow.show()
    a.exec()
    ow.saveSettings()

```
--- 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:** OWDBSCAN Widget Fails to Assign Unique Meta Variable Names with Duplicate Attributes

**Description:**
When using the OWDBSCAN widget with datasets that contain duplicate attribute names, the widget does not assign unique names to the resulting meta variables. This leads to conflicts and unexpected behavior in subsequent processes that rely on these unique names.

For instance, when the input data includes multiple attributes named "Cluster", the widget is expected to rename them to ensure each meta variable has a distinct name. However, the current implementation maintains the original name, causing ambiguity.

**Example Buggy Code:**
```python
def test_duplicate_attribute_names():
    widget = OWDBSCAN()
    data = possible_duplicate_table("Cluster")  # Creates a table with duplicate "Cluster" attributes
    widget.send_signal(widget.Inputs.data, data)
    output = widget.get_output(widget.Outputs.annotated_data)
    print(output.domain.metas[0].name)  # Expected: "Cluster (1)"
                                       # Actual: "Cluster"
```

**Expected Behavior:**
Each meta variable in the output domain should have a unique name when the input data contains duplicate attribute names. In this case, the first meta variable should be renamed to "Cluster (1)" to differentiate it from others.

**Actual Behavior:**
The meta variable retains the original name "Cluster" instead of being renamed to "Cluster (1)", leading to naming conflicts and failed assertions in tests that expect unique names.

[/ISSUE]
{
    "TestOWDBSCAN.test_bad_input": "PASSED",
    "TestOWDBSCAN.test_change_eps": "PASSED",
    "TestOWDBSCAN.test_change_metric_idx": "PASSED",
    "TestOWDBSCAN.test_change_min_samples": "PASSED",
    "TestOWDBSCAN.test_cluster": "PASSED",
    "TestOWDBSCAN.test_data_none": "PASSED",
    "TestOWDBSCAN.test_get_kth_distances": "PASSED",
    "TestOWDBSCAN.test_image_export": "PASSED",
    "TestOWDBSCAN.test_large_data": "PASSED",
    "TestOWDBSCAN.test_metric_changed": "PASSED",
    "TestOWDBSCAN.test_minimum_size": "PASSED",
    "TestOWDBSCAN.test_missing_data": "PASSED",
    "TestOWDBSCAN.test_msg_base_class": "PASSED",
    "TestOWDBSCAN.test_sparse_csc_data": "PASSED",
    "TestOWDBSCAN.test_sparse_csr_data": "PASSED",
    "TestOWDBSCAN.test_titanic": "PASSED",
    "TestOWDBSCAN.test_unique_domain": "PASSED"
}
diff --git a/Orange/widgets/unsupervised/owdbscan.py b/Orange/widgets/unsupervised/owdbscan.py
index 8253ceb18..d5cf64292 100644
--- a/Orange/widgets/unsupervised/owdbscan.py
+++ b/Orange/widgets/unsupervised/owdbscan.py
@@ -1,4 +1,5 @@
 import sys
+from itertools import chain
 
 import numpy as np
 from AnyQt.QtWidgets import QApplication
@@ -10,6 +11,7 @@ from Orange.widgets import widget, gui
 from Orange.widgets.utils.slidergraph import SliderGraph
 from Orange.widgets.settings import Setting
 from Orange.data import Table, Domain, DiscreteVariable
+from Orange.data.util import get_unique_names
 from Orange.clustering import DBSCAN
 from Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME
 from Orange.widgets.utils.signals import Input, Output
@@ -196,13 +198,18 @@ class OWDBSCAN(widget.OWWidget):
                             for i in range(len(self.data))])
         in_core = in_core.reshape(len(self.data), 1)
 
-        clust_var = DiscreteVariable(
-            "Cluster", values=["C%d" % (x + 1) for x in range(k)])
-        in_core_var = DiscreteVariable("DBSCAN Core", values=("0", "1"))
-
         domain = self.data.domain
         attributes, classes = domain.attributes, domain.class_vars
         meta_attrs = domain.metas
+        names = [var.name for var in chain(attributes, classes, meta_attrs) if var]
+
+        u_clust_var = get_unique_names(names, "Cluster")
+        clust_var = DiscreteVariable(
+            u_clust_var, values=["C%d" % (x + 1) for x in range(k)])
+
+        u_in_core = get_unique_names(names + [u_clust_var], "DBSCAN Core")
+        in_core_var = DiscreteVariable(u_in_core, values=("0", "1"))
+
         x, y, metas = self.data.X, self.data.Y, self.data.metas
 
         meta_attrs += (clust_var, )

{"Orange/widgets/unsupervised/owdbscan.py": "import sys\n\nimport numpy as np\nfrom AnyQt.QtWidgets import QApplication\nfrom AnyQt.QtGui import QColor\nfrom sklearn.metrics import pairwise_distances\n\nfrom Orange.preprocess import Normalize, Continuize, SklImpute\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.utils.slidergraph import SliderGraph\nfrom Orange.widgets.settings import Setting\nfrom Orange.data import Table, Domain, DiscreteVariable\nfrom Orange.clustering import DBSCAN\nfrom Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME\nfrom Orange.widgets.utils.signals import Input, Output\nfrom Orange.widgets.widget import Msg\n\n\nDEFAULT_CUT_POINT = 0.1\nPREPROCESSORS = [Continuize(), Normalize(), SklImpute()]\nEPS_BOTTOM_LIMIT = 0.01\n\n\ndef get_kth_distances(data, metric, k=5):\n    \"\"\"\n    The function computes the epsilon parameter for DBSCAN through method\n    proposed in the paper.\n    Parameters\n    ----------\n    data : Orange.data.Table\n        Visualisation coordinates - embeddings\n    metric : callable or str\n        The metric to compute the distance.\n    k : int\n        Number kth observed neighbour\n\n    Returns\n    -------\n    np.ndarray\n        Epsilon parameter for DBSCAN\n    \"\"\"\n    x = data.X\n    if x.shape[0] > 1000:  # subsample\n        x = x[np.random.randint(x.shape[0], size=1000), :]\n\n    dist = pairwise_distances(x, metric=metric)\n    k = min(k+1, len(data) - 1)  # k+1 since first one is item itself\n    kth_point = np.argpartition(dist, k, axis=1)[:, k]\n    kth_dist = np.sort(dist[np.arange(0, len(kth_point)), kth_point])[::-1]\n\n    return kth_dist\n\n\nclass OWDBSCAN(widget.OWWidget):\n    name = \"DBSCAN\"\n    description = \"Density-based spatial clustering.\"\n    icon = \"icons/DBSCAN.svg\"\n    priority = 2150\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    class Error(widget.OWWidget.Error):\n        not_enough_instances = Msg(\"Not enough unique data instances. \"\n                                   \"At least two are required.\")\n\n    METRICS = [\n        (\"Euclidean\", \"euclidean\"),\n        (\"Manhattan\", \"cityblock\"),\n        (\"Cosine\", \"cosine\")\n    ]\n\n    min_samples = Setting(4)\n    eps = Setting(0.5)\n    metric_idx = Setting(0)\n    auto_commit = Setting(True)\n    k_distances = None\n    cut_point = None\n\n    def __init__(self):\n        super().__init__()\n\n        self.data = None\n        self.data_normalized = None\n        self.db = None\n        self.model = None\n\n        box = gui.widgetBox(self.controlArea, \"Parameters\")\n        gui.spin(box, self, \"min_samples\", 1, 100, 1,\n                 callback=self._min_samples_changed,\n                 label=\"Core point neighbors\")\n        gui.doubleSpin(box, self, \"eps\", EPS_BOTTOM_LIMIT, 1000, 0.01,\n                       callback=self._eps_changed,\n                       label=\"Neighborhood distance\")\n\n        box = gui.widgetBox(self.controlArea, self.tr(\"Distance Metric\"))\n        gui.comboBox(box, self, \"metric_idx\",\n                     items=list(zip(*self.METRICS))[0],\n                     callback=self._metirc_changed)\n\n        gui.auto_apply(self.controlArea, self, \"auto_commit\")\n        gui.rubber(self.controlArea)\n\n        self.controlArea.layout().addStretch()\n\n        self.plot = SliderGraph(\n            x_axis_label=\"Data items sorted by score\",\n            y_axis_label=\"Distance to the k-th nearest neighbour\",\n            callback=self._on_cut_changed\n        )\n\n        self.mainArea.layout().addWidget(self.plot)\n\n    def check_data_size(self, data):\n        if data is None:\n            return False\n        if len(data) < 2:\n            self.Error.not_enough_instances()\n            return False\n        return True\n\n    def commit(self):\n        self.cluster()\n\n    def cluster(self):\n        if not self.check_data_size(self.data):\n            return\n        self.model = DBSCAN(\n            eps=self.eps,\n            min_samples=self.min_samples,\n            metric=self.METRICS[self.metric_idx][1]\n        ).get_model(self.data_normalized)\n        self.send_data()\n\n    def _compute_and_plot(self, cut_point=None):\n        self._compute_kdistances()\n        if cut_point is None:\n            self._compute_cut_point()\n        self._plot_graph()\n\n    def _plot_graph(self):\n        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)\n        self.plot.update(np.arange(len(self.k_distances)),\n                         [self.k_distances],\n                         colors=[QColor('red')],\n                         cutpoint_x=self.cut_point,\n                         selection_limit=(0, nonzero - 1))\n\n    def _compute_kdistances(self):\n        self.k_distances = get_kth_distances(\n            self.data_normalized, metric=self.METRICS[self.metric_idx][1],\n            k=self.min_samples\n        )\n\n    def _compute_cut_point(self):\n        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))\n        self.eps = self.k_distances[self.cut_point]\n\n        if self.eps < EPS_BOTTOM_LIMIT:\n            self.eps = np.min(\n                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])\n            self.cut_point = self._find_nearest_dist(self.eps)\n\n    @Inputs.data\n    def set_data(self, data):\n        self.Error.clear()\n        if not self.check_data_size(data):\n            data = None\n        self.data = self.data_normalized = data\n        if self.data is None:\n            self.Outputs.annotated_data.send(None)\n            self.plot.clear_plot()\n            return\n\n        if self.data is None:\n            return\n\n        # preprocess data\n        for pp in PREPROCESSORS:\n            self.data_normalized = pp(self.data_normalized)\n\n        self._compute_and_plot()\n        self.unconditional_commit()\n\n    def send_data(self):\n        model = self.model\n\n        clusters = [c if c >= 0 else np.nan for c in model.labels]\n        k = len(set(clusters) - {np.nan})\n        clusters = np.array(clusters).reshape(len(self.data), 1)\n        core_samples = set(model.projector.core_sample_indices_)\n        in_core = np.array([1 if (i in core_samples) else 0\n                            for i in range(len(self.data))])\n        in_core = in_core.reshape(len(self.data), 1)\n\n        clust_var = DiscreteVariable(\n            \"Cluster\", values=[\"C%d\" % (x + 1) for x in range(k)])\n        in_core_var = DiscreteVariable(\"DBSCAN Core\", values=(\"0\", \"1\"))\n\n        domain = self.data.domain\n        attributes, classes = domain.attributes, domain.class_vars\n        meta_attrs = domain.metas\n        x, y, metas = self.data.X, self.data.Y, self.data.metas\n\n        meta_attrs += (clust_var, )\n        metas = np.hstack((metas, clusters))\n        meta_attrs += (in_core_var, )\n        metas = np.hstack((metas, in_core))\n\n        domain = Domain(attributes, classes, meta_attrs)\n        new_table = Table(domain, x, y, metas, self.data.W)\n\n        self.Outputs.annotated_data.send(new_table)\n\n    def _invalidate(self):\n        self.commit()\n\n    def _find_nearest_dist(self, value):\n        array = np.asarray(self.k_distances)\n        idx = (np.abs(array - value)).argmin()\n        return idx\n\n    def _eps_changed(self):\n        # find the closest value to eps\n        if self.data is None:\n            return\n        self.cut_point = self._find_nearest_dist(self.eps)\n        self.plot.set_cut_point(self.cut_point)\n        self._invalidate()\n\n    def _metirc_changed(self):\n        if self.data is not None:\n            self._compute_and_plot()\n            self._invalidate()\n\n    def _on_cut_changed(self, value):\n        # cut changed by means of a cut line over the scree plot.\n        self.cut_point = value\n        self.eps = self.k_distances[value]\n\n        self.commit()\n\n    def _min_samples_changed(self):\n        if self.data is None:\n            return\n        self._compute_and_plot(cut_point=self.cut_point)\n        self._invalidate()\n\n\nif __name__ == \"__main__\":\n    a = QApplication(sys.argv)\n    ow = OWDBSCAN()\n    d = Table(\"iris.tab\")\n    ow.set_data(d)\n    ow.show()\n    a.exec()\n    ow.saveSettings()\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:** OWDBSCAN Widget Fails to Assign Unique Meta Variable Names with Duplicate Attributes

**Description:**
When using the OWDBSCAN widget with datasets that contain duplicate attribute names, the widget does not assign unique names to the resulting meta variables. This leads to conflicts and unexpected behavior in subsequent processes that rely on these unique names.

For instance, when the input data includes multiple attributes named "Cluster", the widget is expected to rename them to ensure each meta variable has a distinct name. However, the current implementation maintains the original name, causing ambiguity.

**Example Buggy Code:**
```python
def test_duplicate_attribute_names():
    widget = OWDBSCAN()
    data = possible_duplicate_table("Cluster")  # Creates a table with duplicate "Cluster" attributes
    widget.send_signal(widget.Inputs.data, data)
    output = widget.get_output(widget.Outputs.annotated_data)
    print(output.domain.metas[0].name)  # Expected: "Cluster (1)"
                                       # Actual: "Cluster"
```

**Expected Behavior:**
Each meta variable in the output domain should have a unique name when the input data contains duplicate attribute names. In this case, the first meta variable should be renamed to "Cluster (1)" to differentiate it from others.

**Actual Behavior:**
The meta variable retains the original name "Cluster" instead of being renamed to "Cluster (1)", leading to naming conflicts and failed assertions in tests that expect unique names.

[/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/unsupervised/owdbscan.py
import sys

import numpy as np
from AnyQt.QtWidgets import QApplication
from AnyQt.QtGui import QColor
from sklearn.metrics import pairwise_distances

from Orange.preprocess import Normalize, Continuize, SklImpute
from Orange.widgets import widget, gui
from Orange.widgets.utils.slidergraph import SliderGraph
from Orange.widgets.settings import Setting
from Orange.data import Table, Domain, DiscreteVariable
from Orange.clustering import DBSCAN
from Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME
from Orange.widgets.utils.signals import Input, Output
from Orange.widgets.widget import Msg


DEFAULT_CUT_POINT = 0.1
PREPROCESSORS = [Continuize(), Normalize(), SklImpute()]
EPS_BOTTOM_LIMIT = 0.01


def get_kth_distances(data, metric, k=5):
    """
    The function computes the epsilon parameter for DBSCAN through method
    proposed in the paper.
    Parameters
    ----------
    data : Orange.data.Table
        Visualisation coordinates - embeddings
    metric : callable or str
        The metric to compute the distance.
    k : int
        Number kth observed neighbour

    Returns
    -------
    np.ndarray
        Epsilon parameter for DBSCAN
    """
    x = data.X
    if x.shape[0] > 1000:  # subsample
        x = x[np.random.randint(x.shape[0], size=1000), :]

    dist = pairwise_distances(x, metric=metric)
    k = min(k+1, len(data) - 1)  # k+1 since first one is item itself
    kth_point = np.argpartition(dist, k, axis=1)[:, k]
    kth_dist = np.sort(dist[np.arange(0, len(kth_point)), kth_point])[::-1]

    return kth_dist


class OWDBSCAN(widget.OWWidget):
    name = "DBSCAN"
    description = "Density-based spatial clustering."
    icon = "icons/DBSCAN.svg"
    priority = 2150

    class Inputs:
        data = Input("Data", Table)

    class Outputs:
        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)

    class Error(widget.OWWidget.Error):
        not_enough_instances = Msg("Not enough unique data instances. "
                                   "At least two are required.")

    METRICS = [
        ("Euclidean", "euclidean"),
        ("Manhattan", "cityblock"),
        ("Cosine", "cosine")
    ]

    min_samples = Setting(4)
    eps = Setting(0.5)
    metric_idx = Setting(0)
    auto_commit = Setting(True)
    k_distances = None
    cut_point = None

    def __init__(self):
        super().__init__()

        self.data = None
        self.data_normalized = None
        self.db = None
        self.model = None

        box = gui.widgetBox(self.controlArea, "Parameters")
        gui.spin(box, self, "min_samples", 1, 100, 1,
                 callback=self._min_samples_changed,
                 label="Core point neighbors")
        gui.doubleSpin(box, self, "eps", EPS_BOTTOM_LIMIT, 1000, 0.01,
                       callback=self._eps_changed,
                       label="Neighborhood distance")

        box = gui.widgetBox(self.controlArea, self.tr("Distance Metric"))
        gui.comboBox(box, self, "metric_idx",
                     items=list(zip(*self.METRICS))[0],
                     callback=self._metirc_changed)

        gui.auto_apply(self.controlArea, self, "auto_commit")
        gui.rubber(self.controlArea)

        self.controlArea.layout().addStretch()

        self.plot = SliderGraph(
            x_axis_label="Data items sorted by score",
            y_axis_label="Distance to the k-th nearest neighbour",
            callback=self._on_cut_changed
        )

        self.mainArea.layout().addWidget(self.plot)

    def check_data_size(self, data):
        if data is None:
            return False
        if len(data) < 2:
            self.Error.not_enough_instances()
            return False
        return True

    def commit(self):
        self.cluster()

    def cluster(self):
        if not self.check_data_size(self.data):
            return
        self.model = DBSCAN(
            eps=self.eps,
            min_samples=self.min_samples,
            metric=self.METRICS[self.metric_idx][1]
        ).get_model(self.data_normalized)
        self.send_data()

    def _compute_and_plot(self, cut_point=None):
        self._compute_kdistances()
        if cut_point is None:
            self._compute_cut_point()
        self._plot_graph()

    def _plot_graph(self):
        nonzero = np.sum(self.k_distances > EPS_BOTTOM_LIMIT)
        self.plot.update(np.arange(len(self.k_distances)),
                         [self.k_distances],
                         colors=[QColor('red')],
                         cutpoint_x=self.cut_point,
                         selection_limit=(0, nonzero - 1))

    def _compute_kdistances(self):
        self.k_distances = get_kth_distances(
            self.data_normalized, metric=self.METRICS[self.metric_idx][1],
            k=self.min_samples
        )

    def _compute_cut_point(self):
        self.cut_point = int(DEFAULT_CUT_POINT * len(self.k_distances))
        self.eps = self.k_distances[self.cut_point]

        if self.eps < EPS_BOTTOM_LIMIT:
            self.eps = np.min(
                self.k_distances[self.k_distances >= EPS_BOTTOM_LIMIT])
            self.cut_point = self._find_nearest_dist(self.eps)

    @Inputs.data
    def set_data(self, data):
        self.Error.clear()
        if not self.check_data_size(data):
            data = None
        self.data = self.data_normalized = data
        if self.data is None:
            self.Outputs.annotated_data.send(None)
            self.plot.clear_plot()
            return

        if self.data is None:
            return

        # preprocess data
        for pp in PREPROCESSORS:
            self.data_normalized = pp(self.data_normalized)

        self._compute_and_plot()
        self.unconditional_commit()

    def send_data(self):
        model = self.model

        clusters = [c if c >= 0 else np.nan for c in model.labels]
        k = len(set(clusters) - {np.nan})
        clusters = np.array(clusters).reshape(len(self.data), 1)
        core_samples = set(model.projector.core_sample_indices_)
        in_core = np.array([1 if (i in core_samples) else 0
                            for i in range(len(self.data))])
        in_core = in_core.reshape(len(self.data), 1)

        clust_var = DiscreteVariable(
            "Cluster", values=["C%d" % (x + 1) for x in range(k)])
        in_core_var = DiscreteVariable("DBSCAN Core", values=("0", "1"))

        domain = self.data.domain
        attributes, classes = domain.attributes, domain.class_vars
        meta_attrs = domain.metas
        x, y, metas = self.data.X, self.data.Y, self.data.metas

        meta_attrs += (clust_var, )
        metas = np.hstack((metas, clusters))
        meta_attrs += (in_core_var, )
        metas = np.hstack((metas, in_core))

        domain = Domain(attributes, classes, meta_attrs)
        new_table = Table(domain, x, y, metas, self.data.W)

        self.Outputs.annotated_data.send(new_table)

    def _invalidate(self):
        self.commit()

    def _find_nearest_dist(self, value):
        array = np.asarray(self.k_distances)
        idx = (np.abs(array - value)).argmin()
        return idx

    def _eps_changed(self):
        # find the closest value to eps
        if self.data is None:
            return
        self.cut_point = self._find_nearest_dist(self.eps)
        self.plot.set_cut_point(self.cut_point)
        self._invalidate()

    def _metirc_changed(self):
        if self.data is not None:
            self._compute_and_plot()
            self._invalidate()

    def _on_cut_changed(self, value):
        # cut changed by means of a cut line over the scree plot.
        self.cut_point = value
        self.eps = self.k_distances[value]

        self.commit()

    def _min_samples_changed(self):
        if self.data is None:
            return
        self._compute_and_plot(cut_point=self.cut_point)
        self._invalidate()


if __name__ == "__main__":
    a = QApplication(sys.argv)
    ow = OWDBSCAN()
    d = Table("iris.tab")
    ow.set_data(d)
    ow.show()
    a.exec()
    ow.saveSettings()

```
--- 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