{
    "file_diffs": [
        {
            "old_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.utils.state_summary import format_summary_details\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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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, 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.utils.state_summary import format_summary_details\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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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)\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\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        new_table = self.data.add_column(clust_var, clusters, to_metas=True)\n        new_table = new_table.add_column(in_core_var, in_core, to_metas=True)\n\n        self._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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": "c4cd4eabc",
                "new_commit_hash": "82f742a06",
                "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": 10,
                            "length": 7
                        },
                        "new_range": {
                            "start": 10,
                            "length": 7
                        },
                        "section": "from Orange.preprocess import Normalize, Continuize, SklImpute"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from Orange.widgets import widget, gui",
                                "type": "context"
                            },
                            {
                                "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": "deleted"
                            },
                            {
                                "content": "from Orange.data import Table, DiscreteVariable",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.data.util import get_unique_names",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.clustering import DBSCAN",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owdbscan.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.data import Table, DiscreteVariable",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 13,
                            "end_lineno": 13,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owdbscan.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.data import Table, Domain, DiscreteVariable",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 13,
                            "end_lineno": 13,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 197,
                            "length": 11
                        },
                        "new_range": {
                            "start": 197,
                            "length": 10
                        },
                        "section": "class OWDBSCAN(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        clusters = [c if c >= 0 else np.nan for c in model.labels]",
                                "type": "context"
                            },
                            {
                                "content": "        k = len(set(clusters) - {np.nan})",
                                "type": "context"
                            },
                            {
                                "content": "        clusters = np.array(clusters).reshape(len(self.data), 1)",
                                "type": "deleted"
                            },
                            {
                                "content": "        clusters = np.array(clusters)",
                                "type": "added"
                            },
                            {
                                "content": "        core_samples = set(model.projector.core_sample_indices_)",
                                "type": "context"
                            },
                            {
                                "content": "        in_core = np.array([1 if (i in core_samples) else 0",
                                "type": "context"
                            },
                            {
                                "content": "                            for i in range(len(self.data))])",
                                "type": "context"
                            },
                            {
                                "content": "        in_core = in_core.reshape(len(self.data), 1)",
                                "type": "deleted"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        domain = self.data.domain",
                                "type": "context"
                            },
                            {
                                "content": "        attributes, classes = domain.attributes, domain.class_vars",
                                "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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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": 195,
                            "end_lineno": 229,
                            "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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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": 57,
                                "end_lineno": 273,
                                "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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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": 57,
                            "end_lineno": 273,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 215,
                            "length": 15
                        },
                        "new_range": {
                            "start": 214,
                            "length": 8
                        },
                        "section": "class OWDBSCAN(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        u_in_core = get_unique_names(names + [u_clust_var], \"DBSCAN Core\")",
                                "type": "context"
                            },
                            {
                                "content": "        in_core_var = DiscreteVariable(u_in_core, values=(\"0\", \"1\"))",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        x, y, metas = self.data.X, self.data.Y, self.data.metas",
                                "type": "deleted"
                            },
                            {
                                "content": "",
                                "type": "deleted"
                            },
                            {
                                "content": "        meta_attrs += (clust_var, )",
                                "type": "deleted"
                            },
                            {
                                "content": "        metas = np.hstack((metas, clusters))",
                                "type": "deleted"
                            },
                            {
                                "content": "        meta_attrs += (in_core_var, )",
                                "type": "deleted"
                            },
                            {
                                "content": "        metas = np.hstack((metas, in_core))",
                                "type": "deleted"
                            },
                            {
                                "content": "",
                                "type": "deleted"
                            },
                            {
                                "content": "        domain = Domain(attributes, classes, meta_attrs)",
                                "type": "deleted"
                            },
                            {
                                "content": "        new_table = Table(domain, x, y, metas, self.data.W)",
                                "type": "deleted"
                            },
                            {
                                "content": "        new_table = self.data.add_column(clust_var, clusters, to_metas=True)",
                                "type": "added"
                            },
                            {
                                "content": "        new_table = new_table.add_column(in_core_var, in_core, to_metas=True)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self._set_output_summary(new_table)",
                                "type": "context"
                            },
                            {
                                "content": "        self.Outputs.annotated_data.send(new_table)",
                                "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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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": 195,
                            "end_lineno": 229,
                            "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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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": 57,
                                "end_lineno": 273,
                                "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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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": 57,
                            "end_lineno": 273,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# pylint: disable=protected-access\nimport numpy as np\nfrom scipy.sparse import csr_matrix, csc_matrix\n\nfrom orangewidget.widget import StateInfo\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\nfrom Orange.widgets.utils.state_summary import format_summary_details\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\n    def test_summary(self):\n        \"\"\"Check if the status bar updates when data on input\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        summary, details = f\"{len(self.iris)}\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n",
            "new_file_content": "# pylint: disable=protected-access\nimport numpy as np\nfrom scipy.sparse import csr_matrix, csc_matrix\n\nfrom orangewidget.widget import StateInfo\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\nfrom Orange.widgets.utils.state_summary import format_summary_details\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_data_retain_ids(self):\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        np.testing.assert_array_equal(self.iris.ids, output.ids)\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\n    def test_summary(self):\n        \"\"\"Check if the status bar updates when data on input\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        summary, details = f\"{len(self.iris)}\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/unsupervised/tests/test_owdbscan.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "dc620cc3e",
                "new_commit_hash": "c7e434c1d",
                "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": 218,
                            "length": 6
                        },
                        "new_range": {
                            "start": 218,
                            "length": 11
                        },
                        "section": "class TestOWDBSCAN(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        data = Table(\"titanic\")",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, data)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_data_retain_ids(self):",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, self.iris)",
                                "type": "added"
                            },
                            {
                                "content": "        output = self.get_output(self.widget.Outputs.annotated_data)",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_array_equal(self.iris.ids, output.ids)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_missing_data(self):",
                                "type": "context"
                            },
                            {
                                "content": "        w = self.widget",
                                "type": "context"
                            },
                            {
                                "content": "        self.iris[1:5, 1] = np.nan",
                                "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_data_retain_ids(self):\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        np.testing.assert_array_equal(self.iris.ids, output.ids)\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\n    def test_summary(self):\n        \"\"\"Check if the status bar updates when data on input\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        summary, details = f\"{len(self.iris)}\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 15,
                            "end_lineno": 251,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owdbscan.py",
                            "type": "method",
                            "name": "TestOWDBSCAN.test_data_retain_ids",
                            "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_data_retain_ids(self):\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        np.testing.assert_array_equal(self.iris.ids, output.ids)\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\n    def test_summary(self):\n        \"\"\"Check if the status bar updates when data on input\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        summary, details = f\"{len(self.iris)}\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 221,
                            "end_lineno": 224,
                            "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_data_retain_ids(self):\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        np.testing.assert_array_equal(self.iris.ids, output.ids)\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\n    def test_summary(self):\n        \"\"\"Check if the status bar updates when data on input\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        summary, details = f\"{len(self.iris)}\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 15,
                                "end_lineno": 251,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e^",
    "new_commit_hash": "d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e",
    "commit_message": "Merge pull request #5423 from VesnaT/dbscan_fix_ids\n\nDBSCAN: Retain data ids",
    "commit_date": "2021-05-06T10:38:32+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e",
    "test_file_codes": [
        "# pylint: disable=protected-access\nimport numpy as np\nfrom scipy.sparse import csr_matrix, csc_matrix\n\nfrom orangewidget.widget import StateInfo\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\nfrom Orange.widgets.utils.state_summary import format_summary_details\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_data_retain_ids(self):\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        np.testing.assert_array_equal(self.iris.ids, output.ids)\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\n    def test_summary(self):\n        \"\"\"Check if the status bar updates when data on input\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        summary, details = f\"{len(self.iris)}\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\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\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_contingency.c -o build/temp.linux-x86_64-3.7/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-3.7/Orange/data\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_io.c -o build/temp.linux-x86_64-3.7/Orange/data/_io.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_variable.c -o build/temp.linux-x86_64-3.7/Orange/data/_variable.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/distance/_distance.c -o build/temp.linux-x86_64-3.7/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-3.7/Orange/distance\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._simple_tree' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.29.0.dev0+d4e259f to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e\nProcessing dependencies for Orange3==3.29.0.dev0+d4e259f\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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==1.0.2\nBest match: scikit-learn 1.0.2\nAdding scikit-learn 1.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for httpx==0.16.1\nBest match: httpx 0.16.1\nAdding httpx 0.16.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine==5.15.6\nBest match: PyQtWebEngine 5.15.6\nAdding PyQtWebEngine 5.15.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for PyQt5==5.15.10\nBest match: PyQt5 5.15.10\nAdding PyQt5 5.15.10 to easy-install.pth file\nInstalling pylupdate5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling pyrcc5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling pyuic5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for threadpoolctl==3.1.0\nBest match: threadpoolctl 3.1.0\nAdding threadpoolctl 3.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for rfc3986==1.5.0\nBest match: rfc3986 1.5.0\nAdding rfc3986 1.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.12.3\nBest match: httpcore 0.12.3\nAdding httpcore 0.12.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine-Qt5==5.15.16\nBest match: PyQtWebEngine-Qt5 5.15.16\nAdding PyQtWebEngine-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for PyQt5-sip==12.13.0\nBest match: PyQt5-sip 12.13.0\nAdding PyQt5-sip 12.13.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nSearching for PyQt5-Qt5==5.15.16\nBest match: PyQt5-Qt5 5.15.16\nAdding PyQt5-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.29.0.dev0+d4e259f\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 46ms\nPrepared 18 packages in 5ms\nInstalled 18 packages in 174ms\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 366ms\nInstalled 47 packages in 929ms\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.12.3\n + httpx==0.16.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 + rfc3986==1.5.0\n + scikit-learn==1.0.2\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 + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 39 packages in 126ms\nInstalled 13 packages in 402ms\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 31ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 54ms\nInstalled 5 packages in 1.21s\n + catboost==1.2.7\n + graphviz==0.20.1\n + plotly==5.18.0\n + tenacity==8.2.3\n + xgboost==1.6.2\nAudited 2 packages in 6ms\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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:3413:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3413 |   __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:4869:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4869 |   __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:5615:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5615 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5736:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5736 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5742:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5742 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7202:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7202 |         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:7857:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7857 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7917:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7917 |               __pyx_t_15 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_14 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   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:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   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:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   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:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\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      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.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'\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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e\ncollected 22 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_data_retain_ids\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_summary\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======================== 19 passed, 3 skipped in 6.17s =========================\nWidgets left: 0    Max widgets: 1985 \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_d4e259f71e0e1f9b7ba3a409a39ee99d2aadcf1e\ncollected 22 items\n\nr2e_tests/test_1.py sss......F............                               [100%]\n\n=================================== FAILURES ===================================\n______________________ TestOWDBSCAN.test_data_retain_ids _______________________\n\nself = <r2e_tests.test_1.TestOWDBSCAN testMethod=test_data_retain_ids>\n\n    def test_data_retain_ids(self):\n        self.send_signal(self.widget.Inputs.data, self.iris)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n>       np.testing.assert_array_equal(self.iris.ids, output.ids)\nE       AssertionError: \nE       Arrays are not equal\nE       \nE       Mismatched elements: 150 / 150 (100%)\nE       Max absolute difference: 150\nE       Max relative difference: 0.04996669\nE        x: array([2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862,\nE              2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873,\nE              2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884,...\nE        y: array([3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012,\nE              3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023,\nE              3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034,...\n\nr2e_tests/test_1.py:224: 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_summary\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\nFAILED r2e_tests/test_1.py::TestOWDBSCAN::test_data_retain_ids - AssertionErr...\n=================== 1 failed, 18 passed, 3 skipped in 4.70s ====================\nWidgets left: 0    Max widgets: 1877 \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:** Data IDs Are Not Retained After DBSCAN Clustering

**Description:**
When using the OWDBSCAN widget for clustering, the original data IDs are not preserved in the output. This causes inconsistencies, especially when other components rely on these IDs for further processing or analysis.

**Example Test Code:**
```python
def test_data_retain_ids(self):
    self.send_signal(self.widget.Inputs.data, self.iris)
    output = self.get_output(self.widget.Outputs.annotated_data)
    np.testing.assert_array_equal(self.iris.ids, output.ids)
```

**Expected Behavior:**
After performing DBSCAN clustering, the output data should retain the same IDs as the input data to ensure data integrity and consistency across the workflow.

**Actual Behavior:**
The output data's IDs do not match the input data's IDs, resulting in assertion failures and potential issues in downstream processes that depend on these IDs.

[/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
from itertools import chain

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.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
from Orange.widgets.utils.state_summary import format_summary_details
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
        self._set_input_summary(None)
        self._set_output_summary(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.buttonsArea, 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()
        self._set_input_summary(data)
        if not self.check_data_size(data):
            data = None
        self.data = self.data_normalized = data
        if self.data is None:
            self._set_output_summary(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)

        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, )
        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._set_output_summary(new_table)
        self.Outputs.annotated_data.send(new_table)

    def _set_input_summary(self, data):
        summary = len(data) if data else self.info.NoInput
        details = format_summary_details(data) if data else ""
        self.info.set_input_summary(summary, details)

    def _set_output_summary(self, output):
        summary = len(output) if output else self.info.NoOutput
        details = format_summary_details(output) if output else ""
        self.info.set_output_summary(summary, details)

    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:** Data IDs Are Not Retained After DBSCAN Clustering

**Description:**
When using the OWDBSCAN widget for clustering, the original data IDs are not preserved in the output. This causes inconsistencies, especially when other components rely on these IDs for further processing or analysis.

**Example Test Code:**
```python
def test_data_retain_ids(self):
    self.send_signal(self.widget.Inputs.data, self.iris)
    output = self.get_output(self.widget.Outputs.annotated_data)
    np.testing.assert_array_equal(self.iris.ids, output.ids)
```

**Expected Behavior:**
After performing DBSCAN clustering, the output data should retain the same IDs as the input data to ensure data integrity and consistency across the workflow.

**Actual Behavior:**
The output data's IDs do not match the input data's IDs, resulting in assertion failures and potential issues in downstream processes that depend on these IDs.

[/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_data_retain_ids": "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_summary": "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 c4cd4eabc..82f742a06 100644
--- a/Orange/widgets/unsupervised/owdbscan.py
+++ b/Orange/widgets/unsupervised/owdbscan.py
@@ -10,7 +10,7 @@ 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.data import Table, 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
@@ -197,11 +197,10 @@ class OWDBSCAN(widget.OWWidget):
 
         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)
+        clusters = np.array(clusters)
         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)
 
         domain = self.data.domain
         attributes, classes = domain.attributes, domain.class_vars
@@ -215,15 +214,8 @@ class OWDBSCAN(widget.OWWidget):
         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, )
-        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)
+        new_table = self.data.add_column(clust_var, clusters, to_metas=True)
+        new_table = new_table.add_column(in_core_var, in_core, to_metas=True)
 
         self._set_output_summary(new_table)
         self.Outputs.annotated_data.send(new_table)

{"Orange/widgets/unsupervised/owdbscan.py": "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.utils.state_summary import format_summary_details\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        self._set_input_summary(None)\n        self._set_output_summary(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.buttonsArea, 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        self._set_input_summary(data)\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._set_output_summary(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._set_output_summary(new_table)\n        self.Outputs.annotated_data.send(new_table)\n\n    def _set_input_summary(self, data):\n        summary = len(data) if data else self.info.NoInput\n        details = format_summary_details(data) if data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def _set_output_summary(self, output):\n        summary = len(output) if output else self.info.NoOutput\n        details = format_summary_details(output) if output else \"\"\n        self.info.set_output_summary(summary, details)\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:** Data IDs Are Not Retained After DBSCAN Clustering

**Description:**
When using the OWDBSCAN widget for clustering, the original data IDs are not preserved in the output. This causes inconsistencies, especially when other components rely on these IDs for further processing or analysis.

**Example Test Code:**
```python
def test_data_retain_ids(self):
    self.send_signal(self.widget.Inputs.data, self.iris)
    output = self.get_output(self.widget.Outputs.annotated_data)
    np.testing.assert_array_equal(self.iris.ids, output.ids)
```

**Expected Behavior:**
After performing DBSCAN clustering, the output data should retain the same IDs as the input data to ensure data integrity and consistency across the workflow.

**Actual Behavior:**
The output data's IDs do not match the input data's IDs, resulting in assertion failures and potential issues in downstream processes that depend on these IDs.

[/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
from itertools import chain

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.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
from Orange.widgets.utils.state_summary import format_summary_details
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
        self._set_input_summary(None)
        self._set_output_summary(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.buttonsArea, 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()
        self._set_input_summary(data)
        if not self.check_data_size(data):
            data = None
        self.data = self.data_normalized = data
        if self.data is None:
            self._set_output_summary(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)

        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, )
        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._set_output_summary(new_table)
        self.Outputs.annotated_data.send(new_table)

    def _set_input_summary(self, data):
        summary = len(data) if data else self.info.NoInput
        details = format_summary_details(data) if data else ""
        self.info.set_input_summary(summary, details)

    def _set_output_summary(self, output):
        summary = len(output) if output else self.info.NoOutput
        details = format_summary_details(output) if output else ""
        self.info.set_output_summary(summary, details)

    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