{
    "file_diffs": [
        {
            "old_file_content": "import operator\nfrom functools import reduce, wraps\nfrom collections import namedtuple, deque, OrderedDict\n\nimport numpy as np\nimport sklearn.metrics as skl_metrics\n\nfrom AnyQt.QtWidgets import QListView, QLabel, QGridLayout, QFrame, QAction, \\\n    QToolTip\nfrom AnyQt.QtGui import QColor, QPen, QBrush, QPainter, QPalette, QFont, \\\n    QCursor, QFontMetrics\nfrom AnyQt.QtCore import Qt, QSize\nimport pyqtgraph as pg\n\nimport Orange\nfrom Orange.base import Model\nfrom Orange.classification import ThresholdClassifier\nfrom Orange.evaluation.testing import Results\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.evaluate.contexthandlers import \\\n    EvaluationResultsContextHandler\nfrom Orange.widgets.evaluate.utils import check_results_adequacy, \\\n    check_can_calibrate\nfrom Orange.widgets.utils import colorpalettes\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.utils.plotutils import GraphicsView, PlotItem\nfrom Orange.widgets.widget import Input, Output, Msg\nfrom Orange.widgets import report\n\nfrom Orange.widgets.evaluate.utils import results_for_preview\n\n\n#: Points on a ROC curve\nROCPoints = namedtuple(\n    \"ROCPoints\",\n    [\"fpr\",        # (N,) array of false positive rate coordinates (ascending)\n     \"tpr\",        # (N,) array of true positive rate coordinates\n     \"thresholds\"  # (N,) array of thresholds (in descending order)\n     ]\n)\nROCPoints.is_valid = property(lambda self: self.fpr.size > 0)\n\n#: ROC Curve and it's convex hull\nROCCurve = namedtuple(\n    \"ROCCurve\",\n    [\"points\",  # ROCPoints\n     \"hull\"     # ROCPoints of the convex hull\n     ]\n)\nROCCurve.is_valid = property(lambda self: self.points.is_valid)\n\n#: A ROC Curve averaged vertically\nROCAveragedVert = namedtuple(\n    \"ROCAveragedVert\",\n    [\"points\",   # ROCPoints sampled by fpr\n     \"hull\",     # ROCPoints of the convex hull\n     \"tpr_std\",  # array standard deviation of tpr at each fpr point\n     ]\n)\nROCAveragedVert.is_valid = property(lambda self: self.points.is_valid)\n\n#: A ROC Curve averaged by thresholds\nROCAveragedThresh = namedtuple(\n    \"ROCAveragedThresh\",\n    [\"points\",   # ROCPoints sampled by threshold\n     \"hull\",     # ROCPoints of the convex hull\n     \"tpr_std\",  # array standard deviations of tpr at each threshold\n     \"fpr_std\"   # array standard deviations of fpr at each threshold\n     ]\n)\nROCAveragedThresh.is_valid = property(lambda self: self.points.is_valid)\n\n#: Combined data for a ROC curve of a single algorithm\nROCData = namedtuple(\n    \"ROCData\",\n    [\"merged\",  # ROCCurve merged over all folds\n     \"folds\",   # ROCCurve list, one for each fold\n     \"avg_vertical\",   # ROCAveragedVert\n     \"avg_threshold\",  # ROCAveragedThresh\n     ]\n)\n\n\ndef roc_data_from_results(results, clf_index, target):\n    \"\"\"\n    Compute ROC Curve(s) from evaluation results.\n\n    :param Orange.evaluation.Results results:\n        Evaluation results.\n    :param int clf_index:\n        Learner index in the `results`.\n    :param int target:\n        Target class index (i.e. positive class).\n    :rval ROCData:\n        A instance holding the computed curves.\n    \"\"\"\n    merged = roc_curve_for_fold(results, ..., clf_index, target)\n    merged_curve = ROCCurve(ROCPoints(*merged),\n                            ROCPoints(*roc_curve_convex_hull(merged)))\n\n    folds = results.folds if results.folds is not None else [...]\n    fold_curves = []\n    for fold in folds:\n        points = roc_curve_for_fold(results, fold, clf_index, target)\n        hull = roc_curve_convex_hull(points)\n        c = ROCCurve(ROCPoints(*points), ROCPoints(*hull))\n        fold_curves.append(c)\n\n    curves = [fold.points for fold in fold_curves\n              if fold.is_valid]\n\n    if curves:\n        fpr, tpr, std = roc_curve_vertical_average(curves)\n\n        thresh = np.zeros_like(fpr) * np.nan\n        hull = roc_curve_convex_hull((fpr, tpr, thresh))\n        v_avg = ROCAveragedVert(\n            ROCPoints(fpr, tpr, thresh),\n            ROCPoints(*hull),\n            std\n        )\n    else:\n        # return an invalid vertical averaged ROC\n        v_avg = ROCAveragedVert(\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            np.array([])\n        )\n\n    if curves:\n        all_thresh = np.hstack([t for _, _, t in curves])\n        all_thresh = np.clip(all_thresh, 0.0 - 1e-10, 1.0 + 1e-10)\n        all_thresh = np.unique(all_thresh)[::-1]\n        thresh = all_thresh[::max(all_thresh.size // 10, 1)]\n\n        (fpr, fpr_std), (tpr, tpr_std) = \\\n            roc_curve_threshold_average(curves, thresh)\n\n        hull = roc_curve_convex_hull((fpr, tpr, thresh))\n\n        t_avg = ROCAveragedThresh(\n            ROCPoints(fpr, tpr, thresh),\n            ROCPoints(*hull),\n            tpr_std,\n            fpr_std\n        )\n    else:\n        # return an invalid threshold averaged ROC\n        t_avg = ROCAveragedThresh(\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            np.array([]),\n            np.array([])\n        )\n    return ROCData(merged_curve, fold_curves, v_avg, t_avg)\n\nROCData.from_results = staticmethod(roc_data_from_results)\n\n#: A curve item to be displayed in a plot\nPlotCurve = namedtuple(\n    \"PlotCurve\",\n    [\"curve\",        # ROCCurve source curve\n     \"curve_item\",   # pg.PlotDataItem main curve\n     \"hull_item\"     # pg.PlotDataItem curve's convex hull\n     ]\n)\n\n\ndef plot_curve(curve, pen=None, shadow_pen=None, symbol=\"+\",\n               symbol_size=3, name=None):\n    \"\"\"\n    Construct a `PlotCurve` for the given `ROCCurve`.\n\n    :param ROCCurve curve:\n        Source curve.\n\n    The other parameters are passed to pg.PlotDataItem\n\n    :rtype: PlotCurve\n    \"\"\"\n    def extend_to_origin(points):\n        \"Extend ROCPoints to include coordinate origin if not already present\"\n        if points.tpr.size and (points.tpr[0] > 0 or points.fpr[0] > 0):\n            points = ROCPoints(\n                np.r_[0, points.fpr], np.r_[0, points.tpr],\n                np.r_[points.thresholds[0] + 1, points.thresholds]\n            )\n        return points\n\n    points = extend_to_origin(curve.points)\n    item = pg.PlotCurveItem(\n        points.fpr, points.tpr, pen=pen, shadowPen=shadow_pen,\n        name=name, antialias=True\n    )\n    sp = pg.ScatterPlotItem(\n        curve.points.fpr, curve.points.tpr, symbol=symbol,\n        size=symbol_size, pen=shadow_pen,\n        name=name\n    )\n    sp.setParentItem(item)\n\n    hull = extend_to_origin(curve.hull)\n\n    hull_item = pg.PlotDataItem(\n        hull.fpr, hull.tpr, pen=pen, antialias=True\n    )\n    return PlotCurve(curve, item, hull_item)\n\nPlotCurve.from_roc_curve = staticmethod(plot_curve)\n\n#: A curve displayed in a plot with error bars\nPlotAvgCurve = namedtuple(\n    \"PlotAvgCurve\",\n    [\"curve\",         # ROCCurve\n     \"curve_item\",    # pg.PlotDataItem\n     \"hull_item\",     # pg.PlotDataItem\n     \"confint_item\",  # pg.ErrorBarItem\n     ]\n)\n\n\ndef plot_avg_curve(curve, pen=None, shadow_pen=None, symbol=\"+\",\n                   symbol_size=4, name=None):\n    \"\"\"\n    Construct a `PlotAvgCurve` for the given `curve`.\n\n    :param curve: Source curve.\n    :type curve: ROCAveragedVert or ROCAveragedThresh\n\n    The other parameters are passed to pg.PlotDataItem\n\n    :rtype: PlotAvgCurve\n    \"\"\"\n    pc = plot_curve(curve, pen=pen, shadow_pen=shadow_pen, symbol=symbol,\n                    symbol_size=symbol_size, name=name)\n\n    points = curve.points\n    if isinstance(curve, ROCAveragedVert):\n        tpr_std = curve.tpr_std\n        error_item = pg.ErrorBarItem(\n            x=points.fpr[1:-1], y=points.tpr[1:-1],\n            height=2 * tpr_std[1:-1],\n            pen=pen, beam=0.025,\n            antialias=True,\n        )\n    elif isinstance(curve, ROCAveragedThresh):\n        tpr_std, fpr_std = curve.tpr_std, curve.fpr_std\n        error_item = pg.ErrorBarItem(\n            x=points.fpr[1:-1], y=points.tpr[1:-1],\n            height=2 * tpr_std[1:-1], width=2 * fpr_std[1:-1],\n            pen=pen, beam=0.025,\n            antialias=True,\n        )\n    return PlotAvgCurve(curve, pc.curve_item, pc.hull_item, error_item)\n\nPlotAvgCurve.from_roc_curve = staticmethod(plot_avg_curve)\n\nSome = namedtuple(\"Some\", [\"val\"])\n\n\ndef once(f):\n    \"\"\"\n    Return a function that will be called only once, and it's result cached.\n    \"\"\"\n    cached = None\n\n    @wraps(f)\n    def wraped():\n        nonlocal cached\n        if cached is None:\n            cached = Some(f())\n        return cached.val\n    return wraped\n\n\nPlotCurves = namedtuple(\n    \"PlotCurves\",\n    [\"merge\",   # :: () -> PlotCurve\n     \"folds\",   # :: () -> [PlotCurve]\n     \"avg_vertical\",   # :: () -> PlotAvgCurve\n     \"avg_threshold\",  # :: () -> PlotAvgCurve\n     ]\n)\n\n\nclass InfiniteLine(pg.InfiniteLine):\n    \"\"\"pyqtgraph.InfiniteLine extended to support antialiasing.\n    \"\"\"\n    def __init__(self, pos=None, angle=90, pen=None, movable=False,\n                 bounds=None, antialias=False):\n        super().__init__(pos, angle, pen, movable, bounds)\n        self.antialias = antialias\n\n    def paint(self, p, *args):\n        if self.antialias:\n            p.setRenderHint(QPainter.Antialiasing, True)\n        super().paint(p, *args)\n\n\nclass OWROCAnalysis(widget.OWWidget):\n    name = \"ROC Analysis\"\n    description = \"Display the Receiver Operating Characteristics curve \" \\\n                  \"based on the evaluation of classifiers.\"\n    icon = \"icons/ROCAnalysis.svg\"\n    priority = 1010\n    keywords = \"roc analysis, analyse\"\n\n    class Inputs:\n        evaluation_results = Input(\"Evaluation Results\", Orange.evaluation.Results)\n\n    class Outputs:\n        calibrated_model = Output(\"Calibrated Model\", Model)\n\n    class Information(widget.OWWidget.Information):\n        no_output = Msg(\"Can't output a model: {}\")\n\n    buttons_area_orientation = None\n    settingsHandler = EvaluationResultsContextHandler()\n    target_index = settings.ContextSetting(0)\n    selected_classifiers = settings.ContextSetting([])\n\n    display_perf_line = settings.Setting(True)\n    display_def_threshold = settings.Setting(True)\n\n    fp_cost = settings.Setting(500)\n    fn_cost = settings.Setting(500)\n    target_prior = settings.Setting(50.0, schema_only=True)\n\n    #: ROC Averaging Types\n    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3\n    roc_averaging = settings.Setting(Merge)\n\n    display_convex_hull = settings.Setting(False)\n    display_convex_curve = settings.Setting(False)\n\n    graph_name = \"plot\"  # pg.GraphicsItem (pg.PlotItem)\n\n    def __init__(self):\n        super().__init__()\n\n        self.results = None\n        self.classifier_names = []\n        self.perf_line = None\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n        box = gui.vBox(self.controlArea, \"Plot\")\n        self.target_cb = gui.comboBox(\n            box, self, \"target_index\",\n            label=\"Target\", orientation=Qt.Horizontal,\n            callback=self._on_target_changed,\n            contentsLength=8, searchable=True)\n\n        gui.widgetLabel(box, \"Classifiers\")\n        line_height = 4 * QFontMetrics(self.font()).lineSpacing()\n        self.classifiers_list_box = gui.listBox(\n            box, self, \"selected_classifiers\", \"classifier_names\",\n            selectionMode=QListView.MultiSelection,\n            callback=self._on_classifiers_changed,\n            sizeHint=QSize(0, line_height))\n\n        abox = gui.vBox(self.controlArea, \"Curves\")\n        gui.comboBox(abox, self, \"roc_averaging\",\n                     items=[\"Merge Predictions from Folds\", \"Mean TP Rate\",\n                            \"Mean TP and FP at Threshold\", \"Show Individual Curves\"],\n                     callback=self._replot)\n\n        gui.checkBox(abox, self, \"display_convex_curve\",\n                     \"Show convex ROC curves\", callback=self._replot)\n        gui.checkBox(abox, self, \"display_convex_hull\",\n                     \"Show ROC convex hull\", callback=self._replot)\n\n        box = gui.vBox(self.controlArea, \"Analysis\")\n\n        gui.checkBox(box, self, \"display_def_threshold\",\n                     \"Default threshold (0.5) point\",\n                     callback=self._on_display_def_threshold_changed)\n\n        gui.checkBox(box, self, \"display_perf_line\", \"Show performance line\",\n                     callback=self._on_display_perf_line_changed)\n        grid = QGridLayout()\n        gui.indentedBox(box, orientation=grid)\n\n        sp = gui.spin(box, self, \"fp_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FP Cost:\"), 0, 0)\n        grid.addWidget(sp, 0, 1)\n\n        sp = gui.spin(box, self, \"fn_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FN Cost:\"))\n        grid.addWidget(sp, 1, 1)\n        self.target_prior_sp = gui.spin(box, self, \"target_prior\", 1, 99,\n                                        alignment=Qt.AlignRight,\n                                        spinType=float,\n                                        callback=self._on_target_prior_changed)\n        self.target_prior_sp.setSuffix(\" %\")\n        self.target_prior_sp.addAction(QAction(\"Auto\", sp))\n        grid.addWidget(QLabel(\"Prior probability:\"))\n        grid.addWidget(self.target_prior_sp, 2, 1)\n\n        self.plotview = GraphicsView(background=None)\n        self.plotview.setFrameStyle(QFrame.StyledPanel)\n        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)\n\n        self.plot = PlotItem(enableMenu=False)\n        self.plot.setMouseEnabled(False, False)\n        self.plot.hideButtons()\n\n        tickfont = QFont(self.font())\n        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))\n\n        axis = self.plot.getAxis(\"bottom\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"FP Rate (1-Specificity)\")\n        axis.setGrid(16)\n\n        axis = self.plot.getAxis(\"left\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"TP Rate (Sensitivity)\")\n        axis.setGrid(16)\n\n        self.plot.showGrid(True, True, alpha=0.2)\n        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)\n\n        self.plotview.setCentralItem(self.plot)\n        self.mainArea.layout().addWidget(self.plotview)\n\n    @Inputs.evaluation_results\n    def set_results(self, results):\n        \"\"\"Set the input evaluation results.\"\"\"\n        self.closeContext()\n        self.clear()\n        self.results = check_results_adequacy(results, self.Error)\n        if self.results is not None:\n            self._initialize(self.results)\n            self.openContext(self.results.domain.class_var,\n                             self.classifier_names)\n            self._setup_plot()\n        else:\n            self.warning()\n\n    def clear(self):\n        \"\"\"Clear the widget state.\"\"\"\n        self.results = None\n        self.plot.clear()\n        self.classifier_names = []\n        self.selected_classifiers = []\n        self.target_cb.clear()\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n    def _initialize(self, results):\n        names = getattr(results, \"learner_names\", None)\n\n        if names is None:\n            names = [\"#{}\".format(i + 1)\n                     for i in range(len(results.predicted))]\n\n        self.colors = colorpalettes.get_default_curve_colors(len(names))\n\n        self.classifier_names = names\n        self.selected_classifiers = list(range(len(names)))\n        for i in range(len(names)):\n            listitem = self.classifiers_list_box.item(i)\n            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))\n\n        class_var = results.domain.class_var\n        self.target_cb.addItems(class_var.values)\n        self.target_index = 0\n        self._set_target_prior()\n\n    def _set_target_prior(self):\n        \"\"\"\n        This function sets the initial target class probability prior value\n        based on the input data.\n        \"\"\"\n        if self.results.data:\n            # here we can use target_index directly since values in the\n            # dropdown are sorted in same order than values in the table\n            target_values_cnt = np.count_nonzero(\n                self.results.data.Y == self.target_index)\n            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))\n            self.target_prior = np.round(target_values_cnt / count_all * 100)\n\n            # set the spin text to gray color when set automatically\n            self.target_prior_sp.setStyleSheet(\"color: gray;\")\n\n    def curve_data(self, target, clf_idx):\n        \"\"\"Return `ROCData' for the given target and classifier.\"\"\"\n        if (target, clf_idx) not in self._curve_data:\n            # pylint: disable=no-member\n            data = ROCData.from_results(self.results, clf_idx, target)\n            self._curve_data[target, clf_idx] = data\n\n        return self._curve_data[target, clf_idx]\n\n    def plot_curves(self, target, clf_idx):\n        \"\"\"Return a set of functions `plot_curves` generating plot curves.\"\"\"\n        def generate_pens(basecolor):\n            pen = QPen(basecolor, 1)\n            pen.setCosmetic(True)\n\n            shadow_pen = QPen(pen.color().lighter(160), 2.5)\n            shadow_pen.setCosmetic(True)\n            return pen, shadow_pen\n\n        data = self.curve_data(target, clf_idx)\n\n        if (target, clf_idx) not in self._plot_curves:\n            pen, shadow_pen = generate_pens(self.colors[clf_idx])\n            name = self.classifier_names[clf_idx]\n            @once\n            def merged():\n                return plot_curve(\n                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)\n            @once\n            def folds():\n                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)\n                        for fold in data.folds]\n            @once\n            def avg_vert():\n                return plot_avg_curve(data.avg_vertical, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n            @once\n            def avg_thres():\n                return plot_avg_curve(data.avg_threshold, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n\n            self._plot_curves[target, clf_idx] = PlotCurves(\n                merge=merged, folds=folds,\n                avg_vertical=avg_vert, avg_threshold=avg_thres\n            )\n\n        return self._plot_curves[target, clf_idx]\n\n    def _setup_plot(self):\n        def merge_averaging():\n            for curve in curves:\n                graphics = curve.merge()\n                curve = graphics.curve\n                self.plot.addItem(graphics.curve_item)\n\n                if self.display_convex_curve:\n                    self.plot.addItem(graphics.hull_item)\n\n                if self.display_def_threshold and curve.is_valid:\n                    points = curve.points\n                    ind = np.argmin(np.abs(points.thresholds - 0.5))\n                    item = pg.TextItem(\n                        text=\"{:.3f}\".format(points.thresholds[ind]),\n                        color=foreground\n                    )\n                    item.setPos(points.fpr[ind], points.tpr[ind])\n                    self.plot.addItem(item)\n\n            hull_curves = [curve.merged.hull for curve in selected]\n            if hull_curves:\n                self._rocch = convex_hull(hull_curves)\n                iso_pen = QPen(foreground, 1.0)\n                iso_pen.setCosmetic(True)\n                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)\n                self.plot.addItem(self._perf_line)\n            return hull_curves\n\n        def vertical_averaging():\n            for curve in curves:\n                graphics = curve.avg_vertical()\n\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_vertical.hull for curve in selected]\n\n        def threshold_averaging():\n            for curve in curves:\n                graphics = curve.avg_threshold()\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_threshold.hull for curve in selected]\n\n        def no_averaging():\n            for curve in curves:\n                graphics = curve.folds()\n                for fold in graphics:\n                    self.plot.addItem(fold.curve_item)\n                    if self.display_convex_curve:\n                        self.plot.addItem(fold.hull_item)\n            return [fold.hull for curve in selected for fold in curve.folds]\n\n        averagings = {\n            OWROCAnalysis.Merge: merge_averaging,\n            OWROCAnalysis.Vertical: vertical_averaging,\n            OWROCAnalysis.Threshold: threshold_averaging,\n            OWROCAnalysis.NoAveraging: no_averaging\n        }\n        foreground = self.plotview.scene().palette().color(QPalette.Text)\n        target = self.target_index\n        selected = self.selected_classifiers\n\n        curves = [self.plot_curves(target, i) for i in selected]\n        selected = [self.curve_data(target, i) for i in selected]\n        hull_curves = averagings[self.roc_averaging]()\n\n        if self.display_convex_hull and hull_curves:\n            hull = convex_hull(hull_curves)\n            hull_color = QColor(foreground)\n            hull_color.setAlpha(100)\n            hull_pen = QPen(hull_color, 2)\n            hull_pen.setCosmetic(True)\n            hull_color.setAlpha(50)\n            item = self.plot.plot(\n                hull.fpr, hull.tpr,\n                pen=hull_pen,\n                brush=QBrush(hull_color),\n                fillLevel=0)\n            item.setZValue(-10000)\n        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)\n        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)\n        pen.setCosmetic(True)\n        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)\n\n        self._update_perf_line()\n\n        self._update_axes_ticks()\n\n        warning = \"\"\n        if not all(c.is_valid for c in hull_curves):\n            if any(c.is_valid for c in hull_curves):\n                warning = \"Some ROC curves are undefined\"\n            else:\n                warning = \"All ROC curves are undefined\"\n        self.warning(warning)\n\n    def _update_axes_ticks(self):\n        def enumticks(a):\n            a = np.unique(a)\n            if len(a) > 15:\n                return None\n            return [[(x, f\"{x:.2f}\") for x in a[::-1]]]\n\n        axis_bottom = self.plot.getAxis(\"bottom\")\n        axis_left = self.plot.getAxis(\"left\")\n\n        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \\\n                or self.roc_averaging != OWROCAnalysis.Merge:\n            axis_bottom.setTicks(None)\n            axis_left.setTicks(None)\n        else:\n            data = self.curve_data(self.target_index, self.selected_classifiers[0])\n            points = data.merged.points\n            axis_bottom.setTicks(enumticks(points.fpr))\n            axis_left.setTicks(enumticks(points.tpr))\n\n    def _on_mouse_moved(self, pos):\n        target = self.target_index\n        selected = self.selected_classifiers\n        curves = [(clf_idx, self.plot_curves(target, clf_idx))\n                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]\n        valid_thresh, valid_clf = [], []\n        pt, ave_mode = None, self.roc_averaging\n\n        for clf_idx, crv in curves:\n            if self.roc_averaging == OWROCAnalysis.Merge:\n                curve = crv.merge()\n            elif self.roc_averaging == OWROCAnalysis.Vertical:\n                curve = crv.avg_vertical()\n            elif self.roc_averaging == OWROCAnalysis.Threshold:\n                curve = crv.avg_threshold()\n            else:\n                # currently not implemented for 'Show Individual Curves'\n                return\n\n            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem\n            act_pos = sp.mapFromScene(pos)\n            pts = list(sp.pointsAt(act_pos))\n\n            if pts:\n                mouse_pt = pts[0].pos()\n                if self._tooltip_cache:\n                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache\n                    curr_thresh, curr_clf = [], []\n                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \\\n                            and cache_ave == self.roc_averaging:\n                        mask = np.equal(cache_clf, clf_idx)\n                        curr_thresh = np.compress(mask, cache_thresh).tolist()\n                        curr_clf = np.compress(mask, cache_clf).tolist()\n                    else:\n                        QToolTip.showText(QCursor.pos(), \"\")\n                        self._tooltip_cache = None\n\n                    if curr_thresh:\n                        valid_thresh.append(*curr_thresh)\n                        valid_clf.append(*curr_clf)\n                        pt = cache_pt\n                        continue\n\n                curve_pts = curve.curve.points\n                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))\n                diff = np.subtract(roc_points, mouse_pt)\n                # Find closest point on curve and save the corresponding threshold\n                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))\n\n                thresh = curve_pts.thresholds[idx_closest]\n                if not np.isnan(thresh):\n                    valid_thresh.append(thresh)\n                    valid_clf.append(clf_idx)\n                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]\n\n        if valid_thresh:\n            clf_names = self.classifier_names\n            msg = \"Thresholds:\\n\" + \"\\n\".join([\"({:s}) {:.3f}\".format(clf_names[i], thresh)\n                                               for i, thresh in zip(valid_clf, valid_thresh)])\n            QToolTip.showText(QCursor.pos(), msg)\n            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)\n\n    def _on_target_changed(self):\n        self.plot.clear()\n        self._set_target_prior()\n        self._setup_plot()\n\n    def _on_classifiers_changed(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _on_target_prior_changed(self):\n        self.target_prior_sp.setStyleSheet(\"color: black;\")\n        self._on_display_perf_line_changed()\n\n    def _on_display_perf_line_changed(self):\n        self._update_perf_line()\n\n        if self.perf_line is not None:\n            self.perf_line.setVisible(self.display_perf_line)\n\n    def _on_display_def_threshold_changed(self):\n        self._replot()\n\n    def _replot(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _update_perf_line(self):\n\n        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:\n            self._update_output(None)\n            return\n\n        ind = None\n        self._perf_line.setVisible(self.display_perf_line)\n        if self.display_perf_line:\n            m = roc_iso_performance_slope(\n                self.fp_cost, self.fn_cost, self.target_prior / 100.0)\n\n            hull = self._rocch\n            if hull.is_valid:\n                ind = roc_iso_performance_line(m, hull)\n                angle = np.arctan2(m, 1)  # in radians\n                self._perf_line.setAngle(angle * 180 / np.pi)\n                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))\n            else:\n                self._perf_line.setVisible(False)\n\n        self._update_output(None if ind is None else hull.thresholds[ind[0]])\n\n    def _update_output(self, threshold):\n        self.Information.no_output.clear()\n\n        if threshold is None:\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        problems = check_can_calibrate(self.results, self.selected_classifiers)\n        if problems:\n            self.Information.no_output(problems)\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        model = ThresholdClassifier(\n            self.results.models[0][self.selected_classifiers[0]],\n            threshold)\n        self.Outputs.calibrated_model.send(model)\n\n    def onDeleteWidget(self):\n        self.clear()\n\n    def send_report(self):\n        if self.results is None:\n            return\n        items = OrderedDict()\n        items[\"Target class\"] = self.target_cb.currentText()\n        if self.display_perf_line:\n            items[\"Costs\"] = \\\n                \"FP = {}, FN = {}\".format(self.fp_cost, self.fn_cost)\n            items[\"Target probability\"] = \"{} %\".format(self.target_prior)\n        caption = report.list_legend(self.classifiers_list_box,\n                                     self.selected_classifiers)\n        self.report_items(items)\n        self.report_plot()\n        self.report_caption(caption)\n\n\ndef interp(x, xp, fp, left=None, right=None):\n    \"\"\"\n    Like numpy.interp except for handling of running sequences of\n    same values in `xp`.\n    \"\"\"\n    x = np.asanyarray(x)\n    xp = np.asanyarray(xp)\n    fp = np.asanyarray(fp)\n\n    if xp.shape != fp.shape:\n        raise ValueError(\"xp and fp must have the same shape\")\n\n    ind = np.searchsorted(xp, x, side=\"right\")\n    fx = np.zeros(len(x))\n\n    under = ind == 0\n    over = ind == len(xp)\n    between = ~under & ~over\n\n    fx[under] = left if left is not None else fp[0]\n    fx[over] = right if right is not None else fp[-1]\n\n    if right is not None:\n        # Fix points exactly on the right boundary.\n        fx[x == xp[-1]] = fp[-1]\n\n    ind = ind[between]\n\n    df = (fp[ind] - fp[ind - 1]) / (xp[ind] - xp[ind - 1])\n\n    fx[between] = df * (x[between] - xp[ind]) + fp[ind]\n\n    return fx\n\n\ndef roc_curve_for_fold(res, fold, clf_idx, target):\n    fold_actual = res.actual[fold]\n    P = np.sum(fold_actual == target)\n    N = fold_actual.size - P\n\n    if P == 0 or N == 0:\n        # Undefined TP and FP rate\n        return np.array([]), np.array([]), np.array([])\n\n    fold_probs = res.probabilities[clf_idx][fold][:, target]\n    drop_intermediate = len(fold_actual) > 20\n    fpr, tpr, thresholds = skl_metrics.roc_curve(\n        fold_actual, fold_probs, pos_label=target,\n        drop_intermediate=drop_intermediate\n    )\n\n    # skl sets the first threshold to the highest threshold in the data + 1\n    # since we deal with probabilities, we (carefully) set it to 1\n    # Unrelated comparisons, thus pylint: disable=chained-comparison\n    if len(thresholds) > 1 and thresholds[1] <= 1:\n        thresholds[0] = 1\n    return fpr, tpr, thresholds\n\n\ndef roc_curve_vertical_average(curves, samples=10):\n    if not curves:\n        raise ValueError(\"No curves\")\n    fpr_sample = np.linspace(0.0, 1.0, samples)\n    tpr_samples = []\n    for fpr, tpr, _ in curves:\n        tpr_samples.append(interp(fpr_sample, fpr, tpr, left=0, right=1))\n\n    tpr_samples = np.array(tpr_samples)\n    return fpr_sample, tpr_samples.mean(axis=0), tpr_samples.std(axis=0)\n\n\ndef roc_curve_threshold_average(curves, thresh_samples):\n    if not curves:\n        raise ValueError(\"No curves\")\n    fpr_samples, tpr_samples = [], []\n    for fpr, tpr, thresh in curves:\n        ind = np.searchsorted(thresh[::-1], thresh_samples, side=\"left\")\n        ind = ind[::-1]\n        ind = np.clip(ind, 0, len(thresh) - 1)\n        fpr_samples.append(fpr[ind])\n        tpr_samples.append(tpr[ind])\n\n    fpr_samples = np.array(fpr_samples)\n    tpr_samples = np.array(tpr_samples)\n\n    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),\n            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))\n\n\ndef roc_curve_thresh_avg_interp(curves, thresh_samples):\n    fpr_samples, tpr_samples = [], []\n    for fpr, tpr, thresh in curves:\n        thresh = thresh[::-1]\n        fpr = interp(thresh_samples, thresh, fpr[::-1], left=1.0, right=0.0)\n        tpr = interp(thresh_samples, thresh, tpr[::-1], left=1.0, right=0.0)\n        fpr_samples.append(fpr)\n        tpr_samples.append(tpr)\n\n    fpr_samples = np.array(fpr_samples)\n    tpr_samples = np.array(tpr_samples)\n\n    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),\n            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))\n\n\nRocPoint = namedtuple(\"RocPoint\", [\"fpr\", \"tpr\", \"threshold\"])\n\n\ndef roc_curve_convex_hull(curve):\n    def slope(p1, p2):\n        x1, y1, _ = p1\n        x2, y2, _ = p2\n        if x1 != x2:\n            return  (y2 - y1) / (x2 - x1)\n        else:\n            return np.inf\n\n    fpr, _, _ = curve\n\n    if len(fpr) <= 2:\n        return curve\n    points = map(RocPoint._make, zip(*curve))\n\n    hull = deque([next(points)])\n\n    for point in points:\n        while True:\n            if len(hull) < 2:\n                hull.append(point)\n                break\n            else:\n                last = hull[-1]\n                if point.fpr != last.fpr and \\\n                        slope(hull[-2], last) > slope(last, point):\n                    hull.append(point)\n                    break\n                else:\n                    hull.pop()\n\n    fpr = np.array([p.fpr for p in hull])\n    tpr = np.array([p.tpr for p in hull])\n    thres = np.array([p.threshold for p in hull])\n    return (fpr, tpr, thres)\n\n\ndef convex_hull(curves):\n    def slope(p1, p2):\n        x1, y1, *_ = p1\n        x2, y2, *_ = p2\n        if x1 != x2:\n            return (y2 - y1) / (x2 - x1)\n        else:\n            return np.inf\n\n    curves = [list(map(RocPoint._make, zip(*curve))) for curve in curves]\n\n    merged_points = reduce(operator.iadd, curves, [])\n    merged_points = sorted(merged_points)\n\n    if not merged_points:\n        return ROCPoints(np.array([]), np.array([]), np.array([]))\n\n    if len(merged_points) <= 2:\n        return ROCPoints._make(map(np.array, zip(*merged_points)))\n\n    points = iter(merged_points)\n\n    hull = deque([next(points)])\n\n    for point in points:\n        while True:\n            if len(hull) < 2:\n                hull.append(point)\n                break\n            else:\n                last = hull[-1]\n                if point[0] != last[0] and \\\n                        slope(hull[-2], last) > slope(last, point):\n                    hull.append(point)\n                    break\n                else:\n                    hull.pop()\n\n    return ROCPoints._make(map(np.array, zip(*hull)))\n\n\ndef roc_iso_performance_line(slope, hull, tol=1e-5):\n    \"\"\"\n    Return the indices where a line with `slope` touches the ROC convex hull.\n    \"\"\"\n    fpr, tpr, *_ = hull\n\n    # Compute the distance of each point to a reference iso line\n    # going through point (0, 1). The point(s) with the minimum\n    # distance are our result\n\n    # y = m * x + 1\n    # m * x - 1y + 1 = 0\n    a, b, c = slope, -1, 1\n    dist = distance_to_line(a, b, c, fpr, tpr)\n    mindist = np.min(dist)\n\n    return np.flatnonzero((dist - mindist) <= tol)\n\n\ndef distance_to_line(a, b, c, x0, y0):\n    \"\"\"\n    Return the distance to a line ax + by + c = 0\n    \"\"\"\n    assert a != 0 or b != 0\n    return np.abs(a * x0 + b * y0 + c) / np.sqrt(a ** 2 + b ** 2)\n\n\ndef roc_iso_performance_slope(fp_cost, fn_cost, p):\n    assert 0 <= p <= 1\n    if fn_cost * p == 0:\n        return np.inf\n    else:\n        return (fp_cost * (1. - p)) / (fn_cost * p)\n\n\ndef _create_results():  # pragma: no cover\n    probs1 = [0.984, 0.907, 0.881, 0.865, 0.815, 0.741, 0.735, 0.635,\n              0.582, 0.554, 0.413, 0.317, 0.287, 0.225, 0.216, 0.183]\n    probs = np.array([[[1 - x, x] for x in probs1]])\n    preds = (probs > 0.5).astype(float)\n    return Results(\n        data=Orange.data.Table(\"heart_disease\")[:16],\n        row_indices=np.arange(16),\n        actual=np.array(list(map(int, \"1100111001001000\"))),\n        probabilities=probs, predicted=preds\n    )\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    # WidgetPreview(OWROCAnalysis).run(_create_results())\n    WidgetPreview(OWROCAnalysis).run(results_for_preview())\n",
            "new_file_content": "import operator\nfrom functools import reduce, wraps\nfrom collections import namedtuple, deque, OrderedDict\n\nimport numpy as np\nimport sklearn.metrics as skl_metrics\n\nfrom AnyQt.QtWidgets import QListView, QLabel, QGridLayout, QFrame, QAction, \\\n    QToolTip\nfrom AnyQt.QtGui import QColor, QPen, QBrush, QPainter, QPalette, QFont, \\\n    QCursor, QFontMetrics\nfrom AnyQt.QtCore import Qt, QSize\nimport pyqtgraph as pg\n\nimport Orange\nfrom Orange.base import Model\nfrom Orange.classification import ThresholdClassifier\nfrom Orange.evaluation.testing import Results\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.evaluate.contexthandlers import \\\n    EvaluationResultsContextHandler\nfrom Orange.widgets.evaluate.utils import check_results_adequacy, \\\n    check_can_calibrate\nfrom Orange.widgets.utils import colorpalettes\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.utils.plotutils import GraphicsView, PlotItem\nfrom Orange.widgets.widget import Input, Output, Msg\nfrom Orange.widgets import report\n\nfrom Orange.widgets.evaluate.utils import results_for_preview\n\n\n#: Points on a ROC curve\nROCPoints = namedtuple(\n    \"ROCPoints\",\n    [\"fpr\",        # (N,) array of false positive rate coordinates (ascending)\n     \"tpr\",        # (N,) array of true positive rate coordinates\n     \"thresholds\"  # (N,) array of thresholds (in descending order)\n     ]\n)\nROCPoints.is_valid = property(lambda self: self.fpr.size > 0)\n\n#: ROC Curve and it's convex hull\nROCCurve = namedtuple(\n    \"ROCCurve\",\n    [\"points\",  # ROCPoints\n     \"hull\"     # ROCPoints of the convex hull\n     ]\n)\nROCCurve.is_valid = property(lambda self: self.points.is_valid)\n\n#: A ROC Curve averaged vertically\nROCAveragedVert = namedtuple(\n    \"ROCAveragedVert\",\n    [\"points\",   # ROCPoints sampled by fpr\n     \"hull\",     # ROCPoints of the convex hull\n     \"tpr_std\",  # array standard deviation of tpr at each fpr point\n     ]\n)\nROCAveragedVert.is_valid = property(lambda self: self.points.is_valid)\n\n#: A ROC Curve averaged by thresholds\nROCAveragedThresh = namedtuple(\n    \"ROCAveragedThresh\",\n    [\"points\",   # ROCPoints sampled by threshold\n     \"hull\",     # ROCPoints of the convex hull\n     \"tpr_std\",  # array standard deviations of tpr at each threshold\n     \"fpr_std\"   # array standard deviations of fpr at each threshold\n     ]\n)\nROCAveragedThresh.is_valid = property(lambda self: self.points.is_valid)\n\n#: Combined data for a ROC curve of a single algorithm\nROCData = namedtuple(\n    \"ROCData\",\n    [\"merged\",  # ROCCurve merged over all folds\n     \"folds\",   # ROCCurve list, one for each fold\n     \"avg_vertical\",   # ROCAveragedVert\n     \"avg_threshold\",  # ROCAveragedThresh\n     ]\n)\n\n\ndef roc_data_from_results(results, clf_index, target):\n    \"\"\"\n    Compute ROC Curve(s) from evaluation results.\n\n    :param Orange.evaluation.Results results:\n        Evaluation results.\n    :param int clf_index:\n        Learner index in the `results`.\n    :param int target:\n        Target class index (i.e. positive class).\n    :rval ROCData:\n        A instance holding the computed curves.\n    \"\"\"\n    merged = roc_curve_for_fold(results, ..., clf_index, target)\n    merged_curve = ROCCurve(ROCPoints(*merged),\n                            ROCPoints(*roc_curve_convex_hull(merged)))\n\n    folds = results.folds if results.folds is not None else [...]\n    fold_curves = []\n    for fold in folds:\n        points = roc_curve_for_fold(results, fold, clf_index, target)\n        hull = roc_curve_convex_hull(points)\n        c = ROCCurve(ROCPoints(*points), ROCPoints(*hull))\n        fold_curves.append(c)\n\n    curves = [fold.points for fold in fold_curves\n              if fold.is_valid]\n\n    if curves:\n        fpr, tpr, std = roc_curve_vertical_average(curves)\n\n        thresh = np.zeros_like(fpr) * np.nan\n        hull = roc_curve_convex_hull((fpr, tpr, thresh))\n        v_avg = ROCAveragedVert(\n            ROCPoints(fpr, tpr, thresh),\n            ROCPoints(*hull),\n            std\n        )\n    else:\n        # return an invalid vertical averaged ROC\n        v_avg = ROCAveragedVert(\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            np.array([])\n        )\n\n    if curves:\n        all_thresh = np.hstack([t for _, _, t in curves])\n        all_thresh = np.clip(all_thresh, 0.0 - 1e-10, 1.0 + 1e-10)\n        all_thresh = np.unique(all_thresh)[::-1]\n        thresh = all_thresh[::max(all_thresh.size // 10, 1)]\n\n        (fpr, fpr_std), (tpr, tpr_std) = \\\n            roc_curve_threshold_average(curves, thresh)\n\n        hull = roc_curve_convex_hull((fpr, tpr, thresh))\n\n        t_avg = ROCAveragedThresh(\n            ROCPoints(fpr, tpr, thresh),\n            ROCPoints(*hull),\n            tpr_std,\n            fpr_std\n        )\n    else:\n        # return an invalid threshold averaged ROC\n        t_avg = ROCAveragedThresh(\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            np.array([]),\n            np.array([])\n        )\n    return ROCData(merged_curve, fold_curves, v_avg, t_avg)\n\nROCData.from_results = staticmethod(roc_data_from_results)\n\n#: A curve item to be displayed in a plot\nPlotCurve = namedtuple(\n    \"PlotCurve\",\n    [\"curve\",        # ROCCurve source curve\n     \"curve_item\",   # pg.PlotDataItem main curve\n     \"hull_item\"     # pg.PlotDataItem curve's convex hull\n     ]\n)\n\n\ndef plot_curve(curve, pen=None, shadow_pen=None, symbol=\"+\",\n               symbol_size=3, name=None):\n    \"\"\"\n    Construct a `PlotCurve` for the given `ROCCurve`.\n\n    :param ROCCurve curve:\n        Source curve.\n\n    The other parameters are passed to pg.PlotDataItem\n\n    :rtype: PlotCurve\n    \"\"\"\n    def extend_to_origin(points):\n        \"Extend ROCPoints to include coordinate origin if not already present\"\n        if points.tpr.size and (points.tpr[0] > 0 or points.fpr[0] > 0):\n            points = ROCPoints(\n                np.r_[0, points.fpr], np.r_[0, points.tpr],\n                np.r_[points.thresholds[0] + 1, points.thresholds]\n            )\n        return points\n\n    points = extend_to_origin(curve.points)\n    item = pg.PlotCurveItem(\n        points.fpr, points.tpr, pen=pen, shadowPen=shadow_pen,\n        name=name, antialias=True\n    )\n    sp = pg.ScatterPlotItem(\n        curve.points.fpr, curve.points.tpr, symbol=symbol,\n        size=symbol_size, pen=shadow_pen,\n        name=name\n    )\n    sp.setParentItem(item)\n\n    hull = extend_to_origin(curve.hull)\n\n    hull_item = pg.PlotDataItem(\n        hull.fpr, hull.tpr, pen=pen, antialias=True\n    )\n    return PlotCurve(curve, item, hull_item)\n\nPlotCurve.from_roc_curve = staticmethod(plot_curve)\n\n#: A curve displayed in a plot with error bars\nPlotAvgCurve = namedtuple(\n    \"PlotAvgCurve\",\n    [\"curve\",         # ROCCurve\n     \"curve_item\",    # pg.PlotDataItem\n     \"hull_item\",     # pg.PlotDataItem\n     \"confint_item\",  # pg.ErrorBarItem\n     ]\n)\n\n\ndef plot_avg_curve(curve, pen=None, shadow_pen=None, symbol=\"+\",\n                   symbol_size=4, name=None):\n    \"\"\"\n    Construct a `PlotAvgCurve` for the given `curve`.\n\n    :param curve: Source curve.\n    :type curve: ROCAveragedVert or ROCAveragedThresh\n\n    The other parameters are passed to pg.PlotDataItem\n\n    :rtype: PlotAvgCurve\n    \"\"\"\n    pc = plot_curve(curve, pen=pen, shadow_pen=shadow_pen, symbol=symbol,\n                    symbol_size=symbol_size, name=name)\n\n    points = curve.points\n    if isinstance(curve, ROCAveragedVert):\n        tpr_std = curve.tpr_std\n        error_item = pg.ErrorBarItem(\n            x=points.fpr[1:-1], y=points.tpr[1:-1],\n            height=2 * tpr_std[1:-1],\n            pen=pen, beam=0.025,\n            antialias=True,\n        )\n    elif isinstance(curve, ROCAveragedThresh):\n        tpr_std, fpr_std = curve.tpr_std, curve.fpr_std\n        error_item = pg.ErrorBarItem(\n            x=points.fpr[1:-1], y=points.tpr[1:-1],\n            height=2 * tpr_std[1:-1], width=2 * fpr_std[1:-1],\n            pen=pen, beam=0.025,\n            antialias=True,\n        )\n    return PlotAvgCurve(curve, pc.curve_item, pc.hull_item, error_item)\n\nPlotAvgCurve.from_roc_curve = staticmethod(plot_avg_curve)\n\nSome = namedtuple(\"Some\", [\"val\"])\n\n\ndef once(f):\n    \"\"\"\n    Return a function that will be called only once, and it's result cached.\n    \"\"\"\n    cached = None\n\n    @wraps(f)\n    def wraped():\n        nonlocal cached\n        if cached is None:\n            cached = Some(f())\n        return cached.val\n    return wraped\n\n\nPlotCurves = namedtuple(\n    \"PlotCurves\",\n    [\"merge\",   # :: () -> PlotCurve\n     \"folds\",   # :: () -> [PlotCurve]\n     \"avg_vertical\",   # :: () -> PlotAvgCurve\n     \"avg_threshold\",  # :: () -> PlotAvgCurve\n     ]\n)\n\n\nclass InfiniteLine(pg.InfiniteLine):\n    \"\"\"pyqtgraph.InfiniteLine extended to support antialiasing.\n    \"\"\"\n    def __init__(self, pos=None, angle=90, pen=None, movable=False,\n                 bounds=None, antialias=False):\n        super().__init__(pos, angle, pen, movable, bounds)\n        self.antialias = antialias\n\n    def paint(self, p, *args):\n        if self.antialias:\n            p.setRenderHint(QPainter.Antialiasing, True)\n        super().paint(p, *args)\n\n\nclass OWROCAnalysis(widget.OWWidget):\n    name = \"ROC Analysis\"\n    description = \"Display the Receiver Operating Characteristics curve \" \\\n                  \"based on the evaluation of classifiers.\"\n    icon = \"icons/ROCAnalysis.svg\"\n    priority = 1010\n    keywords = \"roc analysis, analyse\"\n\n    class Inputs:\n        evaluation_results = Input(\"Evaluation Results\", Orange.evaluation.Results)\n\n    class Outputs:\n        calibrated_model = Output(\"Calibrated Model\", Model)\n\n    class Information(widget.OWWidget.Information):\n        no_output = Msg(\"Can't output a model: {}\")\n\n    buttons_area_orientation = None\n    settingsHandler = EvaluationResultsContextHandler()\n    target_index = settings.ContextSetting(0)\n    selected_classifiers = settings.ContextSetting([])\n\n    display_perf_line = settings.Setting(True)\n    display_def_threshold = settings.Setting(True)\n\n    fp_cost = settings.Setting(500)\n    fn_cost = settings.Setting(500)\n    target_prior = settings.Setting(50.0, schema_only=True)\n\n    #: ROC Averaging Types\n    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3\n    roc_averaging = settings.Setting(Merge)\n\n    display_convex_hull = settings.Setting(False)\n    display_convex_curve = settings.Setting(False)\n\n    graph_name = \"plot\"  # pg.GraphicsItem (pg.PlotItem)\n\n    def __init__(self):\n        super().__init__()\n\n        self.results = None\n        self.classifier_names = []\n        self.perf_line = None\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n        box = gui.vBox(self.controlArea, \"Plot\")\n        self.target_cb = gui.comboBox(\n            box, self, \"target_index\",\n            label=\"Target\", orientation=Qt.Horizontal,\n            callback=self._on_target_changed,\n            contentsLength=8, searchable=True)\n\n        gui.widgetLabel(box, \"Classifiers\")\n        line_height = 4 * QFontMetrics(self.font()).lineSpacing()\n        self.classifiers_list_box = gui.listBox(\n            box, self, \"selected_classifiers\", \"classifier_names\",\n            selectionMode=QListView.MultiSelection,\n            callback=self._on_classifiers_changed,\n            sizeHint=QSize(0, line_height))\n\n        abox = gui.vBox(self.controlArea, \"Curves\")\n        gui.comboBox(abox, self, \"roc_averaging\",\n                     items=[\"Merge Predictions from Folds\", \"Mean TP Rate\",\n                            \"Mean TP and FP at Threshold\", \"Show Individual Curves\"],\n                     callback=self._replot)\n\n        gui.checkBox(abox, self, \"display_convex_curve\",\n                     \"Show convex ROC curves\", callback=self._replot)\n        gui.checkBox(abox, self, \"display_convex_hull\",\n                     \"Show ROC convex hull\", callback=self._replot)\n\n        box = gui.vBox(self.controlArea, \"Analysis\")\n\n        gui.checkBox(box, self, \"display_def_threshold\",\n                     \"Default threshold (0.5) point\",\n                     callback=self._on_display_def_threshold_changed)\n\n        gui.checkBox(box, self, \"display_perf_line\", \"Show performance line\",\n                     callback=self._on_display_perf_line_changed)\n        grid = QGridLayout()\n        gui.indentedBox(box, orientation=grid)\n\n        sp = gui.spin(box, self, \"fp_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FP Cost:\"), 0, 0)\n        grid.addWidget(sp, 0, 1)\n\n        sp = gui.spin(box, self, \"fn_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FN Cost:\"))\n        grid.addWidget(sp, 1, 1)\n        self.target_prior_sp = gui.spin(box, self, \"target_prior\", 1, 99,\n                                        alignment=Qt.AlignRight,\n                                        spinType=float,\n                                        callback=self._on_target_prior_changed)\n        self.target_prior_sp.setSuffix(\" %\")\n        self.target_prior_sp.addAction(QAction(\"Auto\", sp))\n        grid.addWidget(QLabel(\"Prior probability:\"))\n        grid.addWidget(self.target_prior_sp, 2, 1)\n\n        self.plotview = GraphicsView(background=None)\n        self.plotview.setFrameStyle(QFrame.StyledPanel)\n        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)\n\n        self.plot = PlotItem(enableMenu=False)\n        self.plot.setMouseEnabled(False, False)\n        self.plot.hideButtons()\n\n        tickfont = QFont(self.font())\n        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))\n\n        axis = self.plot.getAxis(\"bottom\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"FP Rate (1-Specificity)\")\n        axis.setGrid(16)\n\n        axis = self.plot.getAxis(\"left\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"TP Rate (Sensitivity)\")\n        axis.setGrid(16)\n\n        self.plot.showGrid(True, True, alpha=0.2)\n        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)\n\n        self.plotview.setCentralItem(self.plot)\n        self.mainArea.layout().addWidget(self.plotview)\n\n    @Inputs.evaluation_results\n    def set_results(self, results):\n        \"\"\"Set the input evaluation results.\"\"\"\n        self.closeContext()\n        self.clear()\n        self.results = check_results_adequacy(results, self.Error)\n        if self.results is not None:\n            self._initialize(self.results)\n            self.openContext(self.results.domain.class_var,\n                             self.classifier_names)\n            self._set_target_prior()\n            self._setup_plot()\n        else:\n            self.warning()\n\n    def clear(self):\n        \"\"\"Clear the widget state.\"\"\"\n        self.results = None\n        self.plot.clear()\n        self.classifier_names = []\n        self.selected_classifiers = []\n        self.target_cb.clear()\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n    def _initialize(self, results):\n        names = getattr(results, \"learner_names\", None)\n\n        if names is None:\n            names = [\"#{}\".format(i + 1)\n                     for i in range(len(results.predicted))]\n\n        self.colors = colorpalettes.get_default_curve_colors(len(names))\n\n        self.classifier_names = names\n        self.selected_classifiers = list(range(len(names)))\n        for i in range(len(names)):\n            listitem = self.classifiers_list_box.item(i)\n            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))\n\n        class_var = results.domain.class_var\n        self.target_cb.addItems(class_var.values)\n        self.target_index = 0\n        self._set_target_prior()\n\n    def _set_target_prior(self):\n        \"\"\"\n        This function sets the initial target class probability prior value\n        based on the input data.\n        \"\"\"\n        if self.results.data:\n            # here we can use target_index directly since values in the\n            # dropdown are sorted in same order than values in the table\n            target_values_cnt = np.count_nonzero(\n                self.results.data.Y == self.target_index)\n            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))\n            self.target_prior = np.round(target_values_cnt / count_all * 100)\n\n            # set the spin text to gray color when set automatically\n            self.target_prior_sp.setStyleSheet(\"color: gray;\")\n\n    def curve_data(self, target, clf_idx):\n        \"\"\"Return `ROCData' for the given target and classifier.\"\"\"\n        if (target, clf_idx) not in self._curve_data:\n            # pylint: disable=no-member\n            data = ROCData.from_results(self.results, clf_idx, target)\n            self._curve_data[target, clf_idx] = data\n\n        return self._curve_data[target, clf_idx]\n\n    def plot_curves(self, target, clf_idx):\n        \"\"\"Return a set of functions `plot_curves` generating plot curves.\"\"\"\n        def generate_pens(basecolor):\n            pen = QPen(basecolor, 1)\n            pen.setCosmetic(True)\n\n            shadow_pen = QPen(pen.color().lighter(160), 2.5)\n            shadow_pen.setCosmetic(True)\n            return pen, shadow_pen\n\n        data = self.curve_data(target, clf_idx)\n\n        if (target, clf_idx) not in self._plot_curves:\n            pen, shadow_pen = generate_pens(self.colors[clf_idx])\n            name = self.classifier_names[clf_idx]\n            @once\n            def merged():\n                return plot_curve(\n                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)\n            @once\n            def folds():\n                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)\n                        for fold in data.folds]\n            @once\n            def avg_vert():\n                return plot_avg_curve(data.avg_vertical, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n            @once\n            def avg_thres():\n                return plot_avg_curve(data.avg_threshold, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n\n            self._plot_curves[target, clf_idx] = PlotCurves(\n                merge=merged, folds=folds,\n                avg_vertical=avg_vert, avg_threshold=avg_thres\n            )\n\n        return self._plot_curves[target, clf_idx]\n\n    def _setup_plot(self):\n        def merge_averaging():\n            for curve in curves:\n                graphics = curve.merge()\n                curve = graphics.curve\n                self.plot.addItem(graphics.curve_item)\n\n                if self.display_convex_curve:\n                    self.plot.addItem(graphics.hull_item)\n\n                if self.display_def_threshold and curve.is_valid:\n                    points = curve.points\n                    ind = np.argmin(np.abs(points.thresholds - 0.5))\n                    item = pg.TextItem(\n                        text=\"{:.3f}\".format(points.thresholds[ind]),\n                        color=foreground\n                    )\n                    item.setPos(points.fpr[ind], points.tpr[ind])\n                    self.plot.addItem(item)\n\n            hull_curves = [curve.merged.hull for curve in selected]\n            if hull_curves:\n                self._rocch = convex_hull(hull_curves)\n                iso_pen = QPen(foreground, 1.0)\n                iso_pen.setCosmetic(True)\n                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)\n                self.plot.addItem(self._perf_line)\n            return hull_curves\n\n        def vertical_averaging():\n            for curve in curves:\n                graphics = curve.avg_vertical()\n\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_vertical.hull for curve in selected]\n\n        def threshold_averaging():\n            for curve in curves:\n                graphics = curve.avg_threshold()\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_threshold.hull for curve in selected]\n\n        def no_averaging():\n            for curve in curves:\n                graphics = curve.folds()\n                for fold in graphics:\n                    self.plot.addItem(fold.curve_item)\n                    if self.display_convex_curve:\n                        self.plot.addItem(fold.hull_item)\n            return [fold.hull for curve in selected for fold in curve.folds]\n\n        averagings = {\n            OWROCAnalysis.Merge: merge_averaging,\n            OWROCAnalysis.Vertical: vertical_averaging,\n            OWROCAnalysis.Threshold: threshold_averaging,\n            OWROCAnalysis.NoAveraging: no_averaging\n        }\n        foreground = self.plotview.scene().palette().color(QPalette.Text)\n        target = self.target_index\n        selected = self.selected_classifiers\n\n        curves = [self.plot_curves(target, i) for i in selected]\n        selected = [self.curve_data(target, i) for i in selected]\n        hull_curves = averagings[self.roc_averaging]()\n\n        if self.display_convex_hull and hull_curves:\n            hull = convex_hull(hull_curves)\n            hull_color = QColor(foreground)\n            hull_color.setAlpha(100)\n            hull_pen = QPen(hull_color, 2)\n            hull_pen.setCosmetic(True)\n            hull_color.setAlpha(50)\n            item = self.plot.plot(\n                hull.fpr, hull.tpr,\n                pen=hull_pen,\n                brush=QBrush(hull_color),\n                fillLevel=0)\n            item.setZValue(-10000)\n        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)\n        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)\n        pen.setCosmetic(True)\n        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)\n\n        self._update_perf_line()\n\n        self._update_axes_ticks()\n\n        warning = \"\"\n        if not all(c.is_valid for c in hull_curves):\n            if any(c.is_valid for c in hull_curves):\n                warning = \"Some ROC curves are undefined\"\n            else:\n                warning = \"All ROC curves are undefined\"\n        self.warning(warning)\n\n    def _update_axes_ticks(self):\n        def enumticks(a):\n            a = np.unique(a)\n            if len(a) > 15:\n                return None\n            return [[(x, f\"{x:.2f}\") for x in a[::-1]]]\n\n        axis_bottom = self.plot.getAxis(\"bottom\")\n        axis_left = self.plot.getAxis(\"left\")\n\n        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \\\n                or self.roc_averaging != OWROCAnalysis.Merge:\n            axis_bottom.setTicks(None)\n            axis_left.setTicks(None)\n        else:\n            data = self.curve_data(self.target_index, self.selected_classifiers[0])\n            points = data.merged.points\n            axis_bottom.setTicks(enumticks(points.fpr))\n            axis_left.setTicks(enumticks(points.tpr))\n\n    def _on_mouse_moved(self, pos):\n        target = self.target_index\n        selected = self.selected_classifiers\n        curves = [(clf_idx, self.plot_curves(target, clf_idx))\n                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]\n        valid_thresh, valid_clf = [], []\n        pt, ave_mode = None, self.roc_averaging\n\n        for clf_idx, crv in curves:\n            if self.roc_averaging == OWROCAnalysis.Merge:\n                curve = crv.merge()\n            elif self.roc_averaging == OWROCAnalysis.Vertical:\n                curve = crv.avg_vertical()\n            elif self.roc_averaging == OWROCAnalysis.Threshold:\n                curve = crv.avg_threshold()\n            else:\n                # currently not implemented for 'Show Individual Curves'\n                return\n\n            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem\n            act_pos = sp.mapFromScene(pos)\n            pts = list(sp.pointsAt(act_pos))\n\n            if pts:\n                mouse_pt = pts[0].pos()\n                if self._tooltip_cache:\n                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache\n                    curr_thresh, curr_clf = [], []\n                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \\\n                            and cache_ave == self.roc_averaging:\n                        mask = np.equal(cache_clf, clf_idx)\n                        curr_thresh = np.compress(mask, cache_thresh).tolist()\n                        curr_clf = np.compress(mask, cache_clf).tolist()\n                    else:\n                        QToolTip.showText(QCursor.pos(), \"\")\n                        self._tooltip_cache = None\n\n                    if curr_thresh:\n                        valid_thresh.append(*curr_thresh)\n                        valid_clf.append(*curr_clf)\n                        pt = cache_pt\n                        continue\n\n                curve_pts = curve.curve.points\n                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))\n                diff = np.subtract(roc_points, mouse_pt)\n                # Find closest point on curve and save the corresponding threshold\n                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))\n\n                thresh = curve_pts.thresholds[idx_closest]\n                if not np.isnan(thresh):\n                    valid_thresh.append(thresh)\n                    valid_clf.append(clf_idx)\n                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]\n\n        if valid_thresh:\n            clf_names = self.classifier_names\n            msg = \"Thresholds:\\n\" + \"\\n\".join([\"({:s}) {:.3f}\".format(clf_names[i], thresh)\n                                               for i, thresh in zip(valid_clf, valid_thresh)])\n            QToolTip.showText(QCursor.pos(), msg)\n            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)\n\n    def _on_target_changed(self):\n        self.plot.clear()\n        self._set_target_prior()\n        self._setup_plot()\n\n    def _on_classifiers_changed(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _on_target_prior_changed(self):\n        self.target_prior_sp.setStyleSheet(\"color: black;\")\n        self._on_display_perf_line_changed()\n\n    def _on_display_perf_line_changed(self):\n        self._update_perf_line()\n\n        if self.perf_line is not None:\n            self.perf_line.setVisible(self.display_perf_line)\n\n    def _on_display_def_threshold_changed(self):\n        self._replot()\n\n    def _replot(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _update_perf_line(self):\n\n        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:\n            self._update_output(None)\n            return\n\n        ind = None\n        self._perf_line.setVisible(self.display_perf_line)\n        if self.display_perf_line:\n            m = roc_iso_performance_slope(\n                self.fp_cost, self.fn_cost, self.target_prior / 100.0)\n\n            hull = self._rocch\n            if hull.is_valid:\n                ind = roc_iso_performance_line(m, hull)\n                angle = np.arctan2(m, 1)  # in radians\n                self._perf_line.setAngle(angle * 180 / np.pi)\n                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))\n            else:\n                self._perf_line.setVisible(False)\n\n        self._update_output(None if ind is None else hull.thresholds[ind[0]])\n\n    def _update_output(self, threshold):\n        self.Information.no_output.clear()\n\n        if threshold is None:\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        problems = check_can_calibrate(self.results, self.selected_classifiers)\n        if problems:\n            self.Information.no_output(problems)\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        model = ThresholdClassifier(\n            self.results.models[0][self.selected_classifiers[0]],\n            threshold)\n        self.Outputs.calibrated_model.send(model)\n\n    def onDeleteWidget(self):\n        self.clear()\n\n    def send_report(self):\n        if self.results is None:\n            return\n        items = OrderedDict()\n        items[\"Target class\"] = self.target_cb.currentText()\n        if self.display_perf_line:\n            items[\"Costs\"] = \\\n                \"FP = {}, FN = {}\".format(self.fp_cost, self.fn_cost)\n            items[\"Target probability\"] = \"{} %\".format(self.target_prior)\n        caption = report.list_legend(self.classifiers_list_box,\n                                     self.selected_classifiers)\n        self.report_items(items)\n        self.report_plot()\n        self.report_caption(caption)\n\n\ndef interp(x, xp, fp, left=None, right=None):\n    \"\"\"\n    Like numpy.interp except for handling of running sequences of\n    same values in `xp`.\n    \"\"\"\n    x = np.asanyarray(x)\n    xp = np.asanyarray(xp)\n    fp = np.asanyarray(fp)\n\n    if xp.shape != fp.shape:\n        raise ValueError(\"xp and fp must have the same shape\")\n\n    ind = np.searchsorted(xp, x, side=\"right\")\n    fx = np.zeros(len(x))\n\n    under = ind == 0\n    over = ind == len(xp)\n    between = ~under & ~over\n\n    fx[under] = left if left is not None else fp[0]\n    fx[over] = right if right is not None else fp[-1]\n\n    if right is not None:\n        # Fix points exactly on the right boundary.\n        fx[x == xp[-1]] = fp[-1]\n\n    ind = ind[between]\n\n    df = (fp[ind] - fp[ind - 1]) / (xp[ind] - xp[ind - 1])\n\n    fx[between] = df * (x[between] - xp[ind]) + fp[ind]\n\n    return fx\n\n\ndef roc_curve_for_fold(res, fold, clf_idx, target):\n    fold_actual = res.actual[fold]\n    P = np.sum(fold_actual == target)\n    N = fold_actual.size - P\n\n    if P == 0 or N == 0:\n        # Undefined TP and FP rate\n        return np.array([]), np.array([]), np.array([])\n\n    fold_probs = res.probabilities[clf_idx][fold][:, target]\n    drop_intermediate = len(fold_actual) > 20\n    fpr, tpr, thresholds = skl_metrics.roc_curve(\n        fold_actual, fold_probs, pos_label=target,\n        drop_intermediate=drop_intermediate\n    )\n\n    # skl sets the first threshold to the highest threshold in the data + 1\n    # since we deal with probabilities, we (carefully) set it to 1\n    # Unrelated comparisons, thus pylint: disable=chained-comparison\n    if len(thresholds) > 1 and thresholds[1] <= 1:\n        thresholds[0] = 1\n    return fpr, tpr, thresholds\n\n\ndef roc_curve_vertical_average(curves, samples=10):\n    if not curves:\n        raise ValueError(\"No curves\")\n    fpr_sample = np.linspace(0.0, 1.0, samples)\n    tpr_samples = []\n    for fpr, tpr, _ in curves:\n        tpr_samples.append(interp(fpr_sample, fpr, tpr, left=0, right=1))\n\n    tpr_samples = np.array(tpr_samples)\n    return fpr_sample, tpr_samples.mean(axis=0), tpr_samples.std(axis=0)\n\n\ndef roc_curve_threshold_average(curves, thresh_samples):\n    if not curves:\n        raise ValueError(\"No curves\")\n    fpr_samples, tpr_samples = [], []\n    for fpr, tpr, thresh in curves:\n        ind = np.searchsorted(thresh[::-1], thresh_samples, side=\"left\")\n        ind = ind[::-1]\n        ind = np.clip(ind, 0, len(thresh) - 1)\n        fpr_samples.append(fpr[ind])\n        tpr_samples.append(tpr[ind])\n\n    fpr_samples = np.array(fpr_samples)\n    tpr_samples = np.array(tpr_samples)\n\n    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),\n            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))\n\n\ndef roc_curve_thresh_avg_interp(curves, thresh_samples):\n    fpr_samples, tpr_samples = [], []\n    for fpr, tpr, thresh in curves:\n        thresh = thresh[::-1]\n        fpr = interp(thresh_samples, thresh, fpr[::-1], left=1.0, right=0.0)\n        tpr = interp(thresh_samples, thresh, tpr[::-1], left=1.0, right=0.0)\n        fpr_samples.append(fpr)\n        tpr_samples.append(tpr)\n\n    fpr_samples = np.array(fpr_samples)\n    tpr_samples = np.array(tpr_samples)\n\n    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),\n            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))\n\n\nRocPoint = namedtuple(\"RocPoint\", [\"fpr\", \"tpr\", \"threshold\"])\n\n\ndef roc_curve_convex_hull(curve):\n    def slope(p1, p2):\n        x1, y1, _ = p1\n        x2, y2, _ = p2\n        if x1 != x2:\n            return  (y2 - y1) / (x2 - x1)\n        else:\n            return np.inf\n\n    fpr, _, _ = curve\n\n    if len(fpr) <= 2:\n        return curve\n    points = map(RocPoint._make, zip(*curve))\n\n    hull = deque([next(points)])\n\n    for point in points:\n        while True:\n            if len(hull) < 2:\n                hull.append(point)\n                break\n            else:\n                last = hull[-1]\n                if point.fpr != last.fpr and \\\n                        slope(hull[-2], last) > slope(last, point):\n                    hull.append(point)\n                    break\n                else:\n                    hull.pop()\n\n    fpr = np.array([p.fpr for p in hull])\n    tpr = np.array([p.tpr for p in hull])\n    thres = np.array([p.threshold for p in hull])\n    return (fpr, tpr, thres)\n\n\ndef convex_hull(curves):\n    def slope(p1, p2):\n        x1, y1, *_ = p1\n        x2, y2, *_ = p2\n        if x1 != x2:\n            return (y2 - y1) / (x2 - x1)\n        else:\n            return np.inf\n\n    curves = [list(map(RocPoint._make, zip(*curve))) for curve in curves]\n\n    merged_points = reduce(operator.iadd, curves, [])\n    merged_points = sorted(merged_points)\n\n    if not merged_points:\n        return ROCPoints(np.array([]), np.array([]), np.array([]))\n\n    if len(merged_points) <= 2:\n        return ROCPoints._make(map(np.array, zip(*merged_points)))\n\n    points = iter(merged_points)\n\n    hull = deque([next(points)])\n\n    for point in points:\n        while True:\n            if len(hull) < 2:\n                hull.append(point)\n                break\n            else:\n                last = hull[-1]\n                if point[0] != last[0] and \\\n                        slope(hull[-2], last) > slope(last, point):\n                    hull.append(point)\n                    break\n                else:\n                    hull.pop()\n\n    return ROCPoints._make(map(np.array, zip(*hull)))\n\n\ndef roc_iso_performance_line(slope, hull, tol=1e-5):\n    \"\"\"\n    Return the indices where a line with `slope` touches the ROC convex hull.\n    \"\"\"\n    fpr, tpr, *_ = hull\n\n    # Compute the distance of each point to a reference iso line\n    # going through point (0, 1). The point(s) with the minimum\n    # distance are our result\n\n    # y = m * x + 1\n    # m * x - 1y + 1 = 0\n    a, b, c = slope, -1, 1\n    dist = distance_to_line(a, b, c, fpr, tpr)\n    mindist = np.min(dist)\n\n    return np.flatnonzero((dist - mindist) <= tol)\n\n\ndef distance_to_line(a, b, c, x0, y0):\n    \"\"\"\n    Return the distance to a line ax + by + c = 0\n    \"\"\"\n    assert a != 0 or b != 0\n    return np.abs(a * x0 + b * y0 + c) / np.sqrt(a ** 2 + b ** 2)\n\n\ndef roc_iso_performance_slope(fp_cost, fn_cost, p):\n    assert 0 <= p <= 1\n    if fn_cost * p == 0:\n        return np.inf\n    else:\n        return (fp_cost * (1. - p)) / (fn_cost * p)\n\n\ndef _create_results():  # pragma: no cover\n    probs1 = [0.984, 0.907, 0.881, 0.865, 0.815, 0.741, 0.735, 0.635,\n              0.582, 0.554, 0.413, 0.317, 0.287, 0.225, 0.216, 0.183]\n    probs = np.array([[[1 - x, x] for x in probs1]])\n    preds = (probs > 0.5).astype(float)\n    return Results(\n        data=Orange.data.Table(\"heart_disease\")[:16],\n        row_indices=np.arange(16),\n        actual=np.array(list(map(int, \"1100111001001000\"))),\n        probabilities=probs, predicted=preds\n    )\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    # WidgetPreview(OWROCAnalysis).run(_create_results())\n    WidgetPreview(OWROCAnalysis).run(results_for_preview())\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/evaluate/owrocanalysis.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "1a82f769b",
                "new_commit_hash": "8a42c0ba7",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/evaluate/owrocanalysis.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/evaluate/owrocanalysis.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 442,
                            "length": 6
                        },
                        "new_range": {
                            "start": 442,
                            "length": 7
                        },
                        "section": "class OWROCAnalysis(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            self._initialize(self.results)",
                                "type": "context"
                            },
                            {
                                "content": "            self.openContext(self.results.domain.class_var,",
                                "type": "context"
                            },
                            {
                                "content": "                             self.classifier_names)",
                                "type": "context"
                            },
                            {
                                "content": "            self._set_target_prior()",
                                "type": "added"
                            },
                            {
                                "content": "            self._setup_plot()",
                                "type": "context"
                            },
                            {
                                "content": "        else:",
                                "type": "context"
                            },
                            {
                                "content": "            self.warning()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/evaluate/owrocanalysis.py",
                            "type": "class",
                            "name": "OWROCAnalysis",
                            "content": "class OWROCAnalysis(widget.OWWidget):\n    name = \"ROC Analysis\"\n    description = \"Display the Receiver Operating Characteristics curve \" \\\n                  \"based on the evaluation of classifiers.\"\n    icon = \"icons/ROCAnalysis.svg\"\n    priority = 1010\n    keywords = \"roc analysis, analyse\"\n\n    class Inputs:\n        evaluation_results = Input(\"Evaluation Results\", Orange.evaluation.Results)\n\n    class Outputs:\n        calibrated_model = Output(\"Calibrated Model\", Model)\n\n    class Information(widget.OWWidget.Information):\n        no_output = Msg(\"Can't output a model: {}\")\n\n    buttons_area_orientation = None\n    settingsHandler = EvaluationResultsContextHandler()\n    target_index = settings.ContextSetting(0)\n    selected_classifiers = settings.ContextSetting([])\n\n    display_perf_line = settings.Setting(True)\n    display_def_threshold = settings.Setting(True)\n\n    fp_cost = settings.Setting(500)\n    fn_cost = settings.Setting(500)\n    target_prior = settings.Setting(50.0, schema_only=True)\n\n    #: ROC Averaging Types\n    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3\n    roc_averaging = settings.Setting(Merge)\n\n    display_convex_hull = settings.Setting(False)\n    display_convex_curve = settings.Setting(False)\n\n    graph_name = \"plot\"  # pg.GraphicsItem (pg.PlotItem)\n\n    def __init__(self):\n        super().__init__()\n\n        self.results = None\n        self.classifier_names = []\n        self.perf_line = None\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n        box = gui.vBox(self.controlArea, \"Plot\")\n        self.target_cb = gui.comboBox(\n            box, self, \"target_index\",\n            label=\"Target\", orientation=Qt.Horizontal,\n            callback=self._on_target_changed,\n            contentsLength=8, searchable=True)\n\n        gui.widgetLabel(box, \"Classifiers\")\n        line_height = 4 * QFontMetrics(self.font()).lineSpacing()\n        self.classifiers_list_box = gui.listBox(\n            box, self, \"selected_classifiers\", \"classifier_names\",\n            selectionMode=QListView.MultiSelection,\n            callback=self._on_classifiers_changed,\n            sizeHint=QSize(0, line_height))\n\n        abox = gui.vBox(self.controlArea, \"Curves\")\n        gui.comboBox(abox, self, \"roc_averaging\",\n                     items=[\"Merge Predictions from Folds\", \"Mean TP Rate\",\n                            \"Mean TP and FP at Threshold\", \"Show Individual Curves\"],\n                     callback=self._replot)\n\n        gui.checkBox(abox, self, \"display_convex_curve\",\n                     \"Show convex ROC curves\", callback=self._replot)\n        gui.checkBox(abox, self, \"display_convex_hull\",\n                     \"Show ROC convex hull\", callback=self._replot)\n\n        box = gui.vBox(self.controlArea, \"Analysis\")\n\n        gui.checkBox(box, self, \"display_def_threshold\",\n                     \"Default threshold (0.5) point\",\n                     callback=self._on_display_def_threshold_changed)\n\n        gui.checkBox(box, self, \"display_perf_line\", \"Show performance line\",\n                     callback=self._on_display_perf_line_changed)\n        grid = QGridLayout()\n        gui.indentedBox(box, orientation=grid)\n\n        sp = gui.spin(box, self, \"fp_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FP Cost:\"), 0, 0)\n        grid.addWidget(sp, 0, 1)\n\n        sp = gui.spin(box, self, \"fn_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FN Cost:\"))\n        grid.addWidget(sp, 1, 1)\n        self.target_prior_sp = gui.spin(box, self, \"target_prior\", 1, 99,\n                                        alignment=Qt.AlignRight,\n                                        spinType=float,\n                                        callback=self._on_target_prior_changed)\n        self.target_prior_sp.setSuffix(\" %\")\n        self.target_prior_sp.addAction(QAction(\"Auto\", sp))\n        grid.addWidget(QLabel(\"Prior probability:\"))\n        grid.addWidget(self.target_prior_sp, 2, 1)\n\n        self.plotview = GraphicsView(background=None)\n        self.plotview.setFrameStyle(QFrame.StyledPanel)\n        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)\n\n        self.plot = PlotItem(enableMenu=False)\n        self.plot.setMouseEnabled(False, False)\n        self.plot.hideButtons()\n\n        tickfont = QFont(self.font())\n        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))\n\n        axis = self.plot.getAxis(\"bottom\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"FP Rate (1-Specificity)\")\n        axis.setGrid(16)\n\n        axis = self.plot.getAxis(\"left\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"TP Rate (Sensitivity)\")\n        axis.setGrid(16)\n\n        self.plot.showGrid(True, True, alpha=0.2)\n        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)\n\n        self.plotview.setCentralItem(self.plot)\n        self.mainArea.layout().addWidget(self.plotview)\n\n    @Inputs.evaluation_results\n    def set_results(self, results):\n        \"\"\"Set the input evaluation results.\"\"\"\n        self.closeContext()\n        self.clear()\n        self.results = check_results_adequacy(results, self.Error)\n        if self.results is not None:\n            self._initialize(self.results)\n            self.openContext(self.results.domain.class_var,\n                             self.classifier_names)\n            self._set_target_prior()\n            self._setup_plot()\n        else:\n            self.warning()\n\n    def clear(self):\n        \"\"\"Clear the widget state.\"\"\"\n        self.results = None\n        self.plot.clear()\n        self.classifier_names = []\n        self.selected_classifiers = []\n        self.target_cb.clear()\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n    def _initialize(self, results):\n        names = getattr(results, \"learner_names\", None)\n\n        if names is None:\n            names = [\"#{}\".format(i + 1)\n                     for i in range(len(results.predicted))]\n\n        self.colors = colorpalettes.get_default_curve_colors(len(names))\n\n        self.classifier_names = names\n        self.selected_classifiers = list(range(len(names)))\n        for i in range(len(names)):\n            listitem = self.classifiers_list_box.item(i)\n            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))\n\n        class_var = results.domain.class_var\n        self.target_cb.addItems(class_var.values)\n        self.target_index = 0\n        self._set_target_prior()\n\n    def _set_target_prior(self):\n        \"\"\"\n        This function sets the initial target class probability prior value\n        based on the input data.\n        \"\"\"\n        if self.results.data:\n            # here we can use target_index directly since values in the\n            # dropdown are sorted in same order than values in the table\n            target_values_cnt = np.count_nonzero(\n                self.results.data.Y == self.target_index)\n            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))\n            self.target_prior = np.round(target_values_cnt / count_all * 100)\n\n            # set the spin text to gray color when set automatically\n            self.target_prior_sp.setStyleSheet(\"color: gray;\")\n\n    def curve_data(self, target, clf_idx):\n        \"\"\"Return `ROCData' for the given target and classifier.\"\"\"\n        if (target, clf_idx) not in self._curve_data:\n            # pylint: disable=no-member\n            data = ROCData.from_results(self.results, clf_idx, target)\n            self._curve_data[target, clf_idx] = data\n\n        return self._curve_data[target, clf_idx]\n\n    def plot_curves(self, target, clf_idx):\n        \"\"\"Return a set of functions `plot_curves` generating plot curves.\"\"\"\n        def generate_pens(basecolor):\n            pen = QPen(basecolor, 1)\n            pen.setCosmetic(True)\n\n            shadow_pen = QPen(pen.color().lighter(160), 2.5)\n            shadow_pen.setCosmetic(True)\n            return pen, shadow_pen\n\n        data = self.curve_data(target, clf_idx)\n\n        if (target, clf_idx) not in self._plot_curves:\n            pen, shadow_pen = generate_pens(self.colors[clf_idx])\n            name = self.classifier_names[clf_idx]\n            @once\n            def merged():\n                return plot_curve(\n                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)\n            @once\n            def folds():\n                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)\n                        for fold in data.folds]\n            @once\n            def avg_vert():\n                return plot_avg_curve(data.avg_vertical, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n            @once\n            def avg_thres():\n                return plot_avg_curve(data.avg_threshold, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n\n            self._plot_curves[target, clf_idx] = PlotCurves(\n                merge=merged, folds=folds,\n                avg_vertical=avg_vert, avg_threshold=avg_thres\n            )\n\n        return self._plot_curves[target, clf_idx]\n\n    def _setup_plot(self):\n        def merge_averaging():\n            for curve in curves:\n                graphics = curve.merge()\n                curve = graphics.curve\n                self.plot.addItem(graphics.curve_item)\n\n                if self.display_convex_curve:\n                    self.plot.addItem(graphics.hull_item)\n\n                if self.display_def_threshold and curve.is_valid:\n                    points = curve.points\n                    ind = np.argmin(np.abs(points.thresholds - 0.5))\n                    item = pg.TextItem(\n                        text=\"{:.3f}\".format(points.thresholds[ind]),\n                        color=foreground\n                    )\n                    item.setPos(points.fpr[ind], points.tpr[ind])\n                    self.plot.addItem(item)\n\n            hull_curves = [curve.merged.hull for curve in selected]\n            if hull_curves:\n                self._rocch = convex_hull(hull_curves)\n                iso_pen = QPen(foreground, 1.0)\n                iso_pen.setCosmetic(True)\n                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)\n                self.plot.addItem(self._perf_line)\n            return hull_curves\n\n        def vertical_averaging():\n            for curve in curves:\n                graphics = curve.avg_vertical()\n\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_vertical.hull for curve in selected]\n\n        def threshold_averaging():\n            for curve in curves:\n                graphics = curve.avg_threshold()\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_threshold.hull for curve in selected]\n\n        def no_averaging():\n            for curve in curves:\n                graphics = curve.folds()\n                for fold in graphics:\n                    self.plot.addItem(fold.curve_item)\n                    if self.display_convex_curve:\n                        self.plot.addItem(fold.hull_item)\n            return [fold.hull for curve in selected for fold in curve.folds]\n\n        averagings = {\n            OWROCAnalysis.Merge: merge_averaging,\n            OWROCAnalysis.Vertical: vertical_averaging,\n            OWROCAnalysis.Threshold: threshold_averaging,\n            OWROCAnalysis.NoAveraging: no_averaging\n        }\n        foreground = self.plotview.scene().palette().color(QPalette.Text)\n        target = self.target_index\n        selected = self.selected_classifiers\n\n        curves = [self.plot_curves(target, i) for i in selected]\n        selected = [self.curve_data(target, i) for i in selected]\n        hull_curves = averagings[self.roc_averaging]()\n\n        if self.display_convex_hull and hull_curves:\n            hull = convex_hull(hull_curves)\n            hull_color = QColor(foreground)\n            hull_color.setAlpha(100)\n            hull_pen = QPen(hull_color, 2)\n            hull_pen.setCosmetic(True)\n            hull_color.setAlpha(50)\n            item = self.plot.plot(\n                hull.fpr, hull.tpr,\n                pen=hull_pen,\n                brush=QBrush(hull_color),\n                fillLevel=0)\n            item.setZValue(-10000)\n        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)\n        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)\n        pen.setCosmetic(True)\n        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)\n\n        self._update_perf_line()\n\n        self._update_axes_ticks()\n\n        warning = \"\"\n        if not all(c.is_valid for c in hull_curves):\n            if any(c.is_valid for c in hull_curves):\n                warning = \"Some ROC curves are undefined\"\n            else:\n                warning = \"All ROC curves are undefined\"\n        self.warning(warning)\n\n    def _update_axes_ticks(self):\n        def enumticks(a):\n            a = np.unique(a)\n            if len(a) > 15:\n                return None\n            return [[(x, f\"{x:.2f}\") for x in a[::-1]]]\n\n        axis_bottom = self.plot.getAxis(\"bottom\")\n        axis_left = self.plot.getAxis(\"left\")\n\n        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \\\n                or self.roc_averaging != OWROCAnalysis.Merge:\n            axis_bottom.setTicks(None)\n            axis_left.setTicks(None)\n        else:\n            data = self.curve_data(self.target_index, self.selected_classifiers[0])\n            points = data.merged.points\n            axis_bottom.setTicks(enumticks(points.fpr))\n            axis_left.setTicks(enumticks(points.tpr))\n\n    def _on_mouse_moved(self, pos):\n        target = self.target_index\n        selected = self.selected_classifiers\n        curves = [(clf_idx, self.plot_curves(target, clf_idx))\n                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]\n        valid_thresh, valid_clf = [], []\n        pt, ave_mode = None, self.roc_averaging\n\n        for clf_idx, crv in curves:\n            if self.roc_averaging == OWROCAnalysis.Merge:\n                curve = crv.merge()\n            elif self.roc_averaging == OWROCAnalysis.Vertical:\n                curve = crv.avg_vertical()\n            elif self.roc_averaging == OWROCAnalysis.Threshold:\n                curve = crv.avg_threshold()\n            else:\n                # currently not implemented for 'Show Individual Curves'\n                return\n\n            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem\n            act_pos = sp.mapFromScene(pos)\n            pts = list(sp.pointsAt(act_pos))\n\n            if pts:\n                mouse_pt = pts[0].pos()\n                if self._tooltip_cache:\n                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache\n                    curr_thresh, curr_clf = [], []\n                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \\\n                            and cache_ave == self.roc_averaging:\n                        mask = np.equal(cache_clf, clf_idx)\n                        curr_thresh = np.compress(mask, cache_thresh).tolist()\n                        curr_clf = np.compress(mask, cache_clf).tolist()\n                    else:\n                        QToolTip.showText(QCursor.pos(), \"\")\n                        self._tooltip_cache = None\n\n                    if curr_thresh:\n                        valid_thresh.append(*curr_thresh)\n                        valid_clf.append(*curr_clf)\n                        pt = cache_pt\n                        continue\n\n                curve_pts = curve.curve.points\n                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))\n                diff = np.subtract(roc_points, mouse_pt)\n                # Find closest point on curve and save the corresponding threshold\n                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))\n\n                thresh = curve_pts.thresholds[idx_closest]\n                if not np.isnan(thresh):\n                    valid_thresh.append(thresh)\n                    valid_clf.append(clf_idx)\n                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]\n\n        if valid_thresh:\n            clf_names = self.classifier_names\n            msg = \"Thresholds:\\n\" + \"\\n\".join([\"({:s}) {:.3f}\".format(clf_names[i], thresh)\n                                               for i, thresh in zip(valid_clf, valid_thresh)])\n            QToolTip.showText(QCursor.pos(), msg)\n            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)\n\n    def _on_target_changed(self):\n        self.plot.clear()\n        self._set_target_prior()\n        self._setup_plot()\n\n    def _on_classifiers_changed(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _on_target_prior_changed(self):\n        self.target_prior_sp.setStyleSheet(\"color: black;\")\n        self._on_display_perf_line_changed()\n\n    def _on_display_perf_line_changed(self):\n        self._update_perf_line()\n\n        if self.perf_line is not None:\n            self.perf_line.setVisible(self.display_perf_line)\n\n    def _on_display_def_threshold_changed(self):\n        self._replot()\n\n    def _replot(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _update_perf_line(self):\n\n        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:\n            self._update_output(None)\n            return\n\n        ind = None\n        self._perf_line.setVisible(self.display_perf_line)\n        if self.display_perf_line:\n            m = roc_iso_performance_slope(\n                self.fp_cost, self.fn_cost, self.target_prior / 100.0)\n\n            hull = self._rocch\n            if hull.is_valid:\n                ind = roc_iso_performance_line(m, hull)\n                angle = np.arctan2(m, 1)  # in radians\n                self._perf_line.setAngle(angle * 180 / np.pi)\n                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))\n            else:\n                self._perf_line.setVisible(False)\n\n        self._update_output(None if ind is None else hull.thresholds[ind[0]])\n\n    def _update_output(self, threshold):\n        self.Information.no_output.clear()\n\n        if threshold is None:\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        problems = check_can_calibrate(self.results, self.selected_classifiers)\n        if problems:\n            self.Information.no_output(problems)\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        model = ThresholdClassifier(\n            self.results.models[0][self.selected_classifiers[0]],\n            threshold)\n        self.Outputs.calibrated_model.send(model)\n\n    def onDeleteWidget(self):\n        self.clear()\n\n    def send_report(self):\n        if self.results is None:\n            return\n        items = OrderedDict()\n        items[\"Target class\"] = self.target_cb.currentText()\n        if self.display_perf_line:\n            items[\"Costs\"] = \\\n                \"FP = {}, FN = {}\".format(self.fp_cost, self.fn_cost)\n            items[\"Target probability\"] = \"{} %\".format(self.target_prior)\n        caption = report.list_legend(self.classifiers_list_box,\n                                     self.selected_classifiers)\n        self.report_items(items)\n        self.report_plot()\n        self.report_caption(caption)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 300,
                            "end_lineno": 812,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/evaluate/owrocanalysis.py",
                            "type": "method",
                            "name": "OWROCAnalysis.set_results",
                            "content": "class OWROCAnalysis(widget.OWWidget):\n    name = \"ROC Analysis\"\n    description = \"Display the Receiver Operating Characteristics curve \" \\\n                  \"based on the evaluation of classifiers.\"\n    icon = \"icons/ROCAnalysis.svg\"\n    priority = 1010\n    keywords = \"roc analysis, analyse\"\n\n    class Inputs:\n        evaluation_results = Input(\"Evaluation Results\", Orange.evaluation.Results)\n\n    class Outputs:\n        calibrated_model = Output(\"Calibrated Model\", Model)\n\n    class Information(widget.OWWidget.Information):\n        no_output = Msg(\"Can't output a model: {}\")\n\n    buttons_area_orientation = None\n    settingsHandler = EvaluationResultsContextHandler()\n    target_index = settings.ContextSetting(0)\n    selected_classifiers = settings.ContextSetting([])\n\n    display_perf_line = settings.Setting(True)\n    display_def_threshold = settings.Setting(True)\n\n    fp_cost = settings.Setting(500)\n    fn_cost = settings.Setting(500)\n    target_prior = settings.Setting(50.0, schema_only=True)\n\n    #: ROC Averaging Types\n    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3\n    roc_averaging = settings.Setting(Merge)\n\n    display_convex_hull = settings.Setting(False)\n    display_convex_curve = settings.Setting(False)\n\n    graph_name = \"plot\"  # pg.GraphicsItem (pg.PlotItem)\n\n    def __init__(self):\n        super().__init__()\n\n        self.results = None\n        self.classifier_names = []\n        self.perf_line = None\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n        box = gui.vBox(self.controlArea, \"Plot\")\n        self.target_cb = gui.comboBox(\n            box, self, \"target_index\",\n            label=\"Target\", orientation=Qt.Horizontal,\n            callback=self._on_target_changed,\n            contentsLength=8, searchable=True)\n\n        gui.widgetLabel(box, \"Classifiers\")\n        line_height = 4 * QFontMetrics(self.font()).lineSpacing()\n        self.classifiers_list_box = gui.listBox(\n            box, self, \"selected_classifiers\", \"classifier_names\",\n            selectionMode=QListView.MultiSelection,\n            callback=self._on_classifiers_changed,\n            sizeHint=QSize(0, line_height))\n\n        abox = gui.vBox(self.controlArea, \"Curves\")\n        gui.comboBox(abox, self, \"roc_averaging\",\n                     items=[\"Merge Predictions from Folds\", \"Mean TP Rate\",\n                            \"Mean TP and FP at Threshold\", \"Show Individual Curves\"],\n                     callback=self._replot)\n\n        gui.checkBox(abox, self, \"display_convex_curve\",\n                     \"Show convex ROC curves\", callback=self._replot)\n        gui.checkBox(abox, self, \"display_convex_hull\",\n                     \"Show ROC convex hull\", callback=self._replot)\n\n        box = gui.vBox(self.controlArea, \"Analysis\")\n\n        gui.checkBox(box, self, \"display_def_threshold\",\n                     \"Default threshold (0.5) point\",\n                     callback=self._on_display_def_threshold_changed)\n\n        gui.checkBox(box, self, \"display_perf_line\", \"Show performance line\",\n                     callback=self._on_display_perf_line_changed)\n        grid = QGridLayout()\n        gui.indentedBox(box, orientation=grid)\n\n        sp = gui.spin(box, self, \"fp_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FP Cost:\"), 0, 0)\n        grid.addWidget(sp, 0, 1)\n\n        sp = gui.spin(box, self, \"fn_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FN Cost:\"))\n        grid.addWidget(sp, 1, 1)\n        self.target_prior_sp = gui.spin(box, self, \"target_prior\", 1, 99,\n                                        alignment=Qt.AlignRight,\n                                        spinType=float,\n                                        callback=self._on_target_prior_changed)\n        self.target_prior_sp.setSuffix(\" %\")\n        self.target_prior_sp.addAction(QAction(\"Auto\", sp))\n        grid.addWidget(QLabel(\"Prior probability:\"))\n        grid.addWidget(self.target_prior_sp, 2, 1)\n\n        self.plotview = GraphicsView(background=None)\n        self.plotview.setFrameStyle(QFrame.StyledPanel)\n        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)\n\n        self.plot = PlotItem(enableMenu=False)\n        self.plot.setMouseEnabled(False, False)\n        self.plot.hideButtons()\n\n        tickfont = QFont(self.font())\n        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))\n\n        axis = self.plot.getAxis(\"bottom\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"FP Rate (1-Specificity)\")\n        axis.setGrid(16)\n\n        axis = self.plot.getAxis(\"left\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"TP Rate (Sensitivity)\")\n        axis.setGrid(16)\n\n        self.plot.showGrid(True, True, alpha=0.2)\n        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)\n\n        self.plotview.setCentralItem(self.plot)\n        self.mainArea.layout().addWidget(self.plotview)\n\n    @Inputs.evaluation_results\n    def set_results(self, results):\n        \"\"\"Set the input evaluation results.\"\"\"\n        self.closeContext()\n        self.clear()\n        self.results = check_results_adequacy(results, self.Error)\n        if self.results is not None:\n            self._initialize(self.results)\n            self.openContext(self.results.domain.class_var,\n                             self.classifier_names)\n            self._set_target_prior()\n            self._setup_plot()\n        else:\n            self.warning()\n\n    def clear(self):\n        \"\"\"Clear the widget state.\"\"\"\n        self.results = None\n        self.plot.clear()\n        self.classifier_names = []\n        self.selected_classifiers = []\n        self.target_cb.clear()\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n    def _initialize(self, results):\n        names = getattr(results, \"learner_names\", None)\n\n        if names is None:\n            names = [\"#{}\".format(i + 1)\n                     for i in range(len(results.predicted))]\n\n        self.colors = colorpalettes.get_default_curve_colors(len(names))\n\n        self.classifier_names = names\n        self.selected_classifiers = list(range(len(names)))\n        for i in range(len(names)):\n            listitem = self.classifiers_list_box.item(i)\n            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))\n\n        class_var = results.domain.class_var\n        self.target_cb.addItems(class_var.values)\n        self.target_index = 0\n        self._set_target_prior()\n\n    def _set_target_prior(self):\n        \"\"\"\n        This function sets the initial target class probability prior value\n        based on the input data.\n        \"\"\"\n        if self.results.data:\n            # here we can use target_index directly since values in the\n            # dropdown are sorted in same order than values in the table\n            target_values_cnt = np.count_nonzero(\n                self.results.data.Y == self.target_index)\n            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))\n            self.target_prior = np.round(target_values_cnt / count_all * 100)\n\n            # set the spin text to gray color when set automatically\n            self.target_prior_sp.setStyleSheet(\"color: gray;\")\n\n    def curve_data(self, target, clf_idx):\n        \"\"\"Return `ROCData' for the given target and classifier.\"\"\"\n        if (target, clf_idx) not in self._curve_data:\n            # pylint: disable=no-member\n            data = ROCData.from_results(self.results, clf_idx, target)\n            self._curve_data[target, clf_idx] = data\n\n        return self._curve_data[target, clf_idx]\n\n    def plot_curves(self, target, clf_idx):\n        \"\"\"Return a set of functions `plot_curves` generating plot curves.\"\"\"\n        def generate_pens(basecolor):\n            pen = QPen(basecolor, 1)\n            pen.setCosmetic(True)\n\n            shadow_pen = QPen(pen.color().lighter(160), 2.5)\n            shadow_pen.setCosmetic(True)\n            return pen, shadow_pen\n\n        data = self.curve_data(target, clf_idx)\n\n        if (target, clf_idx) not in self._plot_curves:\n            pen, shadow_pen = generate_pens(self.colors[clf_idx])\n            name = self.classifier_names[clf_idx]\n            @once\n            def merged():\n                return plot_curve(\n                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)\n            @once\n            def folds():\n                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)\n                        for fold in data.folds]\n            @once\n            def avg_vert():\n                return plot_avg_curve(data.avg_vertical, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n            @once\n            def avg_thres():\n                return plot_avg_curve(data.avg_threshold, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n\n            self._plot_curves[target, clf_idx] = PlotCurves(\n                merge=merged, folds=folds,\n                avg_vertical=avg_vert, avg_threshold=avg_thres\n            )\n\n        return self._plot_curves[target, clf_idx]\n\n    def _setup_plot(self):\n        def merge_averaging():\n            for curve in curves:\n                graphics = curve.merge()\n                curve = graphics.curve\n                self.plot.addItem(graphics.curve_item)\n\n                if self.display_convex_curve:\n                    self.plot.addItem(graphics.hull_item)\n\n                if self.display_def_threshold and curve.is_valid:\n                    points = curve.points\n                    ind = np.argmin(np.abs(points.thresholds - 0.5))\n                    item = pg.TextItem(\n                        text=\"{:.3f}\".format(points.thresholds[ind]),\n                        color=foreground\n                    )\n                    item.setPos(points.fpr[ind], points.tpr[ind])\n                    self.plot.addItem(item)\n\n            hull_curves = [curve.merged.hull for curve in selected]\n            if hull_curves:\n                self._rocch = convex_hull(hull_curves)\n                iso_pen = QPen(foreground, 1.0)\n                iso_pen.setCosmetic(True)\n                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)\n                self.plot.addItem(self._perf_line)\n            return hull_curves\n\n        def vertical_averaging():\n            for curve in curves:\n                graphics = curve.avg_vertical()\n\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_vertical.hull for curve in selected]\n\n        def threshold_averaging():\n            for curve in curves:\n                graphics = curve.avg_threshold()\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_threshold.hull for curve in selected]\n\n        def no_averaging():\n            for curve in curves:\n                graphics = curve.folds()\n                for fold in graphics:\n                    self.plot.addItem(fold.curve_item)\n                    if self.display_convex_curve:\n                        self.plot.addItem(fold.hull_item)\n            return [fold.hull for curve in selected for fold in curve.folds]\n\n        averagings = {\n            OWROCAnalysis.Merge: merge_averaging,\n            OWROCAnalysis.Vertical: vertical_averaging,\n            OWROCAnalysis.Threshold: threshold_averaging,\n            OWROCAnalysis.NoAveraging: no_averaging\n        }\n        foreground = self.plotview.scene().palette().color(QPalette.Text)\n        target = self.target_index\n        selected = self.selected_classifiers\n\n        curves = [self.plot_curves(target, i) for i in selected]\n        selected = [self.curve_data(target, i) for i in selected]\n        hull_curves = averagings[self.roc_averaging]()\n\n        if self.display_convex_hull and hull_curves:\n            hull = convex_hull(hull_curves)\n            hull_color = QColor(foreground)\n            hull_color.setAlpha(100)\n            hull_pen = QPen(hull_color, 2)\n            hull_pen.setCosmetic(True)\n            hull_color.setAlpha(50)\n            item = self.plot.plot(\n                hull.fpr, hull.tpr,\n                pen=hull_pen,\n                brush=QBrush(hull_color),\n                fillLevel=0)\n            item.setZValue(-10000)\n        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)\n        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)\n        pen.setCosmetic(True)\n        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)\n\n        self._update_perf_line()\n\n        self._update_axes_ticks()\n\n        warning = \"\"\n        if not all(c.is_valid for c in hull_curves):\n            if any(c.is_valid for c in hull_curves):\n                warning = \"Some ROC curves are undefined\"\n            else:\n                warning = \"All ROC curves are undefined\"\n        self.warning(warning)\n\n    def _update_axes_ticks(self):\n        def enumticks(a):\n            a = np.unique(a)\n            if len(a) > 15:\n                return None\n            return [[(x, f\"{x:.2f}\") for x in a[::-1]]]\n\n        axis_bottom = self.plot.getAxis(\"bottom\")\n        axis_left = self.plot.getAxis(\"left\")\n\n        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \\\n                or self.roc_averaging != OWROCAnalysis.Merge:\n            axis_bottom.setTicks(None)\n            axis_left.setTicks(None)\n        else:\n            data = self.curve_data(self.target_index, self.selected_classifiers[0])\n            points = data.merged.points\n            axis_bottom.setTicks(enumticks(points.fpr))\n            axis_left.setTicks(enumticks(points.tpr))\n\n    def _on_mouse_moved(self, pos):\n        target = self.target_index\n        selected = self.selected_classifiers\n        curves = [(clf_idx, self.plot_curves(target, clf_idx))\n                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]\n        valid_thresh, valid_clf = [], []\n        pt, ave_mode = None, self.roc_averaging\n\n        for clf_idx, crv in curves:\n            if self.roc_averaging == OWROCAnalysis.Merge:\n                curve = crv.merge()\n            elif self.roc_averaging == OWROCAnalysis.Vertical:\n                curve = crv.avg_vertical()\n            elif self.roc_averaging == OWROCAnalysis.Threshold:\n                curve = crv.avg_threshold()\n            else:\n                # currently not implemented for 'Show Individual Curves'\n                return\n\n            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem\n            act_pos = sp.mapFromScene(pos)\n            pts = list(sp.pointsAt(act_pos))\n\n            if pts:\n                mouse_pt = pts[0].pos()\n                if self._tooltip_cache:\n                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache\n                    curr_thresh, curr_clf = [], []\n                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \\\n                            and cache_ave == self.roc_averaging:\n                        mask = np.equal(cache_clf, clf_idx)\n                        curr_thresh = np.compress(mask, cache_thresh).tolist()\n                        curr_clf = np.compress(mask, cache_clf).tolist()\n                    else:\n                        QToolTip.showText(QCursor.pos(), \"\")\n                        self._tooltip_cache = None\n\n                    if curr_thresh:\n                        valid_thresh.append(*curr_thresh)\n                        valid_clf.append(*curr_clf)\n                        pt = cache_pt\n                        continue\n\n                curve_pts = curve.curve.points\n                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))\n                diff = np.subtract(roc_points, mouse_pt)\n                # Find closest point on curve and save the corresponding threshold\n                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))\n\n                thresh = curve_pts.thresholds[idx_closest]\n                if not np.isnan(thresh):\n                    valid_thresh.append(thresh)\n                    valid_clf.append(clf_idx)\n                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]\n\n        if valid_thresh:\n            clf_names = self.classifier_names\n            msg = \"Thresholds:\\n\" + \"\\n\".join([\"({:s}) {:.3f}\".format(clf_names[i], thresh)\n                                               for i, thresh in zip(valid_clf, valid_thresh)])\n            QToolTip.showText(QCursor.pos(), msg)\n            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)\n\n    def _on_target_changed(self):\n        self.plot.clear()\n        self._set_target_prior()\n        self._setup_plot()\n\n    def _on_classifiers_changed(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _on_target_prior_changed(self):\n        self.target_prior_sp.setStyleSheet(\"color: black;\")\n        self._on_display_perf_line_changed()\n\n    def _on_display_perf_line_changed(self):\n        self._update_perf_line()\n\n        if self.perf_line is not None:\n            self.perf_line.setVisible(self.display_perf_line)\n\n    def _on_display_def_threshold_changed(self):\n        self._replot()\n\n    def _replot(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _update_perf_line(self):\n\n        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:\n            self._update_output(None)\n            return\n\n        ind = None\n        self._perf_line.setVisible(self.display_perf_line)\n        if self.display_perf_line:\n            m = roc_iso_performance_slope(\n                self.fp_cost, self.fn_cost, self.target_prior / 100.0)\n\n            hull = self._rocch\n            if hull.is_valid:\n                ind = roc_iso_performance_line(m, hull)\n                angle = np.arctan2(m, 1)  # in radians\n                self._perf_line.setAngle(angle * 180 / np.pi)\n                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))\n            else:\n                self._perf_line.setVisible(False)\n\n        self._update_output(None if ind is None else hull.thresholds[ind[0]])\n\n    def _update_output(self, threshold):\n        self.Information.no_output.clear()\n\n        if threshold is None:\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        problems = check_can_calibrate(self.results, self.selected_classifiers)\n        if problems:\n            self.Information.no_output(problems)\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        model = ThresholdClassifier(\n            self.results.models[0][self.selected_classifiers[0]],\n            threshold)\n        self.Outputs.calibrated_model.send(model)\n\n    def onDeleteWidget(self):\n        self.clear()\n\n    def send_report(self):\n        if self.results is None:\n            return\n        items = OrderedDict()\n        items[\"Target class\"] = self.target_cb.currentText()\n        if self.display_perf_line:\n            items[\"Costs\"] = \\\n                \"FP = {}, FN = {}\".format(self.fp_cost, self.fn_cost)\n            items[\"Target probability\"] = \"{} %\".format(self.target_prior)\n        caption = report.list_legend(self.classifiers_list_box,\n                                     self.selected_classifiers)\n        self.report_items(items)\n        self.report_plot()\n        self.report_caption(caption)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 436,
                            "end_lineno": 448,
                            "parent": {
                                "file_name": "Orange/widgets/evaluate/owrocanalysis.py",
                                "type": "class",
                                "name": "OWROCAnalysis",
                                "content": "class OWROCAnalysis(widget.OWWidget):\n    name = \"ROC Analysis\"\n    description = \"Display the Receiver Operating Characteristics curve \" \\\n                  \"based on the evaluation of classifiers.\"\n    icon = \"icons/ROCAnalysis.svg\"\n    priority = 1010\n    keywords = \"roc analysis, analyse\"\n\n    class Inputs:\n        evaluation_results = Input(\"Evaluation Results\", Orange.evaluation.Results)\n\n    class Outputs:\n        calibrated_model = Output(\"Calibrated Model\", Model)\n\n    class Information(widget.OWWidget.Information):\n        no_output = Msg(\"Can't output a model: {}\")\n\n    buttons_area_orientation = None\n    settingsHandler = EvaluationResultsContextHandler()\n    target_index = settings.ContextSetting(0)\n    selected_classifiers = settings.ContextSetting([])\n\n    display_perf_line = settings.Setting(True)\n    display_def_threshold = settings.Setting(True)\n\n    fp_cost = settings.Setting(500)\n    fn_cost = settings.Setting(500)\n    target_prior = settings.Setting(50.0, schema_only=True)\n\n    #: ROC Averaging Types\n    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3\n    roc_averaging = settings.Setting(Merge)\n\n    display_convex_hull = settings.Setting(False)\n    display_convex_curve = settings.Setting(False)\n\n    graph_name = \"plot\"  # pg.GraphicsItem (pg.PlotItem)\n\n    def __init__(self):\n        super().__init__()\n\n        self.results = None\n        self.classifier_names = []\n        self.perf_line = None\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n        box = gui.vBox(self.controlArea, \"Plot\")\n        self.target_cb = gui.comboBox(\n            box, self, \"target_index\",\n            label=\"Target\", orientation=Qt.Horizontal,\n            callback=self._on_target_changed,\n            contentsLength=8, searchable=True)\n\n        gui.widgetLabel(box, \"Classifiers\")\n        line_height = 4 * QFontMetrics(self.font()).lineSpacing()\n        self.classifiers_list_box = gui.listBox(\n            box, self, \"selected_classifiers\", \"classifier_names\",\n            selectionMode=QListView.MultiSelection,\n            callback=self._on_classifiers_changed,\n            sizeHint=QSize(0, line_height))\n\n        abox = gui.vBox(self.controlArea, \"Curves\")\n        gui.comboBox(abox, self, \"roc_averaging\",\n                     items=[\"Merge Predictions from Folds\", \"Mean TP Rate\",\n                            \"Mean TP and FP at Threshold\", \"Show Individual Curves\"],\n                     callback=self._replot)\n\n        gui.checkBox(abox, self, \"display_convex_curve\",\n                     \"Show convex ROC curves\", callback=self._replot)\n        gui.checkBox(abox, self, \"display_convex_hull\",\n                     \"Show ROC convex hull\", callback=self._replot)\n\n        box = gui.vBox(self.controlArea, \"Analysis\")\n\n        gui.checkBox(box, self, \"display_def_threshold\",\n                     \"Default threshold (0.5) point\",\n                     callback=self._on_display_def_threshold_changed)\n\n        gui.checkBox(box, self, \"display_perf_line\", \"Show performance line\",\n                     callback=self._on_display_perf_line_changed)\n        grid = QGridLayout()\n        gui.indentedBox(box, orientation=grid)\n\n        sp = gui.spin(box, self, \"fp_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FP Cost:\"), 0, 0)\n        grid.addWidget(sp, 0, 1)\n\n        sp = gui.spin(box, self, \"fn_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FN Cost:\"))\n        grid.addWidget(sp, 1, 1)\n        self.target_prior_sp = gui.spin(box, self, \"target_prior\", 1, 99,\n                                        alignment=Qt.AlignRight,\n                                        spinType=float,\n                                        callback=self._on_target_prior_changed)\n        self.target_prior_sp.setSuffix(\" %\")\n        self.target_prior_sp.addAction(QAction(\"Auto\", sp))\n        grid.addWidget(QLabel(\"Prior probability:\"))\n        grid.addWidget(self.target_prior_sp, 2, 1)\n\n        self.plotview = GraphicsView(background=None)\n        self.plotview.setFrameStyle(QFrame.StyledPanel)\n        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)\n\n        self.plot = PlotItem(enableMenu=False)\n        self.plot.setMouseEnabled(False, False)\n        self.plot.hideButtons()\n\n        tickfont = QFont(self.font())\n        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))\n\n        axis = self.plot.getAxis(\"bottom\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"FP Rate (1-Specificity)\")\n        axis.setGrid(16)\n\n        axis = self.plot.getAxis(\"left\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"TP Rate (Sensitivity)\")\n        axis.setGrid(16)\n\n        self.plot.showGrid(True, True, alpha=0.2)\n        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)\n\n        self.plotview.setCentralItem(self.plot)\n        self.mainArea.layout().addWidget(self.plotview)\n\n    @Inputs.evaluation_results\n    def set_results(self, results):\n        \"\"\"Set the input evaluation results.\"\"\"\n        self.closeContext()\n        self.clear()\n        self.results = check_results_adequacy(results, self.Error)\n        if self.results is not None:\n            self._initialize(self.results)\n            self.openContext(self.results.domain.class_var,\n                             self.classifier_names)\n            self._set_target_prior()\n            self._setup_plot()\n        else:\n            self.warning()\n\n    def clear(self):\n        \"\"\"Clear the widget state.\"\"\"\n        self.results = None\n        self.plot.clear()\n        self.classifier_names = []\n        self.selected_classifiers = []\n        self.target_cb.clear()\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n    def _initialize(self, results):\n        names = getattr(results, \"learner_names\", None)\n\n        if names is None:\n            names = [\"#{}\".format(i + 1)\n                     for i in range(len(results.predicted))]\n\n        self.colors = colorpalettes.get_default_curve_colors(len(names))\n\n        self.classifier_names = names\n        self.selected_classifiers = list(range(len(names)))\n        for i in range(len(names)):\n            listitem = self.classifiers_list_box.item(i)\n            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))\n\n        class_var = results.domain.class_var\n        self.target_cb.addItems(class_var.values)\n        self.target_index = 0\n        self._set_target_prior()\n\n    def _set_target_prior(self):\n        \"\"\"\n        This function sets the initial target class probability prior value\n        based on the input data.\n        \"\"\"\n        if self.results.data:\n            # here we can use target_index directly since values in the\n            # dropdown are sorted in same order than values in the table\n            target_values_cnt = np.count_nonzero(\n                self.results.data.Y == self.target_index)\n            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))\n            self.target_prior = np.round(target_values_cnt / count_all * 100)\n\n            # set the spin text to gray color when set automatically\n            self.target_prior_sp.setStyleSheet(\"color: gray;\")\n\n    def curve_data(self, target, clf_idx):\n        \"\"\"Return `ROCData' for the given target and classifier.\"\"\"\n        if (target, clf_idx) not in self._curve_data:\n            # pylint: disable=no-member\n            data = ROCData.from_results(self.results, clf_idx, target)\n            self._curve_data[target, clf_idx] = data\n\n        return self._curve_data[target, clf_idx]\n\n    def plot_curves(self, target, clf_idx):\n        \"\"\"Return a set of functions `plot_curves` generating plot curves.\"\"\"\n        def generate_pens(basecolor):\n            pen = QPen(basecolor, 1)\n            pen.setCosmetic(True)\n\n            shadow_pen = QPen(pen.color().lighter(160), 2.5)\n            shadow_pen.setCosmetic(True)\n            return pen, shadow_pen\n\n        data = self.curve_data(target, clf_idx)\n\n        if (target, clf_idx) not in self._plot_curves:\n            pen, shadow_pen = generate_pens(self.colors[clf_idx])\n            name = self.classifier_names[clf_idx]\n            @once\n            def merged():\n                return plot_curve(\n                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)\n            @once\n            def folds():\n                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)\n                        for fold in data.folds]\n            @once\n            def avg_vert():\n                return plot_avg_curve(data.avg_vertical, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n            @once\n            def avg_thres():\n                return plot_avg_curve(data.avg_threshold, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n\n            self._plot_curves[target, clf_idx] = PlotCurves(\n                merge=merged, folds=folds,\n                avg_vertical=avg_vert, avg_threshold=avg_thres\n            )\n\n        return self._plot_curves[target, clf_idx]\n\n    def _setup_plot(self):\n        def merge_averaging():\n            for curve in curves:\n                graphics = curve.merge()\n                curve = graphics.curve\n                self.plot.addItem(graphics.curve_item)\n\n                if self.display_convex_curve:\n                    self.plot.addItem(graphics.hull_item)\n\n                if self.display_def_threshold and curve.is_valid:\n                    points = curve.points\n                    ind = np.argmin(np.abs(points.thresholds - 0.5))\n                    item = pg.TextItem(\n                        text=\"{:.3f}\".format(points.thresholds[ind]),\n                        color=foreground\n                    )\n                    item.setPos(points.fpr[ind], points.tpr[ind])\n                    self.plot.addItem(item)\n\n            hull_curves = [curve.merged.hull for curve in selected]\n            if hull_curves:\n                self._rocch = convex_hull(hull_curves)\n                iso_pen = QPen(foreground, 1.0)\n                iso_pen.setCosmetic(True)\n                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)\n                self.plot.addItem(self._perf_line)\n            return hull_curves\n\n        def vertical_averaging():\n            for curve in curves:\n                graphics = curve.avg_vertical()\n\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_vertical.hull for curve in selected]\n\n        def threshold_averaging():\n            for curve in curves:\n                graphics = curve.avg_threshold()\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_threshold.hull for curve in selected]\n\n        def no_averaging():\n            for curve in curves:\n                graphics = curve.folds()\n                for fold in graphics:\n                    self.plot.addItem(fold.curve_item)\n                    if self.display_convex_curve:\n                        self.plot.addItem(fold.hull_item)\n            return [fold.hull for curve in selected for fold in curve.folds]\n\n        averagings = {\n            OWROCAnalysis.Merge: merge_averaging,\n            OWROCAnalysis.Vertical: vertical_averaging,\n            OWROCAnalysis.Threshold: threshold_averaging,\n            OWROCAnalysis.NoAveraging: no_averaging\n        }\n        foreground = self.plotview.scene().palette().color(QPalette.Text)\n        target = self.target_index\n        selected = self.selected_classifiers\n\n        curves = [self.plot_curves(target, i) for i in selected]\n        selected = [self.curve_data(target, i) for i in selected]\n        hull_curves = averagings[self.roc_averaging]()\n\n        if self.display_convex_hull and hull_curves:\n            hull = convex_hull(hull_curves)\n            hull_color = QColor(foreground)\n            hull_color.setAlpha(100)\n            hull_pen = QPen(hull_color, 2)\n            hull_pen.setCosmetic(True)\n            hull_color.setAlpha(50)\n            item = self.plot.plot(\n                hull.fpr, hull.tpr,\n                pen=hull_pen,\n                brush=QBrush(hull_color),\n                fillLevel=0)\n            item.setZValue(-10000)\n        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)\n        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)\n        pen.setCosmetic(True)\n        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)\n\n        self._update_perf_line()\n\n        self._update_axes_ticks()\n\n        warning = \"\"\n        if not all(c.is_valid for c in hull_curves):\n            if any(c.is_valid for c in hull_curves):\n                warning = \"Some ROC curves are undefined\"\n            else:\n                warning = \"All ROC curves are undefined\"\n        self.warning(warning)\n\n    def _update_axes_ticks(self):\n        def enumticks(a):\n            a = np.unique(a)\n            if len(a) > 15:\n                return None\n            return [[(x, f\"{x:.2f}\") for x in a[::-1]]]\n\n        axis_bottom = self.plot.getAxis(\"bottom\")\n        axis_left = self.plot.getAxis(\"left\")\n\n        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \\\n                or self.roc_averaging != OWROCAnalysis.Merge:\n            axis_bottom.setTicks(None)\n            axis_left.setTicks(None)\n        else:\n            data = self.curve_data(self.target_index, self.selected_classifiers[0])\n            points = data.merged.points\n            axis_bottom.setTicks(enumticks(points.fpr))\n            axis_left.setTicks(enumticks(points.tpr))\n\n    def _on_mouse_moved(self, pos):\n        target = self.target_index\n        selected = self.selected_classifiers\n        curves = [(clf_idx, self.plot_curves(target, clf_idx))\n                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]\n        valid_thresh, valid_clf = [], []\n        pt, ave_mode = None, self.roc_averaging\n\n        for clf_idx, crv in curves:\n            if self.roc_averaging == OWROCAnalysis.Merge:\n                curve = crv.merge()\n            elif self.roc_averaging == OWROCAnalysis.Vertical:\n                curve = crv.avg_vertical()\n            elif self.roc_averaging == OWROCAnalysis.Threshold:\n                curve = crv.avg_threshold()\n            else:\n                # currently not implemented for 'Show Individual Curves'\n                return\n\n            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem\n            act_pos = sp.mapFromScene(pos)\n            pts = list(sp.pointsAt(act_pos))\n\n            if pts:\n                mouse_pt = pts[0].pos()\n                if self._tooltip_cache:\n                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache\n                    curr_thresh, curr_clf = [], []\n                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \\\n                            and cache_ave == self.roc_averaging:\n                        mask = np.equal(cache_clf, clf_idx)\n                        curr_thresh = np.compress(mask, cache_thresh).tolist()\n                        curr_clf = np.compress(mask, cache_clf).tolist()\n                    else:\n                        QToolTip.showText(QCursor.pos(), \"\")\n                        self._tooltip_cache = None\n\n                    if curr_thresh:\n                        valid_thresh.append(*curr_thresh)\n                        valid_clf.append(*curr_clf)\n                        pt = cache_pt\n                        continue\n\n                curve_pts = curve.curve.points\n                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))\n                diff = np.subtract(roc_points, mouse_pt)\n                # Find closest point on curve and save the corresponding threshold\n                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))\n\n                thresh = curve_pts.thresholds[idx_closest]\n                if not np.isnan(thresh):\n                    valid_thresh.append(thresh)\n                    valid_clf.append(clf_idx)\n                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]\n\n        if valid_thresh:\n            clf_names = self.classifier_names\n            msg = \"Thresholds:\\n\" + \"\\n\".join([\"({:s}) {:.3f}\".format(clf_names[i], thresh)\n                                               for i, thresh in zip(valid_clf, valid_thresh)])\n            QToolTip.showText(QCursor.pos(), msg)\n            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)\n\n    def _on_target_changed(self):\n        self.plot.clear()\n        self._set_target_prior()\n        self._setup_plot()\n\n    def _on_classifiers_changed(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _on_target_prior_changed(self):\n        self.target_prior_sp.setStyleSheet(\"color: black;\")\n        self._on_display_perf_line_changed()\n\n    def _on_display_perf_line_changed(self):\n        self._update_perf_line()\n\n        if self.perf_line is not None:\n            self.perf_line.setVisible(self.display_perf_line)\n\n    def _on_display_def_threshold_changed(self):\n        self._replot()\n\n    def _replot(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _update_perf_line(self):\n\n        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:\n            self._update_output(None)\n            return\n\n        ind = None\n        self._perf_line.setVisible(self.display_perf_line)\n        if self.display_perf_line:\n            m = roc_iso_performance_slope(\n                self.fp_cost, self.fn_cost, self.target_prior / 100.0)\n\n            hull = self._rocch\n            if hull.is_valid:\n                ind = roc_iso_performance_line(m, hull)\n                angle = np.arctan2(m, 1)  # in radians\n                self._perf_line.setAngle(angle * 180 / np.pi)\n                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))\n            else:\n                self._perf_line.setVisible(False)\n\n        self._update_output(None if ind is None else hull.thresholds[ind[0]])\n\n    def _update_output(self, threshold):\n        self.Information.no_output.clear()\n\n        if threshold is None:\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        problems = check_can_calibrate(self.results, self.selected_classifiers)\n        if problems:\n            self.Information.no_output(problems)\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        model = ThresholdClassifier(\n            self.results.models[0][self.selected_classifiers[0]],\n            threshold)\n        self.Outputs.calibrated_model.send(model)\n\n    def onDeleteWidget(self):\n        self.clear()\n\n    def send_report(self):\n        if self.results is None:\n            return\n        items = OrderedDict()\n        items[\"Target class\"] = self.target_cb.currentText()\n        if self.display_perf_line:\n            items[\"Costs\"] = \\\n                \"FP = {}, FN = {}\".format(self.fp_cost, self.fn_cost)\n            items[\"Target probability\"] = \"{} %\".format(self.target_prior)\n        caption = report.list_legend(self.classifiers_list_box,\n                                     self.selected_classifiers)\n        self.report_items(items)\n        self.report_plot()\n        self.report_caption(caption)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 300,
                                "end_lineno": 812,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# pylint: disable=protected-access\nimport copy\nimport unittest\nfrom unittest.mock import patch, Mock\n\nimport numpy as np\nimport pyqtgraph as pg\nfrom AnyQt.QtWidgets import QToolTip\nfrom AnyQt.QtCore import QItemSelection\n\nfrom Orange.data import Table\nimport Orange.evaluation\nimport Orange.classification\nfrom Orange.evaluation import Results\n\nfrom Orange.widgets.evaluate import owrocanalysis\nfrom Orange.widgets.evaluate.owrocanalysis import OWROCAnalysis\nfrom Orange.widgets.evaluate.tests.base import EvaluateTest\nfrom Orange.widgets.tests.utils import mouseMove, simulate\nfrom Orange.tests import test_filename\n\n\nclass TestROC(unittest.TestCase):\n    def test_ROCData_from_results(self):\n        data = Orange.data.Table(\"iris\")\n        learners = [\n            Orange.classification.MajorityLearner(),\n            Orange.classification.LogisticRegressionLearner(),\n            Orange.classification.TreeLearner()\n        ]\n        cv = Orange.evaluation.CrossValidation(k=10)\n        res = cv(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 10)\n                self.assertTrue(all(c.is_valid for c in rocdata.folds))\n                self.assertTrue(rocdata.avg_vertical.is_valid)\n                self.assertTrue(rocdata.avg_threshold.is_valid)\n\n        # fixed random seed because otherwise it could happen that data sample\n        # contained only instances of two classes (and the test then fails)\n        # Pylint complains about RandomState; pylint: disable=no-member\n        data = data[np.random.RandomState(0).choice(len(data), size=20)]\n        loo = Orange.evaluation.LeaveOneOut()\n        res = loo(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 20)\n                # all individual fold curves and averaged curve data\n                # should be invalid\n                self.assertTrue(all(not c.is_valid for c in rocdata.folds))\n                self.assertFalse(rocdata.avg_vertical.is_valid)\n                self.assertFalse(rocdata.avg_threshold.is_valid)\n\n        # equivalent test to the LeaveOneOut but from a slightly different\n        # constructed Orange.evaluation.Results\n        cv = Orange.evaluation.CrossValidation(k=20)\n        res = cv(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 20)\n                # all individual fold curves and averaged curve data\n                # should be invalid\n                self.assertTrue(all(not c.is_valid for c in rocdata.folds))\n                self.assertFalse(rocdata.avg_vertical.is_valid)\n                self.assertFalse(rocdata.avg_threshold.is_valid)\n\n\nclass TestOWROCAnalysis(EvaluateTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.lenses = data = Table(test_filename(\"datasets/lenses.tab\"))\n        totd = Orange.evaluation.TestOnTestData(\n            store_data=True,\n        )\n        cls.res = totd(\n            data=data[::2], test_data=data[1::2],\n            learners=[Orange.classification.MajorityLearner(),\n                      Orange.classification.KNNLearner()]\n        )\n        try:\n            # 'mouseRateLimit' interferes with mouse move tests\n            pg.setConfigOption(\"mouseRateLimit\", -1)\n        except KeyError:\n            pass\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(\n            OWROCAnalysis,\n            stored_settings={\n                \"display_perf_line\": True,\n                \"display_def_threshold\": True,\n                \"display_convex_hull\": True,\n                \"display_convex_curve\": True\n            }\n        )  # type: OWROCAnalysis\n\n    def tearDown(self):\n        super().tearDown()\n        self.widget.onDeleteWidget()\n        self.widgets.remove(self.widget)\n        self.widget = None\n\n    @staticmethod\n    def _set_list_selection(listview, selection):\n        model = listview.model()\n        selectionmodel = listview.selectionModel()\n        itemselection = QItemSelection()\n        for item in selection:\n            itemselection.select(model.index(item, 0), model.index(item, 0))\n        selectionmodel.select(itemselection, selectionmodel.ClearAndSelect)\n\n    def test_basic(self):\n        res = self.res\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n\n    def test_empty_input(self):\n        res = Orange.evaluation.Results(\n            data=self.lenses[:0], nmethods=2, store_data=True)\n        res.row_indices = np.array([], dtype=int)\n        res.actual = np.array([])\n        res.predicted = np.zeros((2, 0))\n        res.probabilities = np.zeros((2, 0, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n        res.row_indices = np.array([1], dtype=int)\n        res.actual = np.array([0.0])\n        res.predicted = np.zeros((2, 1))\n        res.probabilities = np.zeros((2, 1, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n    def test_nan_input(self):\n        res = copy.copy(self.res)\n        res.actual = res.actual.copy()\n        res.predicted = res.predicted.copy()\n        res.probabilities = res.probabilities.copy()\n\n        res.actual[0] = np.nan\n        res.predicted[:, 1] = np.nan\n        res.probabilities[0, 1, :] = np.nan\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.assertTrue(self.widget.Error.invalid_results.is_shown())\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n        self.assertFalse(self.widget.Error.invalid_results.is_shown())\n\n    def test_tooltips(self):\n        # See https://people.inf.elte.hu/kiss/11dwhdm/roc.pdf for the curve\n        # representing this data\n        actual = np.array([float(c == \"n\") for c in \"ppnpppnnpnpnpnnnpnpn\"])\n        p = np.array([.9, .8, .7, .6, .55, .54, .53, .52, .51, .505,\n                      .4, .39, .38, .37, .36, .35, .34, .33, .30, .1])\n        n = 1 - p\n        predicted = (p > .5).astype(float)\n\n        # The second curve is like the first except for the first three points:\n        # it goes to the right and then up\n        p2 = p.copy()\n        p2[:4] = [0.7, 0.8, 0.9, 0.59]\n        n2 = 1 - p2\n        predicted2 = (p2 < .5).astype(float)\n\n        data = Orange.data.Table(\n            Orange.data.Domain(\n                [],\n                [Orange.data.DiscreteVariable(\"y\", values=tuple(\"pn\"))]),\n            np.empty((len(p), 0), dtype=float),\n            actual\n        )\n        res = Results(\n            data=data,\n            actual=actual,\n            predicted=np.array([list(predicted), list(predicted2)]),\n            probabilities=np.array([list(zip(p, n)), list(zip(p2, n2))])\n        )\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget.target_index = 0\n        self.widget.selected_classifiers = [0, 1]\n        vb = self.widget.plot.getViewBox()\n        vb.childTransform()  # Force pyqtgraph to update transforms\n\n        curve = self.widget.plot_curves(self.widget.target_index, 0)\n        curve_merge = curve.merge()\n        view = self.widget.plotview\n        item = curve_merge.curve_item  # type: pg.PlotCurveItem\n\n        with patch.object(QToolTip, \"showText\") as show_text:\n            # no tooltips to be shown\n            pos = item.mapToScene(0.0, 1.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n            # test single point\n            pos = item.mapToScene(0, 0.1)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.900\", text)\n            self.assertNotIn(\"#2\", text)\n\n            # test overlapping points\n            pos = item.mapToScene(0.0, 0.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 1.000\\n(#2) 1.000\", text)\n\n            pos = item.mapToScene(0.1, 0.3)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test that cache is invalidated when changing averaging mode\n            self.widget.roc_averaging = OWROCAnalysis.Threshold\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test nan thresholds\n            self.widget.roc_averaging = OWROCAnalysis.Vertical\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n    def test_target_prior(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        # hard selected\n        self.assertEqual(np.round(4/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"none\")\n        self.assertEqual(np.round(3/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_apply_no_output(self, *_):\n        \"\"\"Test no output warnings\"\"\"\n        # Similar to test_owcalibrationplot, but just a little different, hence\n        # pylint: disable=duplicate-code\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        multiple_folds, multiple_selected, no_models, non_binary_class = \"abcd\"\n        messages = {\n            multiple_folds:\n                \"each training data sample produces a different model\",\n            no_models:\n                \"test results do not contain stored models - try testing on \"\n                \"separate data or on training data\",\n            multiple_selected:\n                \"select a single model - the widget can output only one\",\n            non_binary_class:\n                \"cannot calibrate non-binary models\"}\n\n        def test_shown(shown):\n            widget_msg = widget.Information.no_output\n            output = self.get_output(widget.Outputs.calibrated_model)\n            if not shown:\n                self.assertFalse(widget_msg.is_shown())\n                self.assertIsNotNone(output)\n            else:\n                self.assertTrue(widget_msg.is_shown())\n                self.assertIsNone(output)\n                for msg_id in shown:\n                    msg = messages[msg_id]\n                    self.assertIn(msg, widget_msg.formatted,\n                                  f\"{msg} not included in the message\")\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected})\n\n        self._set_list_selection(model_list, [0])\n        test_shown(())\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNone(output)\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNotNone(output)\n\n        self._set_list_selection(model_list, [0, 1])\n\n        self.results.models = None\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, no_models})\n\n        self.send_signal(widget.Inputs.evaluation_results, self.lenses_results)\n        test_shown({multiple_selected, non_binary_class})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({non_binary_class})\n\n        self.results.folds = [slice(0, 5), slice(5, 10), slice(10, 19)]\n        self.results.models = np.array([[Mock(), Mock()]] * 3)\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, multiple_folds})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({multiple_folds})\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_calibrated_output(self, tc):\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        self._set_list_selection(model_list, [0])\n\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.47)\n\n        widget.controls.fp_cost.setValue(1000)\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.9)\n\n        self._set_list_selection(model_list, [1])\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][1])\n        self.assertAlmostEqual(threshold, 0.45)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "# pylint: disable=protected-access\nimport copy\nimport unittest\nfrom unittest.mock import patch, Mock\n\nimport numpy as np\nimport pyqtgraph as pg\nfrom AnyQt.QtWidgets import QToolTip\nfrom AnyQt.QtCore import QItemSelection\n\nfrom Orange.data import Table\nimport Orange.evaluation\nimport Orange.classification\nfrom Orange.evaluation import Results\n\nfrom Orange.widgets.evaluate import owrocanalysis\nfrom Orange.widgets.evaluate.owrocanalysis import OWROCAnalysis\nfrom Orange.widgets.evaluate.tests.base import EvaluateTest\nfrom Orange.widgets.tests.utils import mouseMove, simulate\nfrom Orange.tests import test_filename\n\n\nclass TestROC(unittest.TestCase):\n    def test_ROCData_from_results(self):\n        data = Orange.data.Table(\"iris\")\n        learners = [\n            Orange.classification.MajorityLearner(),\n            Orange.classification.LogisticRegressionLearner(),\n            Orange.classification.TreeLearner()\n        ]\n        cv = Orange.evaluation.CrossValidation(k=10)\n        res = cv(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 10)\n                self.assertTrue(all(c.is_valid for c in rocdata.folds))\n                self.assertTrue(rocdata.avg_vertical.is_valid)\n                self.assertTrue(rocdata.avg_threshold.is_valid)\n\n        # fixed random seed because otherwise it could happen that data sample\n        # contained only instances of two classes (and the test then fails)\n        # Pylint complains about RandomState; pylint: disable=no-member\n        data = data[np.random.RandomState(0).choice(len(data), size=20)]\n        loo = Orange.evaluation.LeaveOneOut()\n        res = loo(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 20)\n                # all individual fold curves and averaged curve data\n                # should be invalid\n                self.assertTrue(all(not c.is_valid for c in rocdata.folds))\n                self.assertFalse(rocdata.avg_vertical.is_valid)\n                self.assertFalse(rocdata.avg_threshold.is_valid)\n\n        # equivalent test to the LeaveOneOut but from a slightly different\n        # constructed Orange.evaluation.Results\n        cv = Orange.evaluation.CrossValidation(k=20)\n        res = cv(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 20)\n                # all individual fold curves and averaged curve data\n                # should be invalid\n                self.assertTrue(all(not c.is_valid for c in rocdata.folds))\n                self.assertFalse(rocdata.avg_vertical.is_valid)\n                self.assertFalse(rocdata.avg_threshold.is_valid)\n\n\nclass TestOWROCAnalysis(EvaluateTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.lenses = data = Table(test_filename(\"datasets/lenses.tab\"))\n        totd = Orange.evaluation.TestOnTestData(\n            store_data=True,\n        )\n        cls.res = totd(\n            data=data[::2], test_data=data[1::2],\n            learners=[Orange.classification.MajorityLearner(),\n                      Orange.classification.KNNLearner()]\n        )\n        try:\n            # 'mouseRateLimit' interferes with mouse move tests\n            pg.setConfigOption(\"mouseRateLimit\", -1)\n        except KeyError:\n            pass\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(\n            OWROCAnalysis,\n            stored_settings={\n                \"display_perf_line\": True,\n                \"display_def_threshold\": True,\n                \"display_convex_hull\": True,\n                \"display_convex_curve\": True\n            }\n        )  # type: OWROCAnalysis\n\n    def tearDown(self):\n        super().tearDown()\n        self.widget.onDeleteWidget()\n        self.widgets.remove(self.widget)\n        self.widget = None\n\n    @staticmethod\n    def _set_list_selection(listview, selection):\n        model = listview.model()\n        selectionmodel = listview.selectionModel()\n        itemselection = QItemSelection()\n        for item in selection:\n            itemselection.select(model.index(item, 0), model.index(item, 0))\n        selectionmodel.select(itemselection, selectionmodel.ClearAndSelect)\n\n    def test_basic(self):\n        res = self.res\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n\n    def test_empty_input(self):\n        res = Orange.evaluation.Results(\n            data=self.lenses[:0], nmethods=2, store_data=True)\n        res.row_indices = np.array([], dtype=int)\n        res.actual = np.array([])\n        res.predicted = np.zeros((2, 0))\n        res.probabilities = np.zeros((2, 0, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n        res.row_indices = np.array([1], dtype=int)\n        res.actual = np.array([0.0])\n        res.predicted = np.zeros((2, 1))\n        res.probabilities = np.zeros((2, 1, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n    def test_nan_input(self):\n        res = copy.copy(self.res)\n        res.actual = res.actual.copy()\n        res.predicted = res.predicted.copy()\n        res.probabilities = res.probabilities.copy()\n\n        res.actual[0] = np.nan\n        res.predicted[:, 1] = np.nan\n        res.probabilities[0, 1, :] = np.nan\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.assertTrue(self.widget.Error.invalid_results.is_shown())\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n        self.assertFalse(self.widget.Error.invalid_results.is_shown())\n\n    def test_tooltips(self):\n        # See https://people.inf.elte.hu/kiss/11dwhdm/roc.pdf for the curve\n        # representing this data\n        actual = np.array([float(c == \"n\") for c in \"ppnpppnnpnpnpnnnpnpn\"])\n        p = np.array([.9, .8, .7, .6, .55, .54, .53, .52, .51, .505,\n                      .4, .39, .38, .37, .36, .35, .34, .33, .30, .1])\n        n = 1 - p\n        predicted = (p > .5).astype(float)\n\n        # The second curve is like the first except for the first three points:\n        # it goes to the right and then up\n        p2 = p.copy()\n        p2[:4] = [0.7, 0.8, 0.9, 0.59]\n        n2 = 1 - p2\n        predicted2 = (p2 < .5).astype(float)\n\n        data = Orange.data.Table(\n            Orange.data.Domain(\n                [],\n                [Orange.data.DiscreteVariable(\"y\", values=tuple(\"pn\"))]),\n            np.empty((len(p), 0), dtype=float),\n            actual\n        )\n        res = Results(\n            data=data,\n            actual=actual,\n            predicted=np.array([list(predicted), list(predicted2)]),\n            probabilities=np.array([list(zip(p, n)), list(zip(p2, n2))])\n        )\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget.target_index = 0\n        self.widget.selected_classifiers = [0, 1]\n        vb = self.widget.plot.getViewBox()\n        vb.childTransform()  # Force pyqtgraph to update transforms\n\n        curve = self.widget.plot_curves(self.widget.target_index, 0)\n        curve_merge = curve.merge()\n        view = self.widget.plotview\n        item = curve_merge.curve_item  # type: pg.PlotCurveItem\n\n        with patch.object(QToolTip, \"showText\") as show_text:\n            # no tooltips to be shown\n            pos = item.mapToScene(0.0, 1.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n            # test single point\n            pos = item.mapToScene(0, 0.1)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.900\", text)\n            self.assertNotIn(\"#2\", text)\n\n            # test overlapping points\n            pos = item.mapToScene(0.0, 0.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 1.000\\n(#2) 1.000\", text)\n\n            pos = item.mapToScene(0.1, 0.3)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test that cache is invalidated when changing averaging mode\n            self.widget.roc_averaging = OWROCAnalysis.Threshold\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test nan thresholds\n            self.widget.roc_averaging = OWROCAnalysis.Vertical\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n    def test_target_prior(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        # hard selected\n        self.assertEqual(np.round(4/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"none\")\n        self.assertEqual(np.round(3/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    def test_target_prior_reload(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_apply_no_output(self, *_):\n        \"\"\"Test no output warnings\"\"\"\n        # Similar to test_owcalibrationplot, but just a little different, hence\n        # pylint: disable=duplicate-code\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        multiple_folds, multiple_selected, no_models, non_binary_class = \"abcd\"\n        messages = {\n            multiple_folds:\n                \"each training data sample produces a different model\",\n            no_models:\n                \"test results do not contain stored models - try testing on \"\n                \"separate data or on training data\",\n            multiple_selected:\n                \"select a single model - the widget can output only one\",\n            non_binary_class:\n                \"cannot calibrate non-binary models\"}\n\n        def test_shown(shown):\n            widget_msg = widget.Information.no_output\n            output = self.get_output(widget.Outputs.calibrated_model)\n            if not shown:\n                self.assertFalse(widget_msg.is_shown())\n                self.assertIsNotNone(output)\n            else:\n                self.assertTrue(widget_msg.is_shown())\n                self.assertIsNone(output)\n                for msg_id in shown:\n                    msg = messages[msg_id]\n                    self.assertIn(msg, widget_msg.formatted,\n                                  f\"{msg} not included in the message\")\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected})\n\n        self._set_list_selection(model_list, [0])\n        test_shown(())\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNone(output)\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNotNone(output)\n\n        self._set_list_selection(model_list, [0, 1])\n\n        self.results.models = None\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, no_models})\n\n        self.send_signal(widget.Inputs.evaluation_results, self.lenses_results)\n        test_shown({multiple_selected, non_binary_class})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({non_binary_class})\n\n        self.results.folds = [slice(0, 5), slice(5, 10), slice(10, 19)]\n        self.results.models = np.array([[Mock(), Mock()]] * 3)\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, multiple_folds})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({multiple_folds})\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_calibrated_output(self, tc):\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        self._set_list_selection(model_list, [0])\n\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.47)\n\n        widget.controls.fp_cost.setValue(1000)\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.9)\n\n        self._set_list_selection(model_list, [1])\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][1])\n        self.assertAlmostEqual(threshold, 0.45)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/evaluate/tests/test_owrocanalysis.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "46fc078ed",
                "new_commit_hash": "0dfc9f993",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/evaluate/tests/test_owrocanalysis.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/evaluate/tests/test_owrocanalysis.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 278,
                            "length": 6
                        },
                        "new_range": {
                            "start": 278,
                            "length": 14
                        },
                        "section": "class TestOWROCAnalysis(EvaluateTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        simulate.combobox_activate_item(w.controls.target_index, \"soft\")",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(np.round(5/12 * 100), w.target_prior)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_target_prior_reload(self):",
                                "type": "added"
                            },
                            {
                                "content": "        w = self.widget",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.evaluation_results, self.res)",
                                "type": "added"
                            },
                            {
                                "content": "        simulate.combobox_activate_item(w.controls.target_index, \"soft\")",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(np.round(5/12 * 100), w.target_prior)",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.evaluation_results, self.res)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(np.round(5/12 * 100), w.target_prior)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")",
                                "type": "context"
                            },
                            {
                                "content": "    def test_apply_no_output(self, *_):",
                                "type": "context"
                            },
                            {
                                "content": "        \"\"\"Test no output warnings\"\"\"",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/evaluate/tests/test_owrocanalysis.py",
                            "type": "class",
                            "name": "TestOWROCAnalysis",
                            "content": "class TestOWROCAnalysis(EvaluateTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.lenses = data = Table(test_filename(\"datasets/lenses.tab\"))\n        totd = Orange.evaluation.TestOnTestData(\n            store_data=True,\n        )\n        cls.res = totd(\n            data=data[::2], test_data=data[1::2],\n            learners=[Orange.classification.MajorityLearner(),\n                      Orange.classification.KNNLearner()]\n        )\n        try:\n            # 'mouseRateLimit' interferes with mouse move tests\n            pg.setConfigOption(\"mouseRateLimit\", -1)\n        except KeyError:\n            pass\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(\n            OWROCAnalysis,\n            stored_settings={\n                \"display_perf_line\": True,\n                \"display_def_threshold\": True,\n                \"display_convex_hull\": True,\n                \"display_convex_curve\": True\n            }\n        )  # type: OWROCAnalysis\n\n    def tearDown(self):\n        super().tearDown()\n        self.widget.onDeleteWidget()\n        self.widgets.remove(self.widget)\n        self.widget = None\n\n    @staticmethod\n    def _set_list_selection(listview, selection):\n        model = listview.model()\n        selectionmodel = listview.selectionModel()\n        itemselection = QItemSelection()\n        for item in selection:\n            itemselection.select(model.index(item, 0), model.index(item, 0))\n        selectionmodel.select(itemselection, selectionmodel.ClearAndSelect)\n\n    def test_basic(self):\n        res = self.res\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n\n    def test_empty_input(self):\n        res = Orange.evaluation.Results(\n            data=self.lenses[:0], nmethods=2, store_data=True)\n        res.row_indices = np.array([], dtype=int)\n        res.actual = np.array([])\n        res.predicted = np.zeros((2, 0))\n        res.probabilities = np.zeros((2, 0, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n        res.row_indices = np.array([1], dtype=int)\n        res.actual = np.array([0.0])\n        res.predicted = np.zeros((2, 1))\n        res.probabilities = np.zeros((2, 1, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n    def test_nan_input(self):\n        res = copy.copy(self.res)\n        res.actual = res.actual.copy()\n        res.predicted = res.predicted.copy()\n        res.probabilities = res.probabilities.copy()\n\n        res.actual[0] = np.nan\n        res.predicted[:, 1] = np.nan\n        res.probabilities[0, 1, :] = np.nan\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.assertTrue(self.widget.Error.invalid_results.is_shown())\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n        self.assertFalse(self.widget.Error.invalid_results.is_shown())\n\n    def test_tooltips(self):\n        # See https://people.inf.elte.hu/kiss/11dwhdm/roc.pdf for the curve\n        # representing this data\n        actual = np.array([float(c == \"n\") for c in \"ppnpppnnpnpnpnnnpnpn\"])\n        p = np.array([.9, .8, .7, .6, .55, .54, .53, .52, .51, .505,\n                      .4, .39, .38, .37, .36, .35, .34, .33, .30, .1])\n        n = 1 - p\n        predicted = (p > .5).astype(float)\n\n        # The second curve is like the first except for the first three points:\n        # it goes to the right and then up\n        p2 = p.copy()\n        p2[:4] = [0.7, 0.8, 0.9, 0.59]\n        n2 = 1 - p2\n        predicted2 = (p2 < .5).astype(float)\n\n        data = Orange.data.Table(\n            Orange.data.Domain(\n                [],\n                [Orange.data.DiscreteVariable(\"y\", values=tuple(\"pn\"))]),\n            np.empty((len(p), 0), dtype=float),\n            actual\n        )\n        res = Results(\n            data=data,\n            actual=actual,\n            predicted=np.array([list(predicted), list(predicted2)]),\n            probabilities=np.array([list(zip(p, n)), list(zip(p2, n2))])\n        )\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget.target_index = 0\n        self.widget.selected_classifiers = [0, 1]\n        vb = self.widget.plot.getViewBox()\n        vb.childTransform()  # Force pyqtgraph to update transforms\n\n        curve = self.widget.plot_curves(self.widget.target_index, 0)\n        curve_merge = curve.merge()\n        view = self.widget.plotview\n        item = curve_merge.curve_item  # type: pg.PlotCurveItem\n\n        with patch.object(QToolTip, \"showText\") as show_text:\n            # no tooltips to be shown\n            pos = item.mapToScene(0.0, 1.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n            # test single point\n            pos = item.mapToScene(0, 0.1)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.900\", text)\n            self.assertNotIn(\"#2\", text)\n\n            # test overlapping points\n            pos = item.mapToScene(0.0, 0.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 1.000\\n(#2) 1.000\", text)\n\n            pos = item.mapToScene(0.1, 0.3)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test that cache is invalidated when changing averaging mode\n            self.widget.roc_averaging = OWROCAnalysis.Threshold\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test nan thresholds\n            self.widget.roc_averaging = OWROCAnalysis.Vertical\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n    def test_target_prior(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        # hard selected\n        self.assertEqual(np.round(4/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"none\")\n        self.assertEqual(np.round(3/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    def test_target_prior_reload(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_apply_no_output(self, *_):\n        \"\"\"Test no output warnings\"\"\"\n        # Similar to test_owcalibrationplot, but just a little different, hence\n        # pylint: disable=duplicate-code\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        multiple_folds, multiple_selected, no_models, non_binary_class = \"abcd\"\n        messages = {\n            multiple_folds:\n                \"each training data sample produces a different model\",\n            no_models:\n                \"test results do not contain stored models - try testing on \"\n                \"separate data or on training data\",\n            multiple_selected:\n                \"select a single model - the widget can output only one\",\n            non_binary_class:\n                \"cannot calibrate non-binary models\"}\n\n        def test_shown(shown):\n            widget_msg = widget.Information.no_output\n            output = self.get_output(widget.Outputs.calibrated_model)\n            if not shown:\n                self.assertFalse(widget_msg.is_shown())\n                self.assertIsNotNone(output)\n            else:\n                self.assertTrue(widget_msg.is_shown())\n                self.assertIsNone(output)\n                for msg_id in shown:\n                    msg = messages[msg_id]\n                    self.assertIn(msg, widget_msg.formatted,\n                                  f\"{msg} not included in the message\")\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected})\n\n        self._set_list_selection(model_list, [0])\n        test_shown(())\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNone(output)\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNotNone(output)\n\n        self._set_list_selection(model_list, [0, 1])\n\n        self.results.models = None\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, no_models})\n\n        self.send_signal(widget.Inputs.evaluation_results, self.lenses_results)\n        test_shown({multiple_selected, non_binary_class})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({non_binary_class})\n\n        self.results.folds = [slice(0, 5), slice(5, 10), slice(10, 19)]\n        self.results.models = np.array([[Mock(), Mock()]] * 3)\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, multiple_folds})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({multiple_folds})\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_calibrated_output(self, tc):\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        self._set_list_selection(model_list, [0])\n\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.47)\n\n        widget.controls.fp_cost.setValue(1000)\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.9)\n\n        self._set_list_selection(model_list, [1])\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][1])\n        self.assertAlmostEqual(threshold, 0.45)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 78,
                            "end_lineno": 376,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/evaluate/tests/test_owrocanalysis.py",
                            "type": "method",
                            "name": "TestOWROCAnalysis.test_target_prior_reload",
                            "content": "class TestOWROCAnalysis(EvaluateTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.lenses = data = Table(test_filename(\"datasets/lenses.tab\"))\n        totd = Orange.evaluation.TestOnTestData(\n            store_data=True,\n        )\n        cls.res = totd(\n            data=data[::2], test_data=data[1::2],\n            learners=[Orange.classification.MajorityLearner(),\n                      Orange.classification.KNNLearner()]\n        )\n        try:\n            # 'mouseRateLimit' interferes with mouse move tests\n            pg.setConfigOption(\"mouseRateLimit\", -1)\n        except KeyError:\n            pass\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(\n            OWROCAnalysis,\n            stored_settings={\n                \"display_perf_line\": True,\n                \"display_def_threshold\": True,\n                \"display_convex_hull\": True,\n                \"display_convex_curve\": True\n            }\n        )  # type: OWROCAnalysis\n\n    def tearDown(self):\n        super().tearDown()\n        self.widget.onDeleteWidget()\n        self.widgets.remove(self.widget)\n        self.widget = None\n\n    @staticmethod\n    def _set_list_selection(listview, selection):\n        model = listview.model()\n        selectionmodel = listview.selectionModel()\n        itemselection = QItemSelection()\n        for item in selection:\n            itemselection.select(model.index(item, 0), model.index(item, 0))\n        selectionmodel.select(itemselection, selectionmodel.ClearAndSelect)\n\n    def test_basic(self):\n        res = self.res\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n\n    def test_empty_input(self):\n        res = Orange.evaluation.Results(\n            data=self.lenses[:0], nmethods=2, store_data=True)\n        res.row_indices = np.array([], dtype=int)\n        res.actual = np.array([])\n        res.predicted = np.zeros((2, 0))\n        res.probabilities = np.zeros((2, 0, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n        res.row_indices = np.array([1], dtype=int)\n        res.actual = np.array([0.0])\n        res.predicted = np.zeros((2, 1))\n        res.probabilities = np.zeros((2, 1, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n    def test_nan_input(self):\n        res = copy.copy(self.res)\n        res.actual = res.actual.copy()\n        res.predicted = res.predicted.copy()\n        res.probabilities = res.probabilities.copy()\n\n        res.actual[0] = np.nan\n        res.predicted[:, 1] = np.nan\n        res.probabilities[0, 1, :] = np.nan\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.assertTrue(self.widget.Error.invalid_results.is_shown())\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n        self.assertFalse(self.widget.Error.invalid_results.is_shown())\n\n    def test_tooltips(self):\n        # See https://people.inf.elte.hu/kiss/11dwhdm/roc.pdf for the curve\n        # representing this data\n        actual = np.array([float(c == \"n\") for c in \"ppnpppnnpnpnpnnnpnpn\"])\n        p = np.array([.9, .8, .7, .6, .55, .54, .53, .52, .51, .505,\n                      .4, .39, .38, .37, .36, .35, .34, .33, .30, .1])\n        n = 1 - p\n        predicted = (p > .5).astype(float)\n\n        # The second curve is like the first except for the first three points:\n        # it goes to the right and then up\n        p2 = p.copy()\n        p2[:4] = [0.7, 0.8, 0.9, 0.59]\n        n2 = 1 - p2\n        predicted2 = (p2 < .5).astype(float)\n\n        data = Orange.data.Table(\n            Orange.data.Domain(\n                [],\n                [Orange.data.DiscreteVariable(\"y\", values=tuple(\"pn\"))]),\n            np.empty((len(p), 0), dtype=float),\n            actual\n        )\n        res = Results(\n            data=data,\n            actual=actual,\n            predicted=np.array([list(predicted), list(predicted2)]),\n            probabilities=np.array([list(zip(p, n)), list(zip(p2, n2))])\n        )\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget.target_index = 0\n        self.widget.selected_classifiers = [0, 1]\n        vb = self.widget.plot.getViewBox()\n        vb.childTransform()  # Force pyqtgraph to update transforms\n\n        curve = self.widget.plot_curves(self.widget.target_index, 0)\n        curve_merge = curve.merge()\n        view = self.widget.plotview\n        item = curve_merge.curve_item  # type: pg.PlotCurveItem\n\n        with patch.object(QToolTip, \"showText\") as show_text:\n            # no tooltips to be shown\n            pos = item.mapToScene(0.0, 1.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n            # test single point\n            pos = item.mapToScene(0, 0.1)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.900\", text)\n            self.assertNotIn(\"#2\", text)\n\n            # test overlapping points\n            pos = item.mapToScene(0.0, 0.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 1.000\\n(#2) 1.000\", text)\n\n            pos = item.mapToScene(0.1, 0.3)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test that cache is invalidated when changing averaging mode\n            self.widget.roc_averaging = OWROCAnalysis.Threshold\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test nan thresholds\n            self.widget.roc_averaging = OWROCAnalysis.Vertical\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n    def test_target_prior(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        # hard selected\n        self.assertEqual(np.round(4/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"none\")\n        self.assertEqual(np.round(3/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    def test_target_prior_reload(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_apply_no_output(self, *_):\n        \"\"\"Test no output warnings\"\"\"\n        # Similar to test_owcalibrationplot, but just a little different, hence\n        # pylint: disable=duplicate-code\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        multiple_folds, multiple_selected, no_models, non_binary_class = \"abcd\"\n        messages = {\n            multiple_folds:\n                \"each training data sample produces a different model\",\n            no_models:\n                \"test results do not contain stored models - try testing on \"\n                \"separate data or on training data\",\n            multiple_selected:\n                \"select a single model - the widget can output only one\",\n            non_binary_class:\n                \"cannot calibrate non-binary models\"}\n\n        def test_shown(shown):\n            widget_msg = widget.Information.no_output\n            output = self.get_output(widget.Outputs.calibrated_model)\n            if not shown:\n                self.assertFalse(widget_msg.is_shown())\n                self.assertIsNotNone(output)\n            else:\n                self.assertTrue(widget_msg.is_shown())\n                self.assertIsNone(output)\n                for msg_id in shown:\n                    msg = messages[msg_id]\n                    self.assertIn(msg, widget_msg.formatted,\n                                  f\"{msg} not included in the message\")\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected})\n\n        self._set_list_selection(model_list, [0])\n        test_shown(())\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNone(output)\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNotNone(output)\n\n        self._set_list_selection(model_list, [0, 1])\n\n        self.results.models = None\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, no_models})\n\n        self.send_signal(widget.Inputs.evaluation_results, self.lenses_results)\n        test_shown({multiple_selected, non_binary_class})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({non_binary_class})\n\n        self.results.folds = [slice(0, 5), slice(5, 10), slice(10, 19)]\n        self.results.models = np.array([[Mock(), Mock()]] * 3)\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, multiple_folds})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({multiple_folds})\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_calibrated_output(self, tc):\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        self._set_list_selection(model_list, [0])\n\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.47)\n\n        widget.controls.fp_cost.setValue(1000)\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.9)\n\n        self._set_list_selection(model_list, [1])\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][1])\n        self.assertAlmostEqual(threshold, 0.45)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 281,
                            "end_lineno": 287,
                            "parent": {
                                "file_name": "Orange/widgets/evaluate/tests/test_owrocanalysis.py",
                                "type": "class",
                                "name": "TestOWROCAnalysis",
                                "content": "class TestOWROCAnalysis(EvaluateTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.lenses = data = Table(test_filename(\"datasets/lenses.tab\"))\n        totd = Orange.evaluation.TestOnTestData(\n            store_data=True,\n        )\n        cls.res = totd(\n            data=data[::2], test_data=data[1::2],\n            learners=[Orange.classification.MajorityLearner(),\n                      Orange.classification.KNNLearner()]\n        )\n        try:\n            # 'mouseRateLimit' interferes with mouse move tests\n            pg.setConfigOption(\"mouseRateLimit\", -1)\n        except KeyError:\n            pass\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(\n            OWROCAnalysis,\n            stored_settings={\n                \"display_perf_line\": True,\n                \"display_def_threshold\": True,\n                \"display_convex_hull\": True,\n                \"display_convex_curve\": True\n            }\n        )  # type: OWROCAnalysis\n\n    def tearDown(self):\n        super().tearDown()\n        self.widget.onDeleteWidget()\n        self.widgets.remove(self.widget)\n        self.widget = None\n\n    @staticmethod\n    def _set_list_selection(listview, selection):\n        model = listview.model()\n        selectionmodel = listview.selectionModel()\n        itemselection = QItemSelection()\n        for item in selection:\n            itemselection.select(model.index(item, 0), model.index(item, 0))\n        selectionmodel.select(itemselection, selectionmodel.ClearAndSelect)\n\n    def test_basic(self):\n        res = self.res\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n\n    def test_empty_input(self):\n        res = Orange.evaluation.Results(\n            data=self.lenses[:0], nmethods=2, store_data=True)\n        res.row_indices = np.array([], dtype=int)\n        res.actual = np.array([])\n        res.predicted = np.zeros((2, 0))\n        res.probabilities = np.zeros((2, 0, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n        res.row_indices = np.array([1], dtype=int)\n        res.actual = np.array([0.0])\n        res.predicted = np.zeros((2, 1))\n        res.probabilities = np.zeros((2, 1, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n    def test_nan_input(self):\n        res = copy.copy(self.res)\n        res.actual = res.actual.copy()\n        res.predicted = res.predicted.copy()\n        res.probabilities = res.probabilities.copy()\n\n        res.actual[0] = np.nan\n        res.predicted[:, 1] = np.nan\n        res.probabilities[0, 1, :] = np.nan\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.assertTrue(self.widget.Error.invalid_results.is_shown())\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n        self.assertFalse(self.widget.Error.invalid_results.is_shown())\n\n    def test_tooltips(self):\n        # See https://people.inf.elte.hu/kiss/11dwhdm/roc.pdf for the curve\n        # representing this data\n        actual = np.array([float(c == \"n\") for c in \"ppnpppnnpnpnpnnnpnpn\"])\n        p = np.array([.9, .8, .7, .6, .55, .54, .53, .52, .51, .505,\n                      .4, .39, .38, .37, .36, .35, .34, .33, .30, .1])\n        n = 1 - p\n        predicted = (p > .5).astype(float)\n\n        # The second curve is like the first except for the first three points:\n        # it goes to the right and then up\n        p2 = p.copy()\n        p2[:4] = [0.7, 0.8, 0.9, 0.59]\n        n2 = 1 - p2\n        predicted2 = (p2 < .5).astype(float)\n\n        data = Orange.data.Table(\n            Orange.data.Domain(\n                [],\n                [Orange.data.DiscreteVariable(\"y\", values=tuple(\"pn\"))]),\n            np.empty((len(p), 0), dtype=float),\n            actual\n        )\n        res = Results(\n            data=data,\n            actual=actual,\n            predicted=np.array([list(predicted), list(predicted2)]),\n            probabilities=np.array([list(zip(p, n)), list(zip(p2, n2))])\n        )\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget.target_index = 0\n        self.widget.selected_classifiers = [0, 1]\n        vb = self.widget.plot.getViewBox()\n        vb.childTransform()  # Force pyqtgraph to update transforms\n\n        curve = self.widget.plot_curves(self.widget.target_index, 0)\n        curve_merge = curve.merge()\n        view = self.widget.plotview\n        item = curve_merge.curve_item  # type: pg.PlotCurveItem\n\n        with patch.object(QToolTip, \"showText\") as show_text:\n            # no tooltips to be shown\n            pos = item.mapToScene(0.0, 1.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n            # test single point\n            pos = item.mapToScene(0, 0.1)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.900\", text)\n            self.assertNotIn(\"#2\", text)\n\n            # test overlapping points\n            pos = item.mapToScene(0.0, 0.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 1.000\\n(#2) 1.000\", text)\n\n            pos = item.mapToScene(0.1, 0.3)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test that cache is invalidated when changing averaging mode\n            self.widget.roc_averaging = OWROCAnalysis.Threshold\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test nan thresholds\n            self.widget.roc_averaging = OWROCAnalysis.Vertical\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n    def test_target_prior(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        # hard selected\n        self.assertEqual(np.round(4/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"none\")\n        self.assertEqual(np.round(3/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    def test_target_prior_reload(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_apply_no_output(self, *_):\n        \"\"\"Test no output warnings\"\"\"\n        # Similar to test_owcalibrationplot, but just a little different, hence\n        # pylint: disable=duplicate-code\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        multiple_folds, multiple_selected, no_models, non_binary_class = \"abcd\"\n        messages = {\n            multiple_folds:\n                \"each training data sample produces a different model\",\n            no_models:\n                \"test results do not contain stored models - try testing on \"\n                \"separate data or on training data\",\n            multiple_selected:\n                \"select a single model - the widget can output only one\",\n            non_binary_class:\n                \"cannot calibrate non-binary models\"}\n\n        def test_shown(shown):\n            widget_msg = widget.Information.no_output\n            output = self.get_output(widget.Outputs.calibrated_model)\n            if not shown:\n                self.assertFalse(widget_msg.is_shown())\n                self.assertIsNotNone(output)\n            else:\n                self.assertTrue(widget_msg.is_shown())\n                self.assertIsNone(output)\n                for msg_id in shown:\n                    msg = messages[msg_id]\n                    self.assertIn(msg, widget_msg.formatted,\n                                  f\"{msg} not included in the message\")\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected})\n\n        self._set_list_selection(model_list, [0])\n        test_shown(())\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNone(output)\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNotNone(output)\n\n        self._set_list_selection(model_list, [0, 1])\n\n        self.results.models = None\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, no_models})\n\n        self.send_signal(widget.Inputs.evaluation_results, self.lenses_results)\n        test_shown({multiple_selected, non_binary_class})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({non_binary_class})\n\n        self.results.folds = [slice(0, 5), slice(5, 10), slice(10, 19)]\n        self.results.models = np.array([[Mock(), Mock()]] * 3)\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, multiple_folds})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({multiple_folds})\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_calibrated_output(self, tc):\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        self._set_list_selection(model_list, [0])\n\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.47)\n\n        widget.controls.fp_cost.setValue(1000)\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.9)\n\n        self._set_list_selection(model_list, [1])\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][1])\n        self.assertAlmostEqual(threshold, 0.45)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 78,
                                "end_lineno": 376,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d^",
    "new_commit_hash": "a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d",
    "commit_message": "Fix setting prior probability in ROC",
    "commit_date": "2024-03-27T20:05:04+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d",
    "test_file_codes": [
        "# pylint: disable=protected-access\nimport copy\nimport unittest\nfrom unittest.mock import patch, Mock\n\nimport numpy as np\nimport pyqtgraph as pg\nfrom AnyQt.QtWidgets import QToolTip\nfrom AnyQt.QtCore import QItemSelection\n\nfrom Orange.data import Table\nimport Orange.evaluation\nimport Orange.classification\nfrom Orange.evaluation import Results\n\nfrom Orange.widgets.evaluate import owrocanalysis\nfrom Orange.widgets.evaluate.owrocanalysis import OWROCAnalysis\nfrom Orange.widgets.evaluate.tests.base import EvaluateTest\nfrom Orange.widgets.tests.utils import mouseMove, simulate\nfrom Orange.tests import test_filename\n\n\nclass TestROC(unittest.TestCase):\n    def test_ROCData_from_results(self):\n        data = Orange.data.Table(\"iris\")\n        learners = [\n            Orange.classification.MajorityLearner(),\n            Orange.classification.LogisticRegressionLearner(),\n            Orange.classification.TreeLearner()\n        ]\n        cv = Orange.evaluation.CrossValidation(k=10)\n        res = cv(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 10)\n                self.assertTrue(all(c.is_valid for c in rocdata.folds))\n                self.assertTrue(rocdata.avg_vertical.is_valid)\n                self.assertTrue(rocdata.avg_threshold.is_valid)\n\n        # fixed random seed because otherwise it could happen that data sample\n        # contained only instances of two classes (and the test then fails)\n        # Pylint complains about RandomState; pylint: disable=no-member\n        data = data[np.random.RandomState(0).choice(len(data), size=20)]\n        loo = Orange.evaluation.LeaveOneOut()\n        res = loo(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 20)\n                # all individual fold curves and averaged curve data\n                # should be invalid\n                self.assertTrue(all(not c.is_valid for c in rocdata.folds))\n                self.assertFalse(rocdata.avg_vertical.is_valid)\n                self.assertFalse(rocdata.avg_threshold.is_valid)\n\n        # equivalent test to the LeaveOneOut but from a slightly different\n        # constructed Orange.evaluation.Results\n        cv = Orange.evaluation.CrossValidation(k=20)\n        res = cv(data, learners)\n\n        for i, _ in enumerate(learners):\n            for c in range(len(data.domain.class_var.values)):\n                rocdata = owrocanalysis.roc_data_from_results(res, i, target=c)\n                self.assertTrue(rocdata.merged.is_valid)\n                self.assertEqual(len(rocdata.folds), 20)\n                # all individual fold curves and averaged curve data\n                # should be invalid\n                self.assertTrue(all(not c.is_valid for c in rocdata.folds))\n                self.assertFalse(rocdata.avg_vertical.is_valid)\n                self.assertFalse(rocdata.avg_threshold.is_valid)\n\n\nclass TestOWROCAnalysis(EvaluateTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.lenses = data = Table(test_filename(\"datasets/lenses.tab\"))\n        totd = Orange.evaluation.TestOnTestData(\n            store_data=True,\n        )\n        cls.res = totd(\n            data=data[::2], test_data=data[1::2],\n            learners=[Orange.classification.MajorityLearner(),\n                      Orange.classification.KNNLearner()]\n        )\n        try:\n            # 'mouseRateLimit' interferes with mouse move tests\n            pg.setConfigOption(\"mouseRateLimit\", -1)\n        except KeyError:\n            pass\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(\n            OWROCAnalysis,\n            stored_settings={\n                \"display_perf_line\": True,\n                \"display_def_threshold\": True,\n                \"display_convex_hull\": True,\n                \"display_convex_curve\": True\n            }\n        )  # type: OWROCAnalysis\n\n    def tearDown(self):\n        super().tearDown()\n        self.widget.onDeleteWidget()\n        self.widgets.remove(self.widget)\n        self.widget = None\n\n    @staticmethod\n    def _set_list_selection(listview, selection):\n        model = listview.model()\n        selectionmodel = listview.selectionModel()\n        itemselection = QItemSelection()\n        for item in selection:\n            itemselection.select(model.index(item, 0), model.index(item, 0))\n        selectionmodel.select(itemselection, selectionmodel.ClearAndSelect)\n\n    def test_basic(self):\n        res = self.res\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n\n    def test_empty_input(self):\n        res = Orange.evaluation.Results(\n            data=self.lenses[:0], nmethods=2, store_data=True)\n        res.row_indices = np.array([], dtype=int)\n        res.actual = np.array([])\n        res.predicted = np.zeros((2, 0))\n        res.probabilities = np.zeros((2, 0, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n        res.row_indices = np.array([1], dtype=int)\n        res.actual = np.array([0.0])\n        res.predicted = np.zeros((2, 1))\n        res.probabilities = np.zeros((2, 1, 3))\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Vertical\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.Threshold\n        self.widget._replot()\n        self.widget.roc_averaging = OWROCAnalysis.NoAveraging\n        self.widget._replot()\n\n    def test_nan_input(self):\n        res = copy.copy(self.res)\n        res.actual = res.actual.copy()\n        res.predicted = res.predicted.copy()\n        res.probabilities = res.probabilities.copy()\n\n        res.actual[0] = np.nan\n        res.predicted[:, 1] = np.nan\n        res.probabilities[0, 1, :] = np.nan\n\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.assertTrue(self.widget.Error.invalid_results.is_shown())\n        self.send_signal(self.widget.Inputs.evaluation_results, None)\n        self.assertFalse(self.widget.Error.invalid_results.is_shown())\n\n    def test_tooltips(self):\n        # See https://people.inf.elte.hu/kiss/11dwhdm/roc.pdf for the curve\n        # representing this data\n        actual = np.array([float(c == \"n\") for c in \"ppnpppnnpnpnpnnnpnpn\"])\n        p = np.array([.9, .8, .7, .6, .55, .54, .53, .52, .51, .505,\n                      .4, .39, .38, .37, .36, .35, .34, .33, .30, .1])\n        n = 1 - p\n        predicted = (p > .5).astype(float)\n\n        # The second curve is like the first except for the first three points:\n        # it goes to the right and then up\n        p2 = p.copy()\n        p2[:4] = [0.7, 0.8, 0.9, 0.59]\n        n2 = 1 - p2\n        predicted2 = (p2 < .5).astype(float)\n\n        data = Orange.data.Table(\n            Orange.data.Domain(\n                [],\n                [Orange.data.DiscreteVariable(\"y\", values=tuple(\"pn\"))]),\n            np.empty((len(p), 0), dtype=float),\n            actual\n        )\n        res = Results(\n            data=data,\n            actual=actual,\n            predicted=np.array([list(predicted), list(predicted2)]),\n            probabilities=np.array([list(zip(p, n)), list(zip(p2, n2))])\n        )\n        self.send_signal(self.widget.Inputs.evaluation_results, res)\n        self.widget.roc_averaging = OWROCAnalysis.Merge\n        self.widget.target_index = 0\n        self.widget.selected_classifiers = [0, 1]\n        vb = self.widget.plot.getViewBox()\n        vb.childTransform()  # Force pyqtgraph to update transforms\n\n        curve = self.widget.plot_curves(self.widget.target_index, 0)\n        curve_merge = curve.merge()\n        view = self.widget.plotview\n        item = curve_merge.curve_item  # type: pg.PlotCurveItem\n\n        with patch.object(QToolTip, \"showText\") as show_text:\n            # no tooltips to be shown\n            pos = item.mapToScene(0.0, 1.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n            # test single point\n            pos = item.mapToScene(0, 0.1)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.900\", text)\n            self.assertNotIn(\"#2\", text)\n\n            # test overlapping points\n            pos = item.mapToScene(0.0, 0.0)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 1.000\\n(#2) 1.000\", text)\n\n            pos = item.mapToScene(0.1, 0.3)\n            pos = view.mapFromScene(pos)\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test that cache is invalidated when changing averaging mode\n            self.widget.roc_averaging = OWROCAnalysis.Threshold\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            (_, text), _ = show_text.call_args\n            self.assertIn(\"(#1) 0.600\\n(#2) 0.590\", text)\n            show_text.reset_mock()\n\n            # test nan thresholds\n            self.widget.roc_averaging = OWROCAnalysis.Vertical\n            self.widget._replot()\n            mouseMove(view.viewport(), pos)\n            show_text.assert_not_called()\n\n    def test_target_prior(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        # hard selected\n        self.assertEqual(np.round(4/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"none\")\n        self.assertEqual(np.round(3/12 * 100), w.target_prior)\n\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    def test_target_prior_reload(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_apply_no_output(self, *_):\n        \"\"\"Test no output warnings\"\"\"\n        # Similar to test_owcalibrationplot, but just a little different, hence\n        # pylint: disable=duplicate-code\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        multiple_folds, multiple_selected, no_models, non_binary_class = \"abcd\"\n        messages = {\n            multiple_folds:\n                \"each training data sample produces a different model\",\n            no_models:\n                \"test results do not contain stored models - try testing on \"\n                \"separate data or on training data\",\n            multiple_selected:\n                \"select a single model - the widget can output only one\",\n            non_binary_class:\n                \"cannot calibrate non-binary models\"}\n\n        def test_shown(shown):\n            widget_msg = widget.Information.no_output\n            output = self.get_output(widget.Outputs.calibrated_model)\n            if not shown:\n                self.assertFalse(widget_msg.is_shown())\n                self.assertIsNotNone(output)\n            else:\n                self.assertTrue(widget_msg.is_shown())\n                self.assertIsNone(output)\n                for msg_id in shown:\n                    msg = messages[msg_id]\n                    self.assertIn(msg, widget_msg.formatted,\n                                  f\"{msg} not included in the message\")\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected})\n\n        self._set_list_selection(model_list, [0])\n        test_shown(())\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNone(output)\n        widget.controls.display_perf_line.click()\n        output = self.get_output(widget.Outputs.calibrated_model)\n        self.assertIsNotNone(output)\n\n        self._set_list_selection(model_list, [0, 1])\n\n        self.results.models = None\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, no_models})\n\n        self.send_signal(widget.Inputs.evaluation_results, self.lenses_results)\n        test_shown({multiple_selected, non_binary_class})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({non_binary_class})\n\n        self.results.folds = [slice(0, 5), slice(5, 10), slice(10, 19)]\n        self.results.models = np.array([[Mock(), Mock()]] * 3)\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        test_shown({multiple_selected, multiple_folds})\n\n        self._set_list_selection(model_list, [0])\n        test_shown({multiple_folds})\n\n    @patch(\"Orange.widgets.evaluate.owrocanalysis.ThresholdClassifier\")\n    def test_calibrated_output(self, tc):\n        widget = self.widget\n        model_list = widget.controls.selected_classifiers\n\n        self.send_signal(widget.Inputs.evaluation_results, self.results)\n        self._set_list_selection(model_list, [0])\n\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.47)\n\n        widget.controls.fp_cost.setValue(1000)\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][0])\n        self.assertAlmostEqual(threshold, 0.9)\n\n        self._set_list_selection(model_list, [1])\n        model, threshold = tc.call_args[0]\n        self.assertIs(model, self.results.models[0][1])\n        self.assertAlmostEqual(threshold, 0.45)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+a592ddf to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d\nProcessing dependencies for Orange3==3.37.0.dev0+a592ddf\nSearching for xlsxwriter\nReading https://pypi.org/simple/xlsxwriter/\nDownloading https://files.pythonhosted.org/packages/a7/ea/53d1fe468e63e092cf16e2c18d16f50c29851242f9dd12d6a66e0d7f0d02/XlsxWriter-3.2.0-py3-none-any.whl#sha256=ecfd5405b3e0e228219bcaf24c2ca0915e012ca9464a14048021d21a995d490e\nBest match: XlsxWriter 3.2.0\nProcessing XlsxWriter-3.2.0-py3-none-any.whl\nInstalling XlsxWriter-3.2.0-py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages\nAdding XlsxWriter 3.2.0 to easy-install.pth file\nInstalling vba_extract.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/XlsxWriter-3.2.0-py3.7.egg\nSearching for xlrd>=1.2.0\nReading https://pypi.org/simple/xlrd/\nDownloading https://files.pythonhosted.org/packages/a6/0c/c2a72d51fe56e08a08acc85d13013558a2d793028ae7385448a6ccdfae64/xlrd-2.0.1-py2.py3-none-any.whl#sha256=6a33ee89877bd9abc1158129f6e94be74e2679636b8a205b43b85206c3f0bbdd\nBest match: xlrd 2.0.1\nProcessing xlrd-2.0.1-py2.py3-none-any.whl\nInstalling xlrd-2.0.1-py2.py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages\nAdding xlrd 2.0.1 to easy-install.pth file\nInstalling runxlrd.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/xlrd-2.0.1-py3.7.egg\nSearching for xgboost>=1.7.4\nReading https://pypi.org/simple/xgboost/\nDownloading https://files.pythonhosted.org/packages/48/bc/05d7db90d421c5e3d681a12fd1eb087e37bf2e9bbe2b105422d6319ecc92/xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl#sha256=32a43526208fe676527c698cb852e0e9515e6d7294143780e476d335290a131b\nBest match: xgboost 2.1.3\nProcessing xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl\nInstalling xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages\nAdding xgboost 2.1.3 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/xgboost-2.1.3-py3.7-linux-x86_64.egg\nSearching for serverfiles\nReading https://pypi.org/simple/serverfiles/\nDownloading https://files.pythonhosted.org/packages/33/36/794fe1c4ed29b0f56a26d72e956baf0285d8fe9e29faf36797a28a8ad45b/serverfiles-0.3.1.tar.gz#sha256=5e10fc32e758791e3735bc08bce2ed4702a83b1e45ab96c5d59cc8aeecfbebe1\nBest match: serverfiles 0.3.1\nProcessing serverfiles-0.3.1.tar.gz\nWriting /tmp/easy_install-r0tyx22i/serverfiles-0.3.1/setup.cfg\nRunning serverfiles-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-r0tyx22i/serverfiles-0.3.1/egg-dist-tmp-pdek4nxe\ncreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nExtracting serverfiles-0.3.1-py3.7.egg to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nSearching for scipy>=1.9\nReading https://pypi.org/simple/scipy/\nDownloading https://files.pythonhosted.org/packages/d9/7b/2b8ac283cf32465ed08bc20a83d559fe7b174a484781702ba8accea001d6/scipy-1.15.0.tar.gz#sha256=300742e2cc94e36a2880ebe464a1c8b4352a7b0f3e36ec3d2ac006cdbe0219ac\nBest match: scipy 1.15.0\nProcessing scipy-1.15.0.tar.gz\nVerifying Orange installation...\n❌ Orange verification failed\nPython 3.7 installation failed, trying Python 3.8...\nAttempting installation with Python 3.8...\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_contingency.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/data\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_io.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_io.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_variable.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/distance/_distance.c -o build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/projection/_som.c -o build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+a592ddf to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d\nProcessing dependencies for Orange3==3.37.0.dev0+a592ddf\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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for xgboost==2.1.3\nBest match: xgboost 2.1.3\nAdding xgboost 2.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for scipy==1.10.1\nBest match: scipy 1.10.1\nAdding scipy 1.10.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for scikit-learn==1.3.2\nBest match: scikit-learn 1.3.2\nAdding scikit-learn 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for requests==2.32.3\nBest match: requests 2.32.3\nAdding requests 2.32.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for qtconsole==5.6.1\nBest match: qtconsole 5.6.1\nAdding qtconsole 5.6.1 to easy-install.pth file\nInstalling jupyter-qtconsole script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for PyYAML==6.0.2\nBest match: PyYAML 6.0.2\nAdding PyYAML 6.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pyqtgraph==0.13.3\nBest match: pyqtgraph 0.13.3\nAdding pyqtgraph 0.13.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pygments==2.19.1\nBest match: pygments 2.19.1\nAdding pygments 2.19.1 to easy-install.pth file\nInstalling pygmentize script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pip==24.3.1\nBest match: pip 24.3.1\nAdding pip 24.3.1 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pandas==2.0.3\nBest match: pandas 2.0.3\nAdding pandas 2.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for packaging==24.2\nBest match: packaging 24.2\nAdding packaging 24.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for orange-widget-base==4.24.0\nBest match: orange-widget-base 4.24.0\nAdding orange-widget-base 4.24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for orange-canvas-core==0.2.2\nBest match: orange-canvas-core 0.2.2\nAdding orange-canvas-core 0.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for openpyxl==3.1.5\nBest match: openpyxl 3.1.5\nAdding openpyxl 3.1.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for numpy==1.24.4\nBest match: numpy 1.24.4\nAdding numpy 1.24.4 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling f2py3.8 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for networkx==3.1\nBest match: networkx 3.1\nAdding networkx 3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for matplotlib==3.7.5\nBest match: matplotlib 3.7.5\nAdding matplotlib 3.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for keyrings.alt==5.0.2\nBest match: keyrings.alt 5.0.2\nAdding keyrings.alt 5.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for keyring==25.5.0\nBest match: keyring 25.5.0\nAdding keyring 25.5.0 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for joblib==1.4.2\nBest match: joblib 1.4.2\nAdding joblib 1.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for httpx==0.28.1\nBest match: httpx 0.28.1\nAdding httpx 0.28.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for catboost==1.2.7\nBest match: catboost 1.2.7\nAdding catboost 1.2.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for nvidia-nccl-cu12==2.24.3\nBest match: nvidia-nccl-cu12 2.24.3\nAdding nvidia-nccl-cu12 2.24.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for threadpoolctl==3.5.0\nBest match: threadpoolctl 3.5.0\nAdding threadpoolctl 3.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for urllib3==2.2.3\nBest match: urllib3 2.2.3\nAdding urllib3 2.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for QtPy==2.4.2\nBest match: QtPy 2.4.2\nAdding QtPy 2.4.2 to easy-install.pth file\nInstalling qtpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for ipykernel==6.29.5\nBest match: ipykernel 6.29.5\nAdding ipykernel 6.29.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for jupyter-client==8.6.3\nBest match: jupyter-client 8.6.3\nAdding jupyter-client 8.6.3 to easy-install.pth file\nInstalling jupyter-kernel script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for jupyter-core==5.7.2\nBest match: jupyter-core 5.7.2\nAdding jupyter-core 5.7.2 to easy-install.pth file\nInstalling jupyter script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for traitlets==5.14.3\nBest match: traitlets 5.14.3\nAdding traitlets 5.14.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for tzdata==2024.2\nBest match: tzdata 2024.2\nAdding tzdata 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for importlib-resources==6.4.5\nBest match: importlib-resources 6.4.5\nAdding importlib-resources 6.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for typing-extensions==4.12.2\nBest match: typing-extensions 4.12.2\nAdding typing-extensions 4.12.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for importlib-metadata==8.5.0\nBest match: importlib-metadata 8.5.0\nAdding importlib-metadata 8.5.0 to easy-install.pth file\ndetected new path './setuptools/_vendor'\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for qasync==0.27.1\nBest match: qasync 0.27.1\nAdding qasync 0.27.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for requests-cache==1.2.1\nBest match: requests-cache 1.2.1\nAdding requests-cache 1.2.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for et-xmlfile==2.0.0\nBest match: et-xmlfile 2.0.0\nAdding et-xmlfile 2.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pillow==10.4.0\nBest match: pillow 10.4.0\nAdding pillow 10.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for kiwisolver==1.4.7\nBest match: kiwisolver 1.4.7\nAdding kiwisolver 1.4.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for fonttools==4.55.3\nBest match: fonttools 4.55.3\nAdding fonttools 4.55.3 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for cycler==0.12.1\nBest match: cycler 0.12.1\nAdding cycler 0.12.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for contourpy==1.1.1\nBest match: contourpy 1.1.1\nAdding contourpy 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for jaraco.context==6.0.1\nBest match: jaraco.context 6.0.1\nAdding jaraco.context 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for jaraco.classes==3.4.0\nBest match: jaraco.classes 3.4.0\nAdding jaraco.classes 3.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for jaraco.functools==4.1.0\nBest match: jaraco.functools 4.1.0\nAdding jaraco.functools 4.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for httpcore==1.0.7\nBest match: httpcore 1.0.7\nAdding httpcore 1.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for anyio==4.5.2\nBest match: anyio 4.5.2\nAdding anyio 4.5.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for plotly==5.24.1\nBest match: plotly 5.24.1\nAdding plotly 5.24.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for graphviz==0.20.3\nBest match: graphviz 0.20.3\nAdding graphviz 0.20.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for tornado==6.4.2\nBest match: tornado 6.4.2\nAdding tornado 6.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pyzmq==26.2.0\nBest match: pyzmq 26.2.0\nAdding pyzmq 26.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for psutil==6.1.1\nBest match: psutil 6.1.1\nAdding psutil 6.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for nest-asyncio==1.6.0\nBest match: nest-asyncio 1.6.0\nAdding nest-asyncio 1.6.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for matplotlib-inline==0.1.7\nBest match: matplotlib-inline 0.1.7\nAdding matplotlib-inline 0.1.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for ipython==8.12.3\nBest match: ipython 8.12.3\nAdding ipython 8.12.3 to easy-install.pth file\nInstalling ipython script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for debugpy==1.8.11\nBest match: debugpy 1.8.11\nAdding debugpy 1.8.11 to easy-install.pth file\nInstalling debugpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for comm==0.2.2\nBest match: comm 0.2.2\nAdding comm 0.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for platformdirs==4.3.6\nBest match: platformdirs 4.3.6\nAdding platformdirs 4.3.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for zipp==3.20.2\nBest match: zipp 3.20.2\nAdding zipp 3.20.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for cattrs==24.1.2\nBest match: cattrs 24.1.2\nAdding cattrs 24.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for attrs==24.3.0\nBest match: attrs 24.3.0\nAdding attrs 24.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for backports.tarfile==1.2.0\nBest match: backports.tarfile 1.2.0\nbackports.tarfile 1.2.0 is already the active version in easy-install.pth\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for more-itertools==10.5.0\nBest match: more-itertools 10.5.0\nAdding more-itertools 10.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for tenacity==9.0.0\nBest match: tenacity 9.0.0\nAdding tenacity 9.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pexpect==4.9.0\nBest match: pexpect 4.9.0\nAdding pexpect 4.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for stack-data==0.6.3\nBest match: stack-data 0.6.3\nAdding stack-data 0.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for prompt-toolkit==3.0.48\nBest match: prompt-toolkit 3.0.48\nAdding prompt-toolkit 3.0.48 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pickleshare==0.7.5\nBest match: pickleshare 0.7.5\nAdding pickleshare 0.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for jedi==0.19.2\nBest match: jedi 0.19.2\nAdding jedi 0.19.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for decorator==5.1.1\nBest match: decorator 5.1.1\nAdding decorator 5.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for backcall==0.2.0\nBest match: backcall 0.2.0\nAdding backcall 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for cffi==1.17.1\nBest match: cffi 1.17.1\nAdding cffi 1.17.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for ptyprocess==0.7.0\nBest match: ptyprocess 0.7.0\nAdding ptyprocess 0.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pure-eval==0.2.3\nBest match: pure-eval 0.2.3\nAdding pure-eval 0.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for asttokens==3.0.0\nBest match: asttokens 3.0.0\nAdding asttokens 3.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for executing==2.1.0\nBest match: executing 2.1.0\nAdding executing 2.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for wcwidth==0.2.13\nBest match: wcwidth 0.2.13\nAdding wcwidth 0.2.13 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for parso==0.8.4\nBest match: parso 0.8.4\nAdding parso 0.8.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nSearching for pycparser==2.22\nBest match: pycparser 2.22\nAdding pycparser 2.22 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages\nFinished processing dependencies for Orange3==3.37.0.dev0+a592ddf\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.8\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 190ms\nPrepared 18 packages in 1ms\nInstalled 18 packages in 189ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and all of:\n          pandas>=1.4.0,<=1.4.4\n          pandas>=1.5.1,<=1.5.3\n          pandas>=2.0.1,<=2.0.3\n      depend on Python>=3.8, we can conclude that all of:\n          pandas>=1.4.0,<=1.4.4\n          pandas>=1.5.1,<=1.5.3\n          pandas>=2.0.1,<=2.0.3\n       cannot be used.\n      And because only the following versions of pandas are available:\n          pandas<=1.4.0\n          pandas==1.4.1\n          pandas==1.4.2\n          pandas==1.4.3\n          pandas==1.4.4\n          pandas==1.5.0\n          pandas==1.5.1\n          pandas==1.5.2\n          pandas==1.5.3\n          pandas==2.0.0\n          pandas==2.0.1\n          pandas==2.0.2\n          pandas==2.0.3\n          pandas==2.1.0\n          pandas==2.1.1\n          pandas==2.1.2\n          pandas==2.1.3\n          pandas==2.1.4\n          pandas==2.2.0\n          pandas==2.2.1\n          pandas==2.2.2\n          pandas==2.2.3\n      we can conclude that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0,<2.1.0\n       cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pandas>=2.1.0 depends on Python>=3.9, we can\n      conclude that pandas>=2.1.0 cannot be used.\n      And because we know from (1) that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0,<2.1.0\n       cannot be used, we can conclude that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0\n       cannot be used.\n      And because you require one of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0\n      we can conclude that your requirements are unsatisfiable.\n\n      hint: Pre-releases are available for `pandas` in the requested range (e.g., 2.2.0rc0), but pre-releases weren't enabled\n      (try: `--prerelease=allow`)\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and pyqtgraph>=0.13.1,<=0.13.3 depends on\n      Python>=3.8, we can conclude that pyqtgraph>=0.13.1,<=0.13.3 cannot be used.\n      And because only the following versions of pyqtgraph are available:\n          pyqtgraph<=0.13.1\n          pyqtgraph==0.13.2\n          pyqtgraph==0.13.3\n          pyqtgraph==0.13.4\n          pyqtgraph==0.13.5\n          pyqtgraph==0.13.6\n          pyqtgraph==0.13.7\n      we can conclude that pyqtgraph>=0.13.1,<0.13.4 cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pyqtgraph>=0.13.4 depends on Python>=3.9, we\n      can conclude that pyqtgraph>=0.13.4 cannot be used.\n      And because we know from (1) that pyqtgraph>=0.13.1,<0.13.4 cannot be used, we can conclude that pyqtgraph>=0.13.1 cannot\n      be used.\n      And because you require pyqtgraph>=0.13.1, we can conclude that your requirements are unsatisfiable.\nResolved 2 packages in 3ms\nInstalled 2 packages in 29ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 5 packages in 28ms\nInstalled 4 packages in 389ms\n + joblib==1.3.2\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + threadpoolctl==3.1.0\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.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_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\nerror: Couldn't find a setup script in /tmp/easy_install-uop257jl/scipy-1.15.0.tar.gz\nUsing CPython 3.8.20\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 15 packages in 125ms\nPrepared 15 packages in 1ms\nInstalled 15 packages in 76ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + iniconfig==2.0.0\n + numpy==1.24.4\n + packaging==24.2\n + pluggy==1.5.0\n + pyqt5==5.15.11\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.15.0\n + pyqtwebengine==5.15.7\n + pyqtwebengine-qt5==5.15.16\n + pytest==8.3.4\n + setuptools==75.3.0\n + tomli==2.2.1\n + wheel==0.45.1\nResolved 64 packages in 100ms\nInstalled 61 packages in 557ms\n + anyio==4.5.2\n + backports-tarfile==1.2.0\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + catboost==1.2.7\n + certifi==2024.12.14\n + cffi==1.17.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + contourpy==1.1.1\n + cryptography==44.0.0\n + cycler==0.12.1\n + et-xmlfile==2.0.0\n + fonttools==4.55.3\n + graphviz==0.20.3\n + h11==0.14.0\n + httpcore==1.0.7\n + httpx==0.28.1\n + idna==3.10\n + importlib-metadata==8.5.0\n + importlib-resources==6.4.5\n + jaraco-classes==3.4.0\n + jaraco-context==6.0.1\n + jaraco-functools==4.1.0\n + jeepney==0.8.0\n + joblib==1.4.2\n + keyring==25.5.0\n + keyrings-alt==5.0.2\n + kiwisolver==1.4.7\n + matplotlib==3.7.5\n + more-itertools==10.5.0\n + networkx==3.1\n + nvidia-nccl-cu12==2.24.3\n + openpyxl==3.1.5\n + opentsne==1.0.1\n + pandas==2.0.3\n + pillow==10.4.0\n + pip==24.3.1\n + plotly==5.24.1\n + pycparser==2.22\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.2\n + requests==2.32.3\n + scikit-learn==1.3.2\n + scipy==1.10.1\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + tenacity==9.0.0\n + threadpoolctl==3.5.0\n + typing-extensions==4.12.2\n + tzdata==2024.2\n + urllib3==2.2.3\n + xgboost==2.1.3\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\n + zipp==3.20.2\nResolved 63 packages in 56ms\nInstalled 41 packages in 221ms\n + anyqt==0.2.0\n + asttokens==3.0.0\n + attrs==24.3.0\n + backcall==0.2.0\n + cattrs==24.1.2\n + comm==0.2.2\n + commonmark==0.9.1\n + debugpy==1.8.11\n + decorator==5.1.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + executing==2.1.0\n + ipykernel==6.29.5\n + ipython==8.12.3\n + jedi==0.19.2\n + jupyter-client==8.6.3\n + jupyter-core==5.7.2\n + matplotlib-inline==0.1.7\n + nest-asyncio==1.6.0\n + orange-canvas-core==0.2.2\n + orange-widget-base==4.24.0\n + parso==0.8.4\n + pexpect==4.9.0\n + pickleshare==0.7.5\n + platformdirs==4.3.6\n + prompt-toolkit==3.0.48\n + psutil==6.1.1\n + ptyprocess==0.7.0\n + pure-eval==0.2.3\n + pygments==2.19.1\n + pyqtgraph==0.13.3\n + pyzmq==26.2.0\n + qasync==0.27.1\n + qtconsole==5.6.1\n + qtpy==2.4.2\n + requests-cache==1.2.1\n + stack-data==0.6.3\n + tornado==6.4.2\n + traitlets==5.14.3\n + url-normalize==1.4.3\n + wcwidth==0.2.13\nResolved 2 packages in 2ms\nInstalled 2 packages in 4ms\n + psycopg2==2.9.10\n + pymssql==2.3.2\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` and ``easy_install``.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://github.com/pypa/setuptools/issues/917 for details.\n        ********************************************************************************\n\n!!\n  easy_install.initialize_options(self)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/.venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` directly.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.\n        ********************************************************************************\n\n!!\n  self.initialize_options()\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 18 items\n\nr2e_tests/test_1.py s.ssE.............                                   [100%]\n\n==================================== ERRORS ====================================\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/Orange/tests/__init__.py, line 68\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/Orange/tests/__init__.py:68\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::EvaluateTest::test_many_evaluation_results\nPASSED r2e_tests/test_1.py::TestROC::test_ROCData_from_results\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_apply_no_output\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_basic\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_calibrated_output\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_empty_input\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_image_export\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_many_evaluation_results\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_nan_input\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_target_prior\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_target_prior_reload\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_tooltips\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nERROR r2e_tests/test_1.py::test_filename\n==================== 14 passed, 3 skipped, 1 error in 7.57s ====================\nWidgets left: 0    Max widgets: 955 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 18 items\n\nr2e_tests/test_1.py s.ssE...........F.                                   [100%]\n\n==================================== ERRORS ====================================\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/Orange/tests/__init__.py, line 68\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_a592ddfb9a90b139f5e3e8497f6db8d70cd1eb3d/Orange/tests/__init__.py:68\n=================================== FAILURES ===================================\n__________________ TestOWROCAnalysis.test_target_prior_reload __________________\n\nself = <r2e_tests.test_1.TestOWROCAnalysis testMethod=test_target_prior_reload>\n\n    def test_target_prior_reload(self):\n        w = self.widget\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n        simulate.combobox_activate_item(w.controls.target_index, \"soft\")\n        self.assertEqual(np.round(5/12 * 100), w.target_prior)\n        self.send_signal(w.Inputs.evaluation_results, self.res)\n>       self.assertEqual(np.round(5/12 * 100), w.target_prior)\nE       AssertionError: 42.0 != 33.0\n\nr2e_tests/test_1.py:287: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::EvaluateTest::test_many_evaluation_results\nPASSED r2e_tests/test_1.py::TestROC::test_ROCData_from_results\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_apply_no_output\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_basic\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_calibrated_output\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_empty_input\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_image_export\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_many_evaluation_results\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_nan_input\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_target_prior\nPASSED r2e_tests/test_1.py::TestOWROCAnalysis::test_tooltips\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nERROR r2e_tests/test_1.py::test_filename\nFAILED r2e_tests/test_1.py::TestOWROCAnalysis::test_target_prior_reload - Ass...\n=============== 1 failed, 13 passed, 3 skipped, 1 error in 5.50s ===============\nWidgets left: 0    Max widgets: 1076 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/evaluate/owrocanalysis.py Orange/widgets/evaluate/tests/test_owrocanalysis.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Incorrect Reset of Target Prior When Reloading Evaluation Results in ROC Analysis

**Description:**
When reloading evaluation results in the ROC Analysis widget, the target prior probability is incorrectly reset instead of retaining the user-selected value. This causes inconsistencies in the displayed ROC curves and related metrics.

**Steps to Reproduce:**
1. Send evaluation results to the widget.
2. Select the "soft" option for target prior probability.
3. Reload the same evaluation results.

**Example Code:**
```python
# Initialize widget and send initial evaluation results
widget = OWROCAnalysis()
widget.send_signal(widget.Inputs.evaluation_results, results)

# Set target prior to "soft"
simulate.combobox_activate_item(widget.controls.target_index, "soft")
print(widget.target_prior)  # Expected: 42.0

# Reload evaluation results
widget.send_signal(widget.Inputs.evaluation_results, results)
print(widget.target_prior)  # Actual: 33.0
```

**Expected Behavior:**
After reloading the evaluation results, the target prior should remain set to "soft" with a value of 42.0, maintaining consistency in ROC analysis.

**Actual Behavior:**
Reloading the evaluation results resets the target prior to an incorrect value of 33.0, disregarding the previously selected "soft" option.

[/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/evaluate/owrocanalysis.py
import operator
from functools import reduce, wraps
from collections import namedtuple, deque, OrderedDict

import numpy as np
import sklearn.metrics as skl_metrics

from AnyQt.QtWidgets import QListView, QLabel, QGridLayout, QFrame, QAction, \
    QToolTip
from AnyQt.QtGui import QColor, QPen, QBrush, QPainter, QPalette, QFont, \
    QCursor, QFontMetrics
from AnyQt.QtCore import Qt, QSize
import pyqtgraph as pg

import Orange
from Orange.base import Model
from Orange.classification import ThresholdClassifier
from Orange.evaluation.testing import Results
from Orange.widgets import widget, gui, settings
from Orange.widgets.evaluate.contexthandlers import \
    EvaluationResultsContextHandler
from Orange.widgets.evaluate.utils import check_results_adequacy, \
    check_can_calibrate
from Orange.widgets.utils import colorpalettes
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.visualize.utils.plotutils import GraphicsView, PlotItem
from Orange.widgets.widget import Input, Output, Msg
from Orange.widgets import report

from Orange.widgets.evaluate.utils import results_for_preview


#: Points on a ROC curve
ROCPoints = namedtuple(
    "ROCPoints",
    ["fpr",        # (N,) array of false positive rate coordinates (ascending)
     "tpr",        # (N,) array of true positive rate coordinates
     "thresholds"  # (N,) array of thresholds (in descending order)
     ]
)
ROCPoints.is_valid = property(lambda self: self.fpr.size > 0)

#: ROC Curve and it's convex hull
ROCCurve = namedtuple(
    "ROCCurve",
    ["points",  # ROCPoints
     "hull"     # ROCPoints of the convex hull
     ]
)
ROCCurve.is_valid = property(lambda self: self.points.is_valid)

#: A ROC Curve averaged vertically
ROCAveragedVert = namedtuple(
    "ROCAveragedVert",
    ["points",   # ROCPoints sampled by fpr
     "hull",     # ROCPoints of the convex hull
     "tpr_std",  # array standard deviation of tpr at each fpr point
     ]
)
ROCAveragedVert.is_valid = property(lambda self: self.points.is_valid)

#: A ROC Curve averaged by thresholds
ROCAveragedThresh = namedtuple(
    "ROCAveragedThresh",
    ["points",   # ROCPoints sampled by threshold
     "hull",     # ROCPoints of the convex hull
     "tpr_std",  # array standard deviations of tpr at each threshold
     "fpr_std"   # array standard deviations of fpr at each threshold
     ]
)
ROCAveragedThresh.is_valid = property(lambda self: self.points.is_valid)

#: Combined data for a ROC curve of a single algorithm
ROCData = namedtuple(
    "ROCData",
    ["merged",  # ROCCurve merged over all folds
     "folds",   # ROCCurve list, one for each fold
     "avg_vertical",   # ROCAveragedVert
     "avg_threshold",  # ROCAveragedThresh
     ]
)


def roc_data_from_results(results, clf_index, target):
    """
    Compute ROC Curve(s) from evaluation results.

    :param Orange.evaluation.Results results:
        Evaluation results.
    :param int clf_index:
        Learner index in the `results`.
    :param int target:
        Target class index (i.e. positive class).
    :rval ROCData:
        A instance holding the computed curves.
    """
    merged = roc_curve_for_fold(results, ..., clf_index, target)
    merged_curve = ROCCurve(ROCPoints(*merged),
                            ROCPoints(*roc_curve_convex_hull(merged)))

    folds = results.folds if results.folds is not None else [...]
    fold_curves = []
    for fold in folds:
        points = roc_curve_for_fold(results, fold, clf_index, target)
        hull = roc_curve_convex_hull(points)
        c = ROCCurve(ROCPoints(*points), ROCPoints(*hull))
        fold_curves.append(c)

    curves = [fold.points for fold in fold_curves
              if fold.is_valid]

    if curves:
        fpr, tpr, std = roc_curve_vertical_average(curves)

        thresh = np.zeros_like(fpr) * np.nan
        hull = roc_curve_convex_hull((fpr, tpr, thresh))
        v_avg = ROCAveragedVert(
            ROCPoints(fpr, tpr, thresh),
            ROCPoints(*hull),
            std
        )
    else:
        # return an invalid vertical averaged ROC
        v_avg = ROCAveragedVert(
            ROCPoints(np.array([]), np.array([]), np.array([])),
            ROCPoints(np.array([]), np.array([]), np.array([])),
            np.array([])
        )

    if curves:
        all_thresh = np.hstack([t for _, _, t in curves])
        all_thresh = np.clip(all_thresh, 0.0 - 1e-10, 1.0 + 1e-10)
        all_thresh = np.unique(all_thresh)[::-1]
        thresh = all_thresh[::max(all_thresh.size // 10, 1)]

        (fpr, fpr_std), (tpr, tpr_std) = \
            roc_curve_threshold_average(curves, thresh)

        hull = roc_curve_convex_hull((fpr, tpr, thresh))

        t_avg = ROCAveragedThresh(
            ROCPoints(fpr, tpr, thresh),
            ROCPoints(*hull),
            tpr_std,
            fpr_std
        )
    else:
        # return an invalid threshold averaged ROC
        t_avg = ROCAveragedThresh(
            ROCPoints(np.array([]), np.array([]), np.array([])),
            ROCPoints(np.array([]), np.array([]), np.array([])),
            np.array([]),
            np.array([])
        )
    return ROCData(merged_curve, fold_curves, v_avg, t_avg)

ROCData.from_results = staticmethod(roc_data_from_results)

#: A curve item to be displayed in a plot
PlotCurve = namedtuple(
    "PlotCurve",
    ["curve",        # ROCCurve source curve
     "curve_item",   # pg.PlotDataItem main curve
     "hull_item"     # pg.PlotDataItem curve's convex hull
     ]
)


def plot_curve(curve, pen=None, shadow_pen=None, symbol="+",
               symbol_size=3, name=None):
    """
    Construct a `PlotCurve` for the given `ROCCurve`.

    :param ROCCurve curve:
        Source curve.

    The other parameters are passed to pg.PlotDataItem

    :rtype: PlotCurve
    """
    def extend_to_origin(points):
        "Extend ROCPoints to include coordinate origin if not already present"
        if points.tpr.size and (points.tpr[0] > 0 or points.fpr[0] > 0):
            points = ROCPoints(
                np.r_[0, points.fpr], np.r_[0, points.tpr],
                np.r_[points.thresholds[0] + 1, points.thresholds]
            )
        return points

    points = extend_to_origin(curve.points)
    item = pg.PlotCurveItem(
        points.fpr, points.tpr, pen=pen, shadowPen=shadow_pen,
        name=name, antialias=True
    )
    sp = pg.ScatterPlotItem(
        curve.points.fpr, curve.points.tpr, symbol=symbol,
        size=symbol_size, pen=shadow_pen,
        name=name
    )
    sp.setParentItem(item)

    hull = extend_to_origin(curve.hull)

    hull_item = pg.PlotDataItem(
        hull.fpr, hull.tpr, pen=pen, antialias=True
    )
    return PlotCurve(curve, item, hull_item)

PlotCurve.from_roc_curve = staticmethod(plot_curve)

#: A curve displayed in a plot with error bars
PlotAvgCurve = namedtuple(
    "PlotAvgCurve",
    ["curve",         # ROCCurve
     "curve_item",    # pg.PlotDataItem
     "hull_item",     # pg.PlotDataItem
     "confint_item",  # pg.ErrorBarItem
     ]
)


def plot_avg_curve(curve, pen=None, shadow_pen=None, symbol="+",
                   symbol_size=4, name=None):
    """
    Construct a `PlotAvgCurve` for the given `curve`.

    :param curve: Source curve.
    :type curve: ROCAveragedVert or ROCAveragedThresh

    The other parameters are passed to pg.PlotDataItem

    :rtype: PlotAvgCurve
    """
    pc = plot_curve(curve, pen=pen, shadow_pen=shadow_pen, symbol=symbol,
                    symbol_size=symbol_size, name=name)

    points = curve.points
    if isinstance(curve, ROCAveragedVert):
        tpr_std = curve.tpr_std
        error_item = pg.ErrorBarItem(
            x=points.fpr[1:-1], y=points.tpr[1:-1],
            height=2 * tpr_std[1:-1],
            pen=pen, beam=0.025,
            antialias=True,
        )
    elif isinstance(curve, ROCAveragedThresh):
        tpr_std, fpr_std = curve.tpr_std, curve.fpr_std
        error_item = pg.ErrorBarItem(
            x=points.fpr[1:-1], y=points.tpr[1:-1],
            height=2 * tpr_std[1:-1], width=2 * fpr_std[1:-1],
            pen=pen, beam=0.025,
            antialias=True,
        )
    return PlotAvgCurve(curve, pc.curve_item, pc.hull_item, error_item)

PlotAvgCurve.from_roc_curve = staticmethod(plot_avg_curve)

Some = namedtuple("Some", ["val"])


def once(f):
    """
    Return a function that will be called only once, and it's result cached.
    """
    cached = None

    @wraps(f)
    def wraped():
        nonlocal cached
        if cached is None:
            cached = Some(f())
        return cached.val
    return wraped


PlotCurves = namedtuple(
    "PlotCurves",
    ["merge",   # :: () -> PlotCurve
     "folds",   # :: () -> [PlotCurve]
     "avg_vertical",   # :: () -> PlotAvgCurve
     "avg_threshold",  # :: () -> PlotAvgCurve
     ]
)


class InfiniteLine(pg.InfiniteLine):
    """pyqtgraph.InfiniteLine extended to support antialiasing.
    """
    def __init__(self, pos=None, angle=90, pen=None, movable=False,
                 bounds=None, antialias=False):
        super().__init__(pos, angle, pen, movable, bounds)
        self.antialias = antialias

    def paint(self, p, *args):
        if self.antialias:
            p.setRenderHint(QPainter.Antialiasing, True)
        super().paint(p, *args)


class OWROCAnalysis(widget.OWWidget):
    name = "ROC Analysis"
    description = "Display the Receiver Operating Characteristics curve " \
                  "based on the evaluation of classifiers."
    icon = "icons/ROCAnalysis.svg"
    priority = 1010
    keywords = "roc analysis, analyse"

    class Inputs:
        evaluation_results = Input("Evaluation Results", Orange.evaluation.Results)

    class Outputs:
        calibrated_model = Output("Calibrated Model", Model)

    class Information(widget.OWWidget.Information):
        no_output = Msg("Can't output a model: {}")

    buttons_area_orientation = None
    settingsHandler = EvaluationResultsContextHandler()
    target_index = settings.ContextSetting(0)
    selected_classifiers = settings.ContextSetting([])

    display_perf_line = settings.Setting(True)
    display_def_threshold = settings.Setting(True)

    fp_cost = settings.Setting(500)
    fn_cost = settings.Setting(500)
    target_prior = settings.Setting(50.0, schema_only=True)

    #: ROC Averaging Types
    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3
    roc_averaging = settings.Setting(Merge)

    display_convex_hull = settings.Setting(False)
    display_convex_curve = settings.Setting(False)

    graph_name = "plot"  # pg.GraphicsItem (pg.PlotItem)

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

        self.results = None
        self.classifier_names = []
        self.perf_line = None
        self.colors = []
        self._curve_data = {}
        self._plot_curves = {}
        self._rocch = None
        self._perf_line = None
        self._tooltip_cache = None

        box = gui.vBox(self.controlArea, "Plot")
        self.target_cb = gui.comboBox(
            box, self, "target_index",
            label="Target", orientation=Qt.Horizontal,
            callback=self._on_target_changed,
            contentsLength=8, searchable=True)

        gui.widgetLabel(box, "Classifiers")
        line_height = 4 * QFontMetrics(self.font()).lineSpacing()
        self.classifiers_list_box = gui.listBox(
            box, self, "selected_classifiers", "classifier_names",
            selectionMode=QListView.MultiSelection,
            callback=self._on_classifiers_changed,
            sizeHint=QSize(0, line_height))

        abox = gui.vBox(self.controlArea, "Curves")
        gui.comboBox(abox, self, "roc_averaging",
                     items=["Merge Predictions from Folds", "Mean TP Rate",
                            "Mean TP and FP at Threshold", "Show Individual Curves"],
                     callback=self._replot)

        gui.checkBox(abox, self, "display_convex_curve",
                     "Show convex ROC curves", callback=self._replot)
        gui.checkBox(abox, self, "display_convex_hull",
                     "Show ROC convex hull", callback=self._replot)

        box = gui.vBox(self.controlArea, "Analysis")

        gui.checkBox(box, self, "display_def_threshold",
                     "Default threshold (0.5) point",
                     callback=self._on_display_def_threshold_changed)

        gui.checkBox(box, self, "display_perf_line", "Show performance line",
                     callback=self._on_display_perf_line_changed)
        grid = QGridLayout()
        gui.indentedBox(box, orientation=grid)

        sp = gui.spin(box, self, "fp_cost", 1, 1000, 10,
                      alignment=Qt.AlignRight,
                      callback=self._on_display_perf_line_changed)
        grid.addWidget(QLabel("FP Cost:"), 0, 0)
        grid.addWidget(sp, 0, 1)

        sp = gui.spin(box, self, "fn_cost", 1, 1000, 10,
                      alignment=Qt.AlignRight,
                      callback=self._on_display_perf_line_changed)
        grid.addWidget(QLabel("FN Cost:"))
        grid.addWidget(sp, 1, 1)
        self.target_prior_sp = gui.spin(box, self, "target_prior", 1, 99,
                                        alignment=Qt.AlignRight,
                                        spinType=float,
                                        callback=self._on_target_prior_changed)
        self.target_prior_sp.setSuffix(" %")
        self.target_prior_sp.addAction(QAction("Auto", sp))
        grid.addWidget(QLabel("Prior probability:"))
        grid.addWidget(self.target_prior_sp, 2, 1)

        self.plotview = GraphicsView(background=None)
        self.plotview.setFrameStyle(QFrame.StyledPanel)
        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)

        self.plot = PlotItem(enableMenu=False)
        self.plot.setMouseEnabled(False, False)
        self.plot.hideButtons()

        tickfont = QFont(self.font())
        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))

        axis = self.plot.getAxis("bottom")
        axis.setTickFont(tickfont)
        axis.setLabel("FP Rate (1-Specificity)")
        axis.setGrid(16)

        axis = self.plot.getAxis("left")
        axis.setTickFont(tickfont)
        axis.setLabel("TP Rate (Sensitivity)")
        axis.setGrid(16)

        self.plot.showGrid(True, True, alpha=0.2)
        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)

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

    @Inputs.evaluation_results
    def set_results(self, results):
        """Set the input evaluation results."""
        self.closeContext()
        self.clear()
        self.results = check_results_adequacy(results, self.Error)
        if self.results is not None:
            self._initialize(self.results)
            self.openContext(self.results.domain.class_var,
                             self.classifier_names)
            self._setup_plot()
        else:
            self.warning()

    def clear(self):
        """Clear the widget state."""
        self.results = None
        self.plot.clear()
        self.classifier_names = []
        self.selected_classifiers = []
        self.target_cb.clear()
        self.colors = []
        self._curve_data = {}
        self._plot_curves = {}
        self._rocch = None
        self._perf_line = None
        self._tooltip_cache = None

    def _initialize(self, results):
        names = getattr(results, "learner_names", None)

        if names is None:
            names = ["#{}".format(i + 1)
                     for i in range(len(results.predicted))]

        self.colors = colorpalettes.get_default_curve_colors(len(names))

        self.classifier_names = names
        self.selected_classifiers = list(range(len(names)))
        for i in range(len(names)):
            listitem = self.classifiers_list_box.item(i)
            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))

        class_var = results.domain.class_var
        self.target_cb.addItems(class_var.values)
        self.target_index = 0
        self._set_target_prior()

    def _set_target_prior(self):
        """
        This function sets the initial target class probability prior value
        based on the input data.
        """
        if self.results.data:
            # here we can use target_index directly since values in the
            # dropdown are sorted in same order than values in the table
            target_values_cnt = np.count_nonzero(
                self.results.data.Y == self.target_index)
            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))
            self.target_prior = np.round(target_values_cnt / count_all * 100)

            # set the spin text to gray color when set automatically
            self.target_prior_sp.setStyleSheet("color: gray;")

    def curve_data(self, target, clf_idx):
        """Return `ROCData' for the given target and classifier."""
        if (target, clf_idx) not in self._curve_data:
            # pylint: disable=no-member
            data = ROCData.from_results(self.results, clf_idx, target)
            self._curve_data[target, clf_idx] = data

        return self._curve_data[target, clf_idx]

    def plot_curves(self, target, clf_idx):
        """Return a set of functions `plot_curves` generating plot curves."""
        def generate_pens(basecolor):
            pen = QPen(basecolor, 1)
            pen.setCosmetic(True)

            shadow_pen = QPen(pen.color().lighter(160), 2.5)
            shadow_pen.setCosmetic(True)
            return pen, shadow_pen

        data = self.curve_data(target, clf_idx)

        if (target, clf_idx) not in self._plot_curves:
            pen, shadow_pen = generate_pens(self.colors[clf_idx])
            name = self.classifier_names[clf_idx]
            @once
            def merged():
                return plot_curve(
                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)
            @once
            def folds():
                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)
                        for fold in data.folds]
            @once
            def avg_vert():
                return plot_avg_curve(data.avg_vertical, pen=pen,
                                      shadow_pen=shadow_pen, name=name)
            @once
            def avg_thres():
                return plot_avg_curve(data.avg_threshold, pen=pen,
                                      shadow_pen=shadow_pen, name=name)

            self._plot_curves[target, clf_idx] = PlotCurves(
                merge=merged, folds=folds,
                avg_vertical=avg_vert, avg_threshold=avg_thres
            )

        return self._plot_curves[target, clf_idx]

    def _setup_plot(self):
        def merge_averaging():
            for curve in curves:
                graphics = curve.merge()
                curve = graphics.curve
                self.plot.addItem(graphics.curve_item)

                if self.display_convex_curve:
                    self.plot.addItem(graphics.hull_item)

                if self.display_def_threshold and curve.is_valid:
                    points = curve.points
                    ind = np.argmin(np.abs(points.thresholds - 0.5))
                    item = pg.TextItem(
                        text="{:.3f}".format(points.thresholds[ind]),
                        color=foreground
                    )
                    item.setPos(points.fpr[ind], points.tpr[ind])
                    self.plot.addItem(item)

            hull_curves = [curve.merged.hull for curve in selected]
            if hull_curves:
                self._rocch = convex_hull(hull_curves)
                iso_pen = QPen(foreground, 1.0)
                iso_pen.setCosmetic(True)
                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)
                self.plot.addItem(self._perf_line)
            return hull_curves

        def vertical_averaging():
            for curve in curves:
                graphics = curve.avg_vertical()

                self.plot.addItem(graphics.curve_item)
                self.plot.addItem(graphics.confint_item)
            return [curve.avg_vertical.hull for curve in selected]

        def threshold_averaging():
            for curve in curves:
                graphics = curve.avg_threshold()
                self.plot.addItem(graphics.curve_item)
                self.plot.addItem(graphics.confint_item)
            return [curve.avg_threshold.hull for curve in selected]

        def no_averaging():
            for curve in curves:
                graphics = curve.folds()
                for fold in graphics:
                    self.plot.addItem(fold.curve_item)
                    if self.display_convex_curve:
                        self.plot.addItem(fold.hull_item)
            return [fold.hull for curve in selected for fold in curve.folds]

        averagings = {
            OWROCAnalysis.Merge: merge_averaging,
            OWROCAnalysis.Vertical: vertical_averaging,
            OWROCAnalysis.Threshold: threshold_averaging,
            OWROCAnalysis.NoAveraging: no_averaging
        }
        foreground = self.plotview.scene().palette().color(QPalette.Text)
        target = self.target_index
        selected = self.selected_classifiers

        curves = [self.plot_curves(target, i) for i in selected]
        selected = [self.curve_data(target, i) for i in selected]
        hull_curves = averagings[self.roc_averaging]()

        if self.display_convex_hull and hull_curves:
            hull = convex_hull(hull_curves)
            hull_color = QColor(foreground)
            hull_color.setAlpha(100)
            hull_pen = QPen(hull_color, 2)
            hull_pen.setCosmetic(True)
            hull_color.setAlpha(50)
            item = self.plot.plot(
                hull.fpr, hull.tpr,
                pen=hull_pen,
                brush=QBrush(hull_color),
                fillLevel=0)
            item.setZValue(-10000)
        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)
        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)
        pen.setCosmetic(True)
        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)

        self._update_perf_line()

        self._update_axes_ticks()

        warning = ""
        if not all(c.is_valid for c in hull_curves):
            if any(c.is_valid for c in hull_curves):
                warning = "Some ROC curves are undefined"
            else:
                warning = "All ROC curves are undefined"
        self.warning(warning)

    def _update_axes_ticks(self):
        def enumticks(a):
            a = np.unique(a)
            if len(a) > 15:
                return None
            return [[(x, f"{x:.2f}") for x in a[::-1]]]

        axis_bottom = self.plot.getAxis("bottom")
        axis_left = self.plot.getAxis("left")

        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \
                or self.roc_averaging != OWROCAnalysis.Merge:
            axis_bottom.setTicks(None)
            axis_left.setTicks(None)
        else:
            data = self.curve_data(self.target_index, self.selected_classifiers[0])
            points = data.merged.points
            axis_bottom.setTicks(enumticks(points.fpr))
            axis_left.setTicks(enumticks(points.tpr))

    def _on_mouse_moved(self, pos):
        target = self.target_index
        selected = self.selected_classifiers
        curves = [(clf_idx, self.plot_curves(target, clf_idx))
                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]
        valid_thresh, valid_clf = [], []
        pt, ave_mode = None, self.roc_averaging

        for clf_idx, crv in curves:
            if self.roc_averaging == OWROCAnalysis.Merge:
                curve = crv.merge()
            elif self.roc_averaging == OWROCAnalysis.Vertical:
                curve = crv.avg_vertical()
            elif self.roc_averaging == OWROCAnalysis.Threshold:
                curve = crv.avg_threshold()
            else:
                # currently not implemented for 'Show Individual Curves'
                return

            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem
            act_pos = sp.mapFromScene(pos)
            pts = list(sp.pointsAt(act_pos))

            if pts:
                mouse_pt = pts[0].pos()
                if self._tooltip_cache:
                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache
                    curr_thresh, curr_clf = [], []
                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \
                            and cache_ave == self.roc_averaging:
                        mask = np.equal(cache_clf, clf_idx)
                        curr_thresh = np.compress(mask, cache_thresh).tolist()
                        curr_clf = np.compress(mask, cache_clf).tolist()
                    else:
                        QToolTip.showText(QCursor.pos(), "")
                        self._tooltip_cache = None

                    if curr_thresh:
                        valid_thresh.append(*curr_thresh)
                        valid_clf.append(*curr_clf)
                        pt = cache_pt
                        continue

                curve_pts = curve.curve.points
                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))
                diff = np.subtract(roc_points, mouse_pt)
                # Find closest point on curve and save the corresponding threshold
                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))

                thresh = curve_pts.thresholds[idx_closest]
                if not np.isnan(thresh):
                    valid_thresh.append(thresh)
                    valid_clf.append(clf_idx)
                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]

        if valid_thresh:
            clf_names = self.classifier_names
            msg = "Thresholds:\n" + "\n".join(["({:s}) {:.3f}".format(clf_names[i], thresh)
                                               for i, thresh in zip(valid_clf, valid_thresh)])
            QToolTip.showText(QCursor.pos(), msg)
            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)

    def _on_target_changed(self):
        self.plot.clear()
        self._set_target_prior()
        self._setup_plot()

    def _on_classifiers_changed(self):
        self.plot.clear()
        if self.results is not None:
            self._setup_plot()

    def _on_target_prior_changed(self):
        self.target_prior_sp.setStyleSheet("color: black;")
        self._on_display_perf_line_changed()

    def _on_display_perf_line_changed(self):
        self._update_perf_line()

        if self.perf_line is not None:
            self.perf_line.setVisible(self.display_perf_line)

    def _on_display_def_threshold_changed(self):
        self._replot()

    def _replot(self):
        self.plot.clear()
        if self.results is not None:
            self._setup_plot()

    def _update_perf_line(self):

        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:
            self._update_output(None)
            return

        ind = None
        self._perf_line.setVisible(self.display_perf_line)
        if self.display_perf_line:
            m = roc_iso_performance_slope(
                self.fp_cost, self.fn_cost, self.target_prior / 100.0)

            hull = self._rocch
            if hull.is_valid:
                ind = roc_iso_performance_line(m, hull)
                angle = np.arctan2(m, 1)  # in radians
                self._perf_line.setAngle(angle * 180 / np.pi)
                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))
            else:
                self._perf_line.setVisible(False)

        self._update_output(None if ind is None else hull.thresholds[ind[0]])

    def _update_output(self, threshold):
        self.Information.no_output.clear()

        if threshold is None:
            self.Outputs.calibrated_model.send(None)
            return

        problems = check_can_calibrate(self.results, self.selected_classifiers)
        if problems:
            self.Information.no_output(problems)
            self.Outputs.calibrated_model.send(None)
            return

        model = ThresholdClassifier(
            self.results.models[0][self.selected_classifiers[0]],
            threshold)
        self.Outputs.calibrated_model.send(model)

    def onDeleteWidget(self):
        self.clear()

    def send_report(self):
        if self.results is None:
            return
        items = OrderedDict()
        items["Target class"] = self.target_cb.currentText()
        if self.display_perf_line:
            items["Costs"] = \
                "FP = {}, FN = {}".format(self.fp_cost, self.fn_cost)
            items["Target probability"] = "{} %".format(self.target_prior)
        caption = report.list_legend(self.classifiers_list_box,
                                     self.selected_classifiers)
        self.report_items(items)
        self.report_plot()
        self.report_caption(caption)


def interp(x, xp, fp, left=None, right=None):
    """
    Like numpy.interp except for handling of running sequences of
    same values in `xp`.
    """
    x = np.asanyarray(x)
    xp = np.asanyarray(xp)
    fp = np.asanyarray(fp)

    if xp.shape != fp.shape:
        raise ValueError("xp and fp must have the same shape")

    ind = np.searchsorted(xp, x, side="right")
    fx = np.zeros(len(x))

    under = ind == 0
    over = ind == len(xp)
    between = ~under & ~over

    fx[under] = left if left is not None else fp[0]
    fx[over] = right if right is not None else fp[-1]

    if right is not None:
        # Fix points exactly on the right boundary.
        fx[x == xp[-1]] = fp[-1]

    ind = ind[between]

    df = (fp[ind] - fp[ind - 1]) / (xp[ind] - xp[ind - 1])

    fx[between] = df * (x[between] - xp[ind]) + fp[ind]

    return fx


def roc_curve_for_fold(res, fold, clf_idx, target):
    fold_actual = res.actual[fold]
    P = np.sum(fold_actual == target)
    N = fold_actual.size - P

    if P == 0 or N == 0:
        # Undefined TP and FP rate
        return np.array([]), np.array([]), np.array([])

    fold_probs = res.probabilities[clf_idx][fold][:, target]
    drop_intermediate = len(fold_actual) > 20
    fpr, tpr, thresholds = skl_metrics.roc_curve(
        fold_actual, fold_probs, pos_label=target,
        drop_intermediate=drop_intermediate
    )

    # skl sets the first threshold to the highest threshold in the data + 1
    # since we deal with probabilities, we (carefully) set it to 1
    # Unrelated comparisons, thus pylint: disable=chained-comparison
    if len(thresholds) > 1 and thresholds[1] <= 1:
        thresholds[0] = 1
    return fpr, tpr, thresholds


def roc_curve_vertical_average(curves, samples=10):
    if not curves:
        raise ValueError("No curves")
    fpr_sample = np.linspace(0.0, 1.0, samples)
    tpr_samples = []
    for fpr, tpr, _ in curves:
        tpr_samples.append(interp(fpr_sample, fpr, tpr, left=0, right=1))

    tpr_samples = np.array(tpr_samples)
    return fpr_sample, tpr_samples.mean(axis=0), tpr_samples.std(axis=0)


def roc_curve_threshold_average(curves, thresh_samples):
    if not curves:
        raise ValueError("No curves")
    fpr_samples, tpr_samples = [], []
    for fpr, tpr, thresh in curves:
        ind = np.searchsorted(thresh[::-1], thresh_samples, side="left")
        ind = ind[::-1]
        ind = np.clip(ind, 0, len(thresh) - 1)
        fpr_samples.append(fpr[ind])
        tpr_samples.append(tpr[ind])

    fpr_samples = np.array(fpr_samples)
    tpr_samples = np.array(tpr_samples)

    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),
            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))


def roc_curve_thresh_avg_interp(curves, thresh_samples):
    fpr_samples, tpr_samples = [], []
    for fpr, tpr, thresh in curves:
        thresh = thresh[::-1]
        fpr = interp(thresh_samples, thresh, fpr[::-1], left=1.0, right=0.0)
        tpr = interp(thresh_samples, thresh, tpr[::-1], left=1.0, right=0.0)
        fpr_samples.append(fpr)
        tpr_samples.append(tpr)

    fpr_samples = np.array(fpr_samples)
    tpr_samples = np.array(tpr_samples)

    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),
            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))


RocPoint = namedtuple("RocPoint", ["fpr", "tpr", "threshold"])


def roc_curve_convex_hull(curve):
    def slope(p1, p2):
        x1, y1, _ = p1
        x2, y2, _ = p2
        if x1 != x2:
            return  (y2 - y1) / (x2 - x1)
        else:
            return np.inf

    fpr, _, _ = curve

    if len(fpr) <= 2:
        return curve
    points = map(RocPoint._make, zip(*curve))

    hull = deque([next(points)])

    for point in points:
        while True:
            if len(hull) < 2:
                hull.append(point)
                break
            else:
                last = hull[-1]
                if point.fpr != last.fpr and \
                        slope(hull[-2], last) > slope(last, point):
                    hull.append(point)
                    break
                else:
                    hull.pop()

    fpr = np.array([p.fpr for p in hull])
    tpr = np.array([p.tpr for p in hull])
    thres = np.array([p.threshold for p in hull])
    return (fpr, tpr, thres)


def convex_hull(curves):
    def slope(p1, p2):
        x1, y1, *_ = p1
        x2, y2, *_ = p2
        if x1 != x2:
            return (y2 - y1) / (x2 - x1)
        else:
            return np.inf

    curves = [list(map(RocPoint._make, zip(*curve))) for curve in curves]

    merged_points = reduce(operator.iadd, curves, [])
    merged_points = sorted(merged_points)

    if not merged_points:
        return ROCPoints(np.array([]), np.array([]), np.array([]))

    if len(merged_points) <= 2:
        return ROCPoints._make(map(np.array, zip(*merged_points)))

    points = iter(merged_points)

    hull = deque([next(points)])

    for point in points:
        while True:
            if len(hull) < 2:
                hull.append(point)
                break
            else:
                last = hull[-1]
                if point[0] != last[0] and \
                        slope(hull[-2], last) > slope(last, point):
                    hull.append(point)
                    break
                else:
                    hull.pop()

    return ROCPoints._make(map(np.array, zip(*hull)))


def roc_iso_performance_line(slope, hull, tol=1e-5):
    """
    Return the indices where a line with `slope` touches the ROC convex hull.
    """
    fpr, tpr, *_ = hull

    # Compute the distance of each point to a reference iso line
    # going through point (0, 1). The point(s) with the minimum
    # distance are our result

    # y = m * x + 1
    # m * x - 1y + 1 = 0
    a, b, c = slope, -1, 1
    dist = distance_to_line(a, b, c, fpr, tpr)
    mindist = np.min(dist)

    return np.flatnonzero((dist - mindist) <= tol)


def distance_to_line(a, b, c, x0, y0):
    """
    Return the distance to a line ax + by + c = 0
    """
    assert a != 0 or b != 0
    return np.abs(a * x0 + b * y0 + c) / np.sqrt(a ** 2 + b ** 2)


def roc_iso_performance_slope(fp_cost, fn_cost, p):
    assert 0 <= p <= 1
    if fn_cost * p == 0:
        return np.inf
    else:
        return (fp_cost * (1. - p)) / (fn_cost * p)


def _create_results():  # pragma: no cover
    probs1 = [0.984, 0.907, 0.881, 0.865, 0.815, 0.741, 0.735, 0.635,
              0.582, 0.554, 0.413, 0.317, 0.287, 0.225, 0.216, 0.183]
    probs = np.array([[[1 - x, x] for x in probs1]])
    preds = (probs > 0.5).astype(float)
    return Results(
        data=Orange.data.Table("heart_disease")[:16],
        row_indices=np.arange(16),
        actual=np.array(list(map(int, "1100111001001000"))),
        probabilities=probs, predicted=preds
    )


if __name__ == "__main__":  # pragma: no cover
    # WidgetPreview(OWROCAnalysis).run(_create_results())
    WidgetPreview(OWROCAnalysis).run(results_for_preview())

```
--- 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:** Incorrect Reset of Target Prior When Reloading Evaluation Results in ROC Analysis

**Description:**
When reloading evaluation results in the ROC Analysis widget, the target prior probability is incorrectly reset instead of retaining the user-selected value. This causes inconsistencies in the displayed ROC curves and related metrics.

**Steps to Reproduce:**
1. Send evaluation results to the widget.
2. Select the "soft" option for target prior probability.
3. Reload the same evaluation results.

**Example Code:**
```python
# Initialize widget and send initial evaluation results
widget = OWROCAnalysis()
widget.send_signal(widget.Inputs.evaluation_results, results)

# Set target prior to "soft"
simulate.combobox_activate_item(widget.controls.target_index, "soft")
print(widget.target_prior)  # Expected: 42.0

# Reload evaluation results
widget.send_signal(widget.Inputs.evaluation_results, results)
print(widget.target_prior)  # Actual: 33.0
```

**Expected Behavior:**
After reloading the evaluation results, the target prior should remain set to "soft" with a value of 42.0, maintaining consistency in ROC analysis.

**Actual Behavior:**
Reloading the evaluation results resets the target prior to an incorrect value of 33.0, disregarding the previously selected "soft" option.

[/ISSUE]
{
    "EvaluateTest.test_many_evaluation_results": "PASSED",
    "TestROC.test_ROCData_from_results": "PASSED",
    "TestOWROCAnalysis.test_apply_no_output": "PASSED",
    "TestOWROCAnalysis.test_basic": "PASSED",
    "TestOWROCAnalysis.test_calibrated_output": "PASSED",
    "TestOWROCAnalysis.test_empty_input": "PASSED",
    "TestOWROCAnalysis.test_image_export": "PASSED",
    "TestOWROCAnalysis.test_many_evaluation_results": "PASSED",
    "TestOWROCAnalysis.test_minimum_size": "PASSED",
    "TestOWROCAnalysis.test_msg_base_class": "PASSED",
    "TestOWROCAnalysis.test_nan_input": "PASSED",
    "TestOWROCAnalysis.test_target_prior": "PASSED",
    "TestOWROCAnalysis.test_target_prior_reload": "PASSED",
    "TestOWROCAnalysis.test_tooltips": "PASSED",
    "test_filename": "ERROR"
}
diff --git a/Orange/widgets/evaluate/owrocanalysis.py b/Orange/widgets/evaluate/owrocanalysis.py
index 1a82f769b..8a42c0ba7 100644
--- a/Orange/widgets/evaluate/owrocanalysis.py
+++ b/Orange/widgets/evaluate/owrocanalysis.py
@@ -442,6 +442,7 @@ class OWROCAnalysis(widget.OWWidget):
             self._initialize(self.results)
             self.openContext(self.results.domain.class_var,
                              self.classifier_names)
+            self._set_target_prior()
             self._setup_plot()
         else:
             self.warning()

{"Orange/widgets/evaluate/owrocanalysis.py": "import operator\nfrom functools import reduce, wraps\nfrom collections import namedtuple, deque, OrderedDict\n\nimport numpy as np\nimport sklearn.metrics as skl_metrics\n\nfrom AnyQt.QtWidgets import QListView, QLabel, QGridLayout, QFrame, QAction, \\\n    QToolTip\nfrom AnyQt.QtGui import QColor, QPen, QBrush, QPainter, QPalette, QFont, \\\n    QCursor, QFontMetrics\nfrom AnyQt.QtCore import Qt, QSize\nimport pyqtgraph as pg\n\nimport Orange\nfrom Orange.base import Model\nfrom Orange.classification import ThresholdClassifier\nfrom Orange.evaluation.testing import Results\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.evaluate.contexthandlers import \\\n    EvaluationResultsContextHandler\nfrom Orange.widgets.evaluate.utils import check_results_adequacy, \\\n    check_can_calibrate\nfrom Orange.widgets.utils import colorpalettes\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.utils.plotutils import GraphicsView, PlotItem\nfrom Orange.widgets.widget import Input, Output, Msg\nfrom Orange.widgets import report\n\nfrom Orange.widgets.evaluate.utils import results_for_preview\n\n\n#: Points on a ROC curve\nROCPoints = namedtuple(\n    \"ROCPoints\",\n    [\"fpr\",        # (N,) array of false positive rate coordinates (ascending)\n     \"tpr\",        # (N,) array of true positive rate coordinates\n     \"thresholds\"  # (N,) array of thresholds (in descending order)\n     ]\n)\nROCPoints.is_valid = property(lambda self: self.fpr.size > 0)\n\n#: ROC Curve and it's convex hull\nROCCurve = namedtuple(\n    \"ROCCurve\",\n    [\"points\",  # ROCPoints\n     \"hull\"     # ROCPoints of the convex hull\n     ]\n)\nROCCurve.is_valid = property(lambda self: self.points.is_valid)\n\n#: A ROC Curve averaged vertically\nROCAveragedVert = namedtuple(\n    \"ROCAveragedVert\",\n    [\"points\",   # ROCPoints sampled by fpr\n     \"hull\",     # ROCPoints of the convex hull\n     \"tpr_std\",  # array standard deviation of tpr at each fpr point\n     ]\n)\nROCAveragedVert.is_valid = property(lambda self: self.points.is_valid)\n\n#: A ROC Curve averaged by thresholds\nROCAveragedThresh = namedtuple(\n    \"ROCAveragedThresh\",\n    [\"points\",   # ROCPoints sampled by threshold\n     \"hull\",     # ROCPoints of the convex hull\n     \"tpr_std\",  # array standard deviations of tpr at each threshold\n     \"fpr_std\"   # array standard deviations of fpr at each threshold\n     ]\n)\nROCAveragedThresh.is_valid = property(lambda self: self.points.is_valid)\n\n#: Combined data for a ROC curve of a single algorithm\nROCData = namedtuple(\n    \"ROCData\",\n    [\"merged\",  # ROCCurve merged over all folds\n     \"folds\",   # ROCCurve list, one for each fold\n     \"avg_vertical\",   # ROCAveragedVert\n     \"avg_threshold\",  # ROCAveragedThresh\n     ]\n)\n\n\ndef roc_data_from_results(results, clf_index, target):\n    \"\"\"\n    Compute ROC Curve(s) from evaluation results.\n\n    :param Orange.evaluation.Results results:\n        Evaluation results.\n    :param int clf_index:\n        Learner index in the `results`.\n    :param int target:\n        Target class index (i.e. positive class).\n    :rval ROCData:\n        A instance holding the computed curves.\n    \"\"\"\n    merged = roc_curve_for_fold(results, ..., clf_index, target)\n    merged_curve = ROCCurve(ROCPoints(*merged),\n                            ROCPoints(*roc_curve_convex_hull(merged)))\n\n    folds = results.folds if results.folds is not None else [...]\n    fold_curves = []\n    for fold in folds:\n        points = roc_curve_for_fold(results, fold, clf_index, target)\n        hull = roc_curve_convex_hull(points)\n        c = ROCCurve(ROCPoints(*points), ROCPoints(*hull))\n        fold_curves.append(c)\n\n    curves = [fold.points for fold in fold_curves\n              if fold.is_valid]\n\n    if curves:\n        fpr, tpr, std = roc_curve_vertical_average(curves)\n\n        thresh = np.zeros_like(fpr) * np.nan\n        hull = roc_curve_convex_hull((fpr, tpr, thresh))\n        v_avg = ROCAveragedVert(\n            ROCPoints(fpr, tpr, thresh),\n            ROCPoints(*hull),\n            std\n        )\n    else:\n        # return an invalid vertical averaged ROC\n        v_avg = ROCAveragedVert(\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            np.array([])\n        )\n\n    if curves:\n        all_thresh = np.hstack([t for _, _, t in curves])\n        all_thresh = np.clip(all_thresh, 0.0 - 1e-10, 1.0 + 1e-10)\n        all_thresh = np.unique(all_thresh)[::-1]\n        thresh = all_thresh[::max(all_thresh.size // 10, 1)]\n\n        (fpr, fpr_std), (tpr, tpr_std) = \\\n            roc_curve_threshold_average(curves, thresh)\n\n        hull = roc_curve_convex_hull((fpr, tpr, thresh))\n\n        t_avg = ROCAveragedThresh(\n            ROCPoints(fpr, tpr, thresh),\n            ROCPoints(*hull),\n            tpr_std,\n            fpr_std\n        )\n    else:\n        # return an invalid threshold averaged ROC\n        t_avg = ROCAveragedThresh(\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            ROCPoints(np.array([]), np.array([]), np.array([])),\n            np.array([]),\n            np.array([])\n        )\n    return ROCData(merged_curve, fold_curves, v_avg, t_avg)\n\nROCData.from_results = staticmethod(roc_data_from_results)\n\n#: A curve item to be displayed in a plot\nPlotCurve = namedtuple(\n    \"PlotCurve\",\n    [\"curve\",        # ROCCurve source curve\n     \"curve_item\",   # pg.PlotDataItem main curve\n     \"hull_item\"     # pg.PlotDataItem curve's convex hull\n     ]\n)\n\n\ndef plot_curve(curve, pen=None, shadow_pen=None, symbol=\"+\",\n               symbol_size=3, name=None):\n    \"\"\"\n    Construct a `PlotCurve` for the given `ROCCurve`.\n\n    :param ROCCurve curve:\n        Source curve.\n\n    The other parameters are passed to pg.PlotDataItem\n\n    :rtype: PlotCurve\n    \"\"\"\n    def extend_to_origin(points):\n        \"Extend ROCPoints to include coordinate origin if not already present\"\n        if points.tpr.size and (points.tpr[0] > 0 or points.fpr[0] > 0):\n            points = ROCPoints(\n                np.r_[0, points.fpr], np.r_[0, points.tpr],\n                np.r_[points.thresholds[0] + 1, points.thresholds]\n            )\n        return points\n\n    points = extend_to_origin(curve.points)\n    item = pg.PlotCurveItem(\n        points.fpr, points.tpr, pen=pen, shadowPen=shadow_pen,\n        name=name, antialias=True\n    )\n    sp = pg.ScatterPlotItem(\n        curve.points.fpr, curve.points.tpr, symbol=symbol,\n        size=symbol_size, pen=shadow_pen,\n        name=name\n    )\n    sp.setParentItem(item)\n\n    hull = extend_to_origin(curve.hull)\n\n    hull_item = pg.PlotDataItem(\n        hull.fpr, hull.tpr, pen=pen, antialias=True\n    )\n    return PlotCurve(curve, item, hull_item)\n\nPlotCurve.from_roc_curve = staticmethod(plot_curve)\n\n#: A curve displayed in a plot with error bars\nPlotAvgCurve = namedtuple(\n    \"PlotAvgCurve\",\n    [\"curve\",         # ROCCurve\n     \"curve_item\",    # pg.PlotDataItem\n     \"hull_item\",     # pg.PlotDataItem\n     \"confint_item\",  # pg.ErrorBarItem\n     ]\n)\n\n\ndef plot_avg_curve(curve, pen=None, shadow_pen=None, symbol=\"+\",\n                   symbol_size=4, name=None):\n    \"\"\"\n    Construct a `PlotAvgCurve` for the given `curve`.\n\n    :param curve: Source curve.\n    :type curve: ROCAveragedVert or ROCAveragedThresh\n\n    The other parameters are passed to pg.PlotDataItem\n\n    :rtype: PlotAvgCurve\n    \"\"\"\n    pc = plot_curve(curve, pen=pen, shadow_pen=shadow_pen, symbol=symbol,\n                    symbol_size=symbol_size, name=name)\n\n    points = curve.points\n    if isinstance(curve, ROCAveragedVert):\n        tpr_std = curve.tpr_std\n        error_item = pg.ErrorBarItem(\n            x=points.fpr[1:-1], y=points.tpr[1:-1],\n            height=2 * tpr_std[1:-1],\n            pen=pen, beam=0.025,\n            antialias=True,\n        )\n    elif isinstance(curve, ROCAveragedThresh):\n        tpr_std, fpr_std = curve.tpr_std, curve.fpr_std\n        error_item = pg.ErrorBarItem(\n            x=points.fpr[1:-1], y=points.tpr[1:-1],\n            height=2 * tpr_std[1:-1], width=2 * fpr_std[1:-1],\n            pen=pen, beam=0.025,\n            antialias=True,\n        )\n    return PlotAvgCurve(curve, pc.curve_item, pc.hull_item, error_item)\n\nPlotAvgCurve.from_roc_curve = staticmethod(plot_avg_curve)\n\nSome = namedtuple(\"Some\", [\"val\"])\n\n\ndef once(f):\n    \"\"\"\n    Return a function that will be called only once, and it's result cached.\n    \"\"\"\n    cached = None\n\n    @wraps(f)\n    def wraped():\n        nonlocal cached\n        if cached is None:\n            cached = Some(f())\n        return cached.val\n    return wraped\n\n\nPlotCurves = namedtuple(\n    \"PlotCurves\",\n    [\"merge\",   # :: () -> PlotCurve\n     \"folds\",   # :: () -> [PlotCurve]\n     \"avg_vertical\",   # :: () -> PlotAvgCurve\n     \"avg_threshold\",  # :: () -> PlotAvgCurve\n     ]\n)\n\n\nclass InfiniteLine(pg.InfiniteLine):\n    \"\"\"pyqtgraph.InfiniteLine extended to support antialiasing.\n    \"\"\"\n    def __init__(self, pos=None, angle=90, pen=None, movable=False,\n                 bounds=None, antialias=False):\n        super().__init__(pos, angle, pen, movable, bounds)\n        self.antialias = antialias\n\n    def paint(self, p, *args):\n        if self.antialias:\n            p.setRenderHint(QPainter.Antialiasing, True)\n        super().paint(p, *args)\n\n\nclass OWROCAnalysis(widget.OWWidget):\n    name = \"ROC Analysis\"\n    description = \"Display the Receiver Operating Characteristics curve \" \\\n                  \"based on the evaluation of classifiers.\"\n    icon = \"icons/ROCAnalysis.svg\"\n    priority = 1010\n    keywords = \"roc analysis, analyse\"\n\n    class Inputs:\n        evaluation_results = Input(\"Evaluation Results\", Orange.evaluation.Results)\n\n    class Outputs:\n        calibrated_model = Output(\"Calibrated Model\", Model)\n\n    class Information(widget.OWWidget.Information):\n        no_output = Msg(\"Can't output a model: {}\")\n\n    buttons_area_orientation = None\n    settingsHandler = EvaluationResultsContextHandler()\n    target_index = settings.ContextSetting(0)\n    selected_classifiers = settings.ContextSetting([])\n\n    display_perf_line = settings.Setting(True)\n    display_def_threshold = settings.Setting(True)\n\n    fp_cost = settings.Setting(500)\n    fn_cost = settings.Setting(500)\n    target_prior = settings.Setting(50.0, schema_only=True)\n\n    #: ROC Averaging Types\n    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3\n    roc_averaging = settings.Setting(Merge)\n\n    display_convex_hull = settings.Setting(False)\n    display_convex_curve = settings.Setting(False)\n\n    graph_name = \"plot\"  # pg.GraphicsItem (pg.PlotItem)\n\n    def __init__(self):\n        super().__init__()\n\n        self.results = None\n        self.classifier_names = []\n        self.perf_line = None\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n        box = gui.vBox(self.controlArea, \"Plot\")\n        self.target_cb = gui.comboBox(\n            box, self, \"target_index\",\n            label=\"Target\", orientation=Qt.Horizontal,\n            callback=self._on_target_changed,\n            contentsLength=8, searchable=True)\n\n        gui.widgetLabel(box, \"Classifiers\")\n        line_height = 4 * QFontMetrics(self.font()).lineSpacing()\n        self.classifiers_list_box = gui.listBox(\n            box, self, \"selected_classifiers\", \"classifier_names\",\n            selectionMode=QListView.MultiSelection,\n            callback=self._on_classifiers_changed,\n            sizeHint=QSize(0, line_height))\n\n        abox = gui.vBox(self.controlArea, \"Curves\")\n        gui.comboBox(abox, self, \"roc_averaging\",\n                     items=[\"Merge Predictions from Folds\", \"Mean TP Rate\",\n                            \"Mean TP and FP at Threshold\", \"Show Individual Curves\"],\n                     callback=self._replot)\n\n        gui.checkBox(abox, self, \"display_convex_curve\",\n                     \"Show convex ROC curves\", callback=self._replot)\n        gui.checkBox(abox, self, \"display_convex_hull\",\n                     \"Show ROC convex hull\", callback=self._replot)\n\n        box = gui.vBox(self.controlArea, \"Analysis\")\n\n        gui.checkBox(box, self, \"display_def_threshold\",\n                     \"Default threshold (0.5) point\",\n                     callback=self._on_display_def_threshold_changed)\n\n        gui.checkBox(box, self, \"display_perf_line\", \"Show performance line\",\n                     callback=self._on_display_perf_line_changed)\n        grid = QGridLayout()\n        gui.indentedBox(box, orientation=grid)\n\n        sp = gui.spin(box, self, \"fp_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FP Cost:\"), 0, 0)\n        grid.addWidget(sp, 0, 1)\n\n        sp = gui.spin(box, self, \"fn_cost\", 1, 1000, 10,\n                      alignment=Qt.AlignRight,\n                      callback=self._on_display_perf_line_changed)\n        grid.addWidget(QLabel(\"FN Cost:\"))\n        grid.addWidget(sp, 1, 1)\n        self.target_prior_sp = gui.spin(box, self, \"target_prior\", 1, 99,\n                                        alignment=Qt.AlignRight,\n                                        spinType=float,\n                                        callback=self._on_target_prior_changed)\n        self.target_prior_sp.setSuffix(\" %\")\n        self.target_prior_sp.addAction(QAction(\"Auto\", sp))\n        grid.addWidget(QLabel(\"Prior probability:\"))\n        grid.addWidget(self.target_prior_sp, 2, 1)\n\n        self.plotview = GraphicsView(background=None)\n        self.plotview.setFrameStyle(QFrame.StyledPanel)\n        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)\n\n        self.plot = PlotItem(enableMenu=False)\n        self.plot.setMouseEnabled(False, False)\n        self.plot.hideButtons()\n\n        tickfont = QFont(self.font())\n        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))\n\n        axis = self.plot.getAxis(\"bottom\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"FP Rate (1-Specificity)\")\n        axis.setGrid(16)\n\n        axis = self.plot.getAxis(\"left\")\n        axis.setTickFont(tickfont)\n        axis.setLabel(\"TP Rate (Sensitivity)\")\n        axis.setGrid(16)\n\n        self.plot.showGrid(True, True, alpha=0.2)\n        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)\n\n        self.plotview.setCentralItem(self.plot)\n        self.mainArea.layout().addWidget(self.plotview)\n\n    @Inputs.evaluation_results\n    def set_results(self, results):\n        \"\"\"Set the input evaluation results.\"\"\"\n        self.closeContext()\n        self.clear()\n        self.results = check_results_adequacy(results, self.Error)\n        if self.results is not None:\n            self._initialize(self.results)\n            self.openContext(self.results.domain.class_var,\n                             self.classifier_names)\n            self._setup_plot()\n        else:\n            self.warning()\n\n    def clear(self):\n        \"\"\"Clear the widget state.\"\"\"\n        self.results = None\n        self.plot.clear()\n        self.classifier_names = []\n        self.selected_classifiers = []\n        self.target_cb.clear()\n        self.colors = []\n        self._curve_data = {}\n        self._plot_curves = {}\n        self._rocch = None\n        self._perf_line = None\n        self._tooltip_cache = None\n\n    def _initialize(self, results):\n        names = getattr(results, \"learner_names\", None)\n\n        if names is None:\n            names = [\"#{}\".format(i + 1)\n                     for i in range(len(results.predicted))]\n\n        self.colors = colorpalettes.get_default_curve_colors(len(names))\n\n        self.classifier_names = names\n        self.selected_classifiers = list(range(len(names)))\n        for i in range(len(names)):\n            listitem = self.classifiers_list_box.item(i)\n            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))\n\n        class_var = results.domain.class_var\n        self.target_cb.addItems(class_var.values)\n        self.target_index = 0\n        self._set_target_prior()\n\n    def _set_target_prior(self):\n        \"\"\"\n        This function sets the initial target class probability prior value\n        based on the input data.\n        \"\"\"\n        if self.results.data:\n            # here we can use target_index directly since values in the\n            # dropdown are sorted in same order than values in the table\n            target_values_cnt = np.count_nonzero(\n                self.results.data.Y == self.target_index)\n            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))\n            self.target_prior = np.round(target_values_cnt / count_all * 100)\n\n            # set the spin text to gray color when set automatically\n            self.target_prior_sp.setStyleSheet(\"color: gray;\")\n\n    def curve_data(self, target, clf_idx):\n        \"\"\"Return `ROCData' for the given target and classifier.\"\"\"\n        if (target, clf_idx) not in self._curve_data:\n            # pylint: disable=no-member\n            data = ROCData.from_results(self.results, clf_idx, target)\n            self._curve_data[target, clf_idx] = data\n\n        return self._curve_data[target, clf_idx]\n\n    def plot_curves(self, target, clf_idx):\n        \"\"\"Return a set of functions `plot_curves` generating plot curves.\"\"\"\n        def generate_pens(basecolor):\n            pen = QPen(basecolor, 1)\n            pen.setCosmetic(True)\n\n            shadow_pen = QPen(pen.color().lighter(160), 2.5)\n            shadow_pen.setCosmetic(True)\n            return pen, shadow_pen\n\n        data = self.curve_data(target, clf_idx)\n\n        if (target, clf_idx) not in self._plot_curves:\n            pen, shadow_pen = generate_pens(self.colors[clf_idx])\n            name = self.classifier_names[clf_idx]\n            @once\n            def merged():\n                return plot_curve(\n                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)\n            @once\n            def folds():\n                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)\n                        for fold in data.folds]\n            @once\n            def avg_vert():\n                return plot_avg_curve(data.avg_vertical, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n            @once\n            def avg_thres():\n                return plot_avg_curve(data.avg_threshold, pen=pen,\n                                      shadow_pen=shadow_pen, name=name)\n\n            self._plot_curves[target, clf_idx] = PlotCurves(\n                merge=merged, folds=folds,\n                avg_vertical=avg_vert, avg_threshold=avg_thres\n            )\n\n        return self._plot_curves[target, clf_idx]\n\n    def _setup_plot(self):\n        def merge_averaging():\n            for curve in curves:\n                graphics = curve.merge()\n                curve = graphics.curve\n                self.plot.addItem(graphics.curve_item)\n\n                if self.display_convex_curve:\n                    self.plot.addItem(graphics.hull_item)\n\n                if self.display_def_threshold and curve.is_valid:\n                    points = curve.points\n                    ind = np.argmin(np.abs(points.thresholds - 0.5))\n                    item = pg.TextItem(\n                        text=\"{:.3f}\".format(points.thresholds[ind]),\n                        color=foreground\n                    )\n                    item.setPos(points.fpr[ind], points.tpr[ind])\n                    self.plot.addItem(item)\n\n            hull_curves = [curve.merged.hull for curve in selected]\n            if hull_curves:\n                self._rocch = convex_hull(hull_curves)\n                iso_pen = QPen(foreground, 1.0)\n                iso_pen.setCosmetic(True)\n                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)\n                self.plot.addItem(self._perf_line)\n            return hull_curves\n\n        def vertical_averaging():\n            for curve in curves:\n                graphics = curve.avg_vertical()\n\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_vertical.hull for curve in selected]\n\n        def threshold_averaging():\n            for curve in curves:\n                graphics = curve.avg_threshold()\n                self.plot.addItem(graphics.curve_item)\n                self.plot.addItem(graphics.confint_item)\n            return [curve.avg_threshold.hull for curve in selected]\n\n        def no_averaging():\n            for curve in curves:\n                graphics = curve.folds()\n                for fold in graphics:\n                    self.plot.addItem(fold.curve_item)\n                    if self.display_convex_curve:\n                        self.plot.addItem(fold.hull_item)\n            return [fold.hull for curve in selected for fold in curve.folds]\n\n        averagings = {\n            OWROCAnalysis.Merge: merge_averaging,\n            OWROCAnalysis.Vertical: vertical_averaging,\n            OWROCAnalysis.Threshold: threshold_averaging,\n            OWROCAnalysis.NoAveraging: no_averaging\n        }\n        foreground = self.plotview.scene().palette().color(QPalette.Text)\n        target = self.target_index\n        selected = self.selected_classifiers\n\n        curves = [self.plot_curves(target, i) for i in selected]\n        selected = [self.curve_data(target, i) for i in selected]\n        hull_curves = averagings[self.roc_averaging]()\n\n        if self.display_convex_hull and hull_curves:\n            hull = convex_hull(hull_curves)\n            hull_color = QColor(foreground)\n            hull_color.setAlpha(100)\n            hull_pen = QPen(hull_color, 2)\n            hull_pen.setCosmetic(True)\n            hull_color.setAlpha(50)\n            item = self.plot.plot(\n                hull.fpr, hull.tpr,\n                pen=hull_pen,\n                brush=QBrush(hull_color),\n                fillLevel=0)\n            item.setZValue(-10000)\n        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)\n        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)\n        pen.setCosmetic(True)\n        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)\n\n        self._update_perf_line()\n\n        self._update_axes_ticks()\n\n        warning = \"\"\n        if not all(c.is_valid for c in hull_curves):\n            if any(c.is_valid for c in hull_curves):\n                warning = \"Some ROC curves are undefined\"\n            else:\n                warning = \"All ROC curves are undefined\"\n        self.warning(warning)\n\n    def _update_axes_ticks(self):\n        def enumticks(a):\n            a = np.unique(a)\n            if len(a) > 15:\n                return None\n            return [[(x, f\"{x:.2f}\") for x in a[::-1]]]\n\n        axis_bottom = self.plot.getAxis(\"bottom\")\n        axis_left = self.plot.getAxis(\"left\")\n\n        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \\\n                or self.roc_averaging != OWROCAnalysis.Merge:\n            axis_bottom.setTicks(None)\n            axis_left.setTicks(None)\n        else:\n            data = self.curve_data(self.target_index, self.selected_classifiers[0])\n            points = data.merged.points\n            axis_bottom.setTicks(enumticks(points.fpr))\n            axis_left.setTicks(enumticks(points.tpr))\n\n    def _on_mouse_moved(self, pos):\n        target = self.target_index\n        selected = self.selected_classifiers\n        curves = [(clf_idx, self.plot_curves(target, clf_idx))\n                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]\n        valid_thresh, valid_clf = [], []\n        pt, ave_mode = None, self.roc_averaging\n\n        for clf_idx, crv in curves:\n            if self.roc_averaging == OWROCAnalysis.Merge:\n                curve = crv.merge()\n            elif self.roc_averaging == OWROCAnalysis.Vertical:\n                curve = crv.avg_vertical()\n            elif self.roc_averaging == OWROCAnalysis.Threshold:\n                curve = crv.avg_threshold()\n            else:\n                # currently not implemented for 'Show Individual Curves'\n                return\n\n            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem\n            act_pos = sp.mapFromScene(pos)\n            pts = list(sp.pointsAt(act_pos))\n\n            if pts:\n                mouse_pt = pts[0].pos()\n                if self._tooltip_cache:\n                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache\n                    curr_thresh, curr_clf = [], []\n                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \\\n                            and cache_ave == self.roc_averaging:\n                        mask = np.equal(cache_clf, clf_idx)\n                        curr_thresh = np.compress(mask, cache_thresh).tolist()\n                        curr_clf = np.compress(mask, cache_clf).tolist()\n                    else:\n                        QToolTip.showText(QCursor.pos(), \"\")\n                        self._tooltip_cache = None\n\n                    if curr_thresh:\n                        valid_thresh.append(*curr_thresh)\n                        valid_clf.append(*curr_clf)\n                        pt = cache_pt\n                        continue\n\n                curve_pts = curve.curve.points\n                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))\n                diff = np.subtract(roc_points, mouse_pt)\n                # Find closest point on curve and save the corresponding threshold\n                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))\n\n                thresh = curve_pts.thresholds[idx_closest]\n                if not np.isnan(thresh):\n                    valid_thresh.append(thresh)\n                    valid_clf.append(clf_idx)\n                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]\n\n        if valid_thresh:\n            clf_names = self.classifier_names\n            msg = \"Thresholds:\\n\" + \"\\n\".join([\"({:s}) {:.3f}\".format(clf_names[i], thresh)\n                                               for i, thresh in zip(valid_clf, valid_thresh)])\n            QToolTip.showText(QCursor.pos(), msg)\n            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)\n\n    def _on_target_changed(self):\n        self.plot.clear()\n        self._set_target_prior()\n        self._setup_plot()\n\n    def _on_classifiers_changed(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _on_target_prior_changed(self):\n        self.target_prior_sp.setStyleSheet(\"color: black;\")\n        self._on_display_perf_line_changed()\n\n    def _on_display_perf_line_changed(self):\n        self._update_perf_line()\n\n        if self.perf_line is not None:\n            self.perf_line.setVisible(self.display_perf_line)\n\n    def _on_display_def_threshold_changed(self):\n        self._replot()\n\n    def _replot(self):\n        self.plot.clear()\n        if self.results is not None:\n            self._setup_plot()\n\n    def _update_perf_line(self):\n\n        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:\n            self._update_output(None)\n            return\n\n        ind = None\n        self._perf_line.setVisible(self.display_perf_line)\n        if self.display_perf_line:\n            m = roc_iso_performance_slope(\n                self.fp_cost, self.fn_cost, self.target_prior / 100.0)\n\n            hull = self._rocch\n            if hull.is_valid:\n                ind = roc_iso_performance_line(m, hull)\n                angle = np.arctan2(m, 1)  # in radians\n                self._perf_line.setAngle(angle * 180 / np.pi)\n                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))\n            else:\n                self._perf_line.setVisible(False)\n\n        self._update_output(None if ind is None else hull.thresholds[ind[0]])\n\n    def _update_output(self, threshold):\n        self.Information.no_output.clear()\n\n        if threshold is None:\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        problems = check_can_calibrate(self.results, self.selected_classifiers)\n        if problems:\n            self.Information.no_output(problems)\n            self.Outputs.calibrated_model.send(None)\n            return\n\n        model = ThresholdClassifier(\n            self.results.models[0][self.selected_classifiers[0]],\n            threshold)\n        self.Outputs.calibrated_model.send(model)\n\n    def onDeleteWidget(self):\n        self.clear()\n\n    def send_report(self):\n        if self.results is None:\n            return\n        items = OrderedDict()\n        items[\"Target class\"] = self.target_cb.currentText()\n        if self.display_perf_line:\n            items[\"Costs\"] = \\\n                \"FP = {}, FN = {}\".format(self.fp_cost, self.fn_cost)\n            items[\"Target probability\"] = \"{} %\".format(self.target_prior)\n        caption = report.list_legend(self.classifiers_list_box,\n                                     self.selected_classifiers)\n        self.report_items(items)\n        self.report_plot()\n        self.report_caption(caption)\n\n\ndef interp(x, xp, fp, left=None, right=None):\n    \"\"\"\n    Like numpy.interp except for handling of running sequences of\n    same values in `xp`.\n    \"\"\"\n    x = np.asanyarray(x)\n    xp = np.asanyarray(xp)\n    fp = np.asanyarray(fp)\n\n    if xp.shape != fp.shape:\n        raise ValueError(\"xp and fp must have the same shape\")\n\n    ind = np.searchsorted(xp, x, side=\"right\")\n    fx = np.zeros(len(x))\n\n    under = ind == 0\n    over = ind == len(xp)\n    between = ~under & ~over\n\n    fx[under] = left if left is not None else fp[0]\n    fx[over] = right if right is not None else fp[-1]\n\n    if right is not None:\n        # Fix points exactly on the right boundary.\n        fx[x == xp[-1]] = fp[-1]\n\n    ind = ind[between]\n\n    df = (fp[ind] - fp[ind - 1]) / (xp[ind] - xp[ind - 1])\n\n    fx[between] = df * (x[between] - xp[ind]) + fp[ind]\n\n    return fx\n\n\ndef roc_curve_for_fold(res, fold, clf_idx, target):\n    fold_actual = res.actual[fold]\n    P = np.sum(fold_actual == target)\n    N = fold_actual.size - P\n\n    if P == 0 or N == 0:\n        # Undefined TP and FP rate\n        return np.array([]), np.array([]), np.array([])\n\n    fold_probs = res.probabilities[clf_idx][fold][:, target]\n    drop_intermediate = len(fold_actual) > 20\n    fpr, tpr, thresholds = skl_metrics.roc_curve(\n        fold_actual, fold_probs, pos_label=target,\n        drop_intermediate=drop_intermediate\n    )\n\n    # skl sets the first threshold to the highest threshold in the data + 1\n    # since we deal with probabilities, we (carefully) set it to 1\n    # Unrelated comparisons, thus pylint: disable=chained-comparison\n    if len(thresholds) > 1 and thresholds[1] <= 1:\n        thresholds[0] = 1\n    return fpr, tpr, thresholds\n\n\ndef roc_curve_vertical_average(curves, samples=10):\n    if not curves:\n        raise ValueError(\"No curves\")\n    fpr_sample = np.linspace(0.0, 1.0, samples)\n    tpr_samples = []\n    for fpr, tpr, _ in curves:\n        tpr_samples.append(interp(fpr_sample, fpr, tpr, left=0, right=1))\n\n    tpr_samples = np.array(tpr_samples)\n    return fpr_sample, tpr_samples.mean(axis=0), tpr_samples.std(axis=0)\n\n\ndef roc_curve_threshold_average(curves, thresh_samples):\n    if not curves:\n        raise ValueError(\"No curves\")\n    fpr_samples, tpr_samples = [], []\n    for fpr, tpr, thresh in curves:\n        ind = np.searchsorted(thresh[::-1], thresh_samples, side=\"left\")\n        ind = ind[::-1]\n        ind = np.clip(ind, 0, len(thresh) - 1)\n        fpr_samples.append(fpr[ind])\n        tpr_samples.append(tpr[ind])\n\n    fpr_samples = np.array(fpr_samples)\n    tpr_samples = np.array(tpr_samples)\n\n    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),\n            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))\n\n\ndef roc_curve_thresh_avg_interp(curves, thresh_samples):\n    fpr_samples, tpr_samples = [], []\n    for fpr, tpr, thresh in curves:\n        thresh = thresh[::-1]\n        fpr = interp(thresh_samples, thresh, fpr[::-1], left=1.0, right=0.0)\n        tpr = interp(thresh_samples, thresh, tpr[::-1], left=1.0, right=0.0)\n        fpr_samples.append(fpr)\n        tpr_samples.append(tpr)\n\n    fpr_samples = np.array(fpr_samples)\n    tpr_samples = np.array(tpr_samples)\n\n    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),\n            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))\n\n\nRocPoint = namedtuple(\"RocPoint\", [\"fpr\", \"tpr\", \"threshold\"])\n\n\ndef roc_curve_convex_hull(curve):\n    def slope(p1, p2):\n        x1, y1, _ = p1\n        x2, y2, _ = p2\n        if x1 != x2:\n            return  (y2 - y1) / (x2 - x1)\n        else:\n            return np.inf\n\n    fpr, _, _ = curve\n\n    if len(fpr) <= 2:\n        return curve\n    points = map(RocPoint._make, zip(*curve))\n\n    hull = deque([next(points)])\n\n    for point in points:\n        while True:\n            if len(hull) < 2:\n                hull.append(point)\n                break\n            else:\n                last = hull[-1]\n                if point.fpr != last.fpr and \\\n                        slope(hull[-2], last) > slope(last, point):\n                    hull.append(point)\n                    break\n                else:\n                    hull.pop()\n\n    fpr = np.array([p.fpr for p in hull])\n    tpr = np.array([p.tpr for p in hull])\n    thres = np.array([p.threshold for p in hull])\n    return (fpr, tpr, thres)\n\n\ndef convex_hull(curves):\n    def slope(p1, p2):\n        x1, y1, *_ = p1\n        x2, y2, *_ = p2\n        if x1 != x2:\n            return (y2 - y1) / (x2 - x1)\n        else:\n            return np.inf\n\n    curves = [list(map(RocPoint._make, zip(*curve))) for curve in curves]\n\n    merged_points = reduce(operator.iadd, curves, [])\n    merged_points = sorted(merged_points)\n\n    if not merged_points:\n        return ROCPoints(np.array([]), np.array([]), np.array([]))\n\n    if len(merged_points) <= 2:\n        return ROCPoints._make(map(np.array, zip(*merged_points)))\n\n    points = iter(merged_points)\n\n    hull = deque([next(points)])\n\n    for point in points:\n        while True:\n            if len(hull) < 2:\n                hull.append(point)\n                break\n            else:\n                last = hull[-1]\n                if point[0] != last[0] and \\\n                        slope(hull[-2], last) > slope(last, point):\n                    hull.append(point)\n                    break\n                else:\n                    hull.pop()\n\n    return ROCPoints._make(map(np.array, zip(*hull)))\n\n\ndef roc_iso_performance_line(slope, hull, tol=1e-5):\n    \"\"\"\n    Return the indices where a line with `slope` touches the ROC convex hull.\n    \"\"\"\n    fpr, tpr, *_ = hull\n\n    # Compute the distance of each point to a reference iso line\n    # going through point (0, 1). The point(s) with the minimum\n    # distance are our result\n\n    # y = m * x + 1\n    # m * x - 1y + 1 = 0\n    a, b, c = slope, -1, 1\n    dist = distance_to_line(a, b, c, fpr, tpr)\n    mindist = np.min(dist)\n\n    return np.flatnonzero((dist - mindist) <= tol)\n\n\ndef distance_to_line(a, b, c, x0, y0):\n    \"\"\"\n    Return the distance to a line ax + by + c = 0\n    \"\"\"\n    assert a != 0 or b != 0\n    return np.abs(a * x0 + b * y0 + c) / np.sqrt(a ** 2 + b ** 2)\n\n\ndef roc_iso_performance_slope(fp_cost, fn_cost, p):\n    assert 0 <= p <= 1\n    if fn_cost * p == 0:\n        return np.inf\n    else:\n        return (fp_cost * (1. - p)) / (fn_cost * p)\n\n\ndef _create_results():  # pragma: no cover\n    probs1 = [0.984, 0.907, 0.881, 0.865, 0.815, 0.741, 0.735, 0.635,\n              0.582, 0.554, 0.413, 0.317, 0.287, 0.225, 0.216, 0.183]\n    probs = np.array([[[1 - x, x] for x in probs1]])\n    preds = (probs > 0.5).astype(float)\n    return Results(\n        data=Orange.data.Table(\"heart_disease\")[:16],\n        row_indices=np.arange(16),\n        actual=np.array(list(map(int, \"1100111001001000\"))),\n        probabilities=probs, predicted=preds\n    )\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    # WidgetPreview(OWROCAnalysis).run(_create_results())\n    WidgetPreview(OWROCAnalysis).run(results_for_preview())\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:** Incorrect Reset of Target Prior When Reloading Evaluation Results in ROC Analysis

**Description:**
When reloading evaluation results in the ROC Analysis widget, the target prior probability is incorrectly reset instead of retaining the user-selected value. This causes inconsistencies in the displayed ROC curves and related metrics.

**Steps to Reproduce:**
1. Send evaluation results to the widget.
2. Select the "soft" option for target prior probability.
3. Reload the same evaluation results.

**Example Code:**
```python
# Initialize widget and send initial evaluation results
widget = OWROCAnalysis()
widget.send_signal(widget.Inputs.evaluation_results, results)

# Set target prior to "soft"
simulate.combobox_activate_item(widget.controls.target_index, "soft")
print(widget.target_prior)  # Expected: 42.0

# Reload evaluation results
widget.send_signal(widget.Inputs.evaluation_results, results)
print(widget.target_prior)  # Actual: 33.0
```

**Expected Behavior:**
After reloading the evaluation results, the target prior should remain set to "soft" with a value of 42.0, maintaining consistency in ROC analysis.

**Actual Behavior:**
Reloading the evaluation results resets the target prior to an incorrect value of 33.0, disregarding the previously selected "soft" option.

[/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/evaluate/owrocanalysis.py
import operator
from functools import reduce, wraps
from collections import namedtuple, deque, OrderedDict

import numpy as np
import sklearn.metrics as skl_metrics

from AnyQt.QtWidgets import QListView, QLabel, QGridLayout, QFrame, QAction, \
    QToolTip
from AnyQt.QtGui import QColor, QPen, QBrush, QPainter, QPalette, QFont, \
    QCursor, QFontMetrics
from AnyQt.QtCore import Qt, QSize
import pyqtgraph as pg

import Orange
from Orange.base import Model
from Orange.classification import ThresholdClassifier
from Orange.evaluation.testing import Results
from Orange.widgets import widget, gui, settings
from Orange.widgets.evaluate.contexthandlers import \
    EvaluationResultsContextHandler
from Orange.widgets.evaluate.utils import check_results_adequacy, \
    check_can_calibrate
from Orange.widgets.utils import colorpalettes
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.visualize.utils.plotutils import GraphicsView, PlotItem
from Orange.widgets.widget import Input, Output, Msg
from Orange.widgets import report

from Orange.widgets.evaluate.utils import results_for_preview


#: Points on a ROC curve
ROCPoints = namedtuple(
    "ROCPoints",
    ["fpr",        # (N,) array of false positive rate coordinates (ascending)
     "tpr",        # (N,) array of true positive rate coordinates
     "thresholds"  # (N,) array of thresholds (in descending order)
     ]
)
ROCPoints.is_valid = property(lambda self: self.fpr.size > 0)

#: ROC Curve and it's convex hull
ROCCurve = namedtuple(
    "ROCCurve",
    ["points",  # ROCPoints
     "hull"     # ROCPoints of the convex hull
     ]
)
ROCCurve.is_valid = property(lambda self: self.points.is_valid)

#: A ROC Curve averaged vertically
ROCAveragedVert = namedtuple(
    "ROCAveragedVert",
    ["points",   # ROCPoints sampled by fpr
     "hull",     # ROCPoints of the convex hull
     "tpr_std",  # array standard deviation of tpr at each fpr point
     ]
)
ROCAveragedVert.is_valid = property(lambda self: self.points.is_valid)

#: A ROC Curve averaged by thresholds
ROCAveragedThresh = namedtuple(
    "ROCAveragedThresh",
    ["points",   # ROCPoints sampled by threshold
     "hull",     # ROCPoints of the convex hull
     "tpr_std",  # array standard deviations of tpr at each threshold
     "fpr_std"   # array standard deviations of fpr at each threshold
     ]
)
ROCAveragedThresh.is_valid = property(lambda self: self.points.is_valid)

#: Combined data for a ROC curve of a single algorithm
ROCData = namedtuple(
    "ROCData",
    ["merged",  # ROCCurve merged over all folds
     "folds",   # ROCCurve list, one for each fold
     "avg_vertical",   # ROCAveragedVert
     "avg_threshold",  # ROCAveragedThresh
     ]
)


def roc_data_from_results(results, clf_index, target):
    """
    Compute ROC Curve(s) from evaluation results.

    :param Orange.evaluation.Results results:
        Evaluation results.
    :param int clf_index:
        Learner index in the `results`.
    :param int target:
        Target class index (i.e. positive class).
    :rval ROCData:
        A instance holding the computed curves.
    """
    merged = roc_curve_for_fold(results, ..., clf_index, target)
    merged_curve = ROCCurve(ROCPoints(*merged),
                            ROCPoints(*roc_curve_convex_hull(merged)))

    folds = results.folds if results.folds is not None else [...]
    fold_curves = []
    for fold in folds:
        points = roc_curve_for_fold(results, fold, clf_index, target)
        hull = roc_curve_convex_hull(points)
        c = ROCCurve(ROCPoints(*points), ROCPoints(*hull))
        fold_curves.append(c)

    curves = [fold.points for fold in fold_curves
              if fold.is_valid]

    if curves:
        fpr, tpr, std = roc_curve_vertical_average(curves)

        thresh = np.zeros_like(fpr) * np.nan
        hull = roc_curve_convex_hull((fpr, tpr, thresh))
        v_avg = ROCAveragedVert(
            ROCPoints(fpr, tpr, thresh),
            ROCPoints(*hull),
            std
        )
    else:
        # return an invalid vertical averaged ROC
        v_avg = ROCAveragedVert(
            ROCPoints(np.array([]), np.array([]), np.array([])),
            ROCPoints(np.array([]), np.array([]), np.array([])),
            np.array([])
        )

    if curves:
        all_thresh = np.hstack([t for _, _, t in curves])
        all_thresh = np.clip(all_thresh, 0.0 - 1e-10, 1.0 + 1e-10)
        all_thresh = np.unique(all_thresh)[::-1]
        thresh = all_thresh[::max(all_thresh.size // 10, 1)]

        (fpr, fpr_std), (tpr, tpr_std) = \
            roc_curve_threshold_average(curves, thresh)

        hull = roc_curve_convex_hull((fpr, tpr, thresh))

        t_avg = ROCAveragedThresh(
            ROCPoints(fpr, tpr, thresh),
            ROCPoints(*hull),
            tpr_std,
            fpr_std
        )
    else:
        # return an invalid threshold averaged ROC
        t_avg = ROCAveragedThresh(
            ROCPoints(np.array([]), np.array([]), np.array([])),
            ROCPoints(np.array([]), np.array([]), np.array([])),
            np.array([]),
            np.array([])
        )
    return ROCData(merged_curve, fold_curves, v_avg, t_avg)

ROCData.from_results = staticmethod(roc_data_from_results)

#: A curve item to be displayed in a plot
PlotCurve = namedtuple(
    "PlotCurve",
    ["curve",        # ROCCurve source curve
     "curve_item",   # pg.PlotDataItem main curve
     "hull_item"     # pg.PlotDataItem curve's convex hull
     ]
)


def plot_curve(curve, pen=None, shadow_pen=None, symbol="+",
               symbol_size=3, name=None):
    """
    Construct a `PlotCurve` for the given `ROCCurve`.

    :param ROCCurve curve:
        Source curve.

    The other parameters are passed to pg.PlotDataItem

    :rtype: PlotCurve
    """
    def extend_to_origin(points):
        "Extend ROCPoints to include coordinate origin if not already present"
        if points.tpr.size and (points.tpr[0] > 0 or points.fpr[0] > 0):
            points = ROCPoints(
                np.r_[0, points.fpr], np.r_[0, points.tpr],
                np.r_[points.thresholds[0] + 1, points.thresholds]
            )
        return points

    points = extend_to_origin(curve.points)
    item = pg.PlotCurveItem(
        points.fpr, points.tpr, pen=pen, shadowPen=shadow_pen,
        name=name, antialias=True
    )
    sp = pg.ScatterPlotItem(
        curve.points.fpr, curve.points.tpr, symbol=symbol,
        size=symbol_size, pen=shadow_pen,
        name=name
    )
    sp.setParentItem(item)

    hull = extend_to_origin(curve.hull)

    hull_item = pg.PlotDataItem(
        hull.fpr, hull.tpr, pen=pen, antialias=True
    )
    return PlotCurve(curve, item, hull_item)

PlotCurve.from_roc_curve = staticmethod(plot_curve)

#: A curve displayed in a plot with error bars
PlotAvgCurve = namedtuple(
    "PlotAvgCurve",
    ["curve",         # ROCCurve
     "curve_item",    # pg.PlotDataItem
     "hull_item",     # pg.PlotDataItem
     "confint_item",  # pg.ErrorBarItem
     ]
)


def plot_avg_curve(curve, pen=None, shadow_pen=None, symbol="+",
                   symbol_size=4, name=None):
    """
    Construct a `PlotAvgCurve` for the given `curve`.

    :param curve: Source curve.
    :type curve: ROCAveragedVert or ROCAveragedThresh

    The other parameters are passed to pg.PlotDataItem

    :rtype: PlotAvgCurve
    """
    pc = plot_curve(curve, pen=pen, shadow_pen=shadow_pen, symbol=symbol,
                    symbol_size=symbol_size, name=name)

    points = curve.points
    if isinstance(curve, ROCAveragedVert):
        tpr_std = curve.tpr_std
        error_item = pg.ErrorBarItem(
            x=points.fpr[1:-1], y=points.tpr[1:-1],
            height=2 * tpr_std[1:-1],
            pen=pen, beam=0.025,
            antialias=True,
        )
    elif isinstance(curve, ROCAveragedThresh):
        tpr_std, fpr_std = curve.tpr_std, curve.fpr_std
        error_item = pg.ErrorBarItem(
            x=points.fpr[1:-1], y=points.tpr[1:-1],
            height=2 * tpr_std[1:-1], width=2 * fpr_std[1:-1],
            pen=pen, beam=0.025,
            antialias=True,
        )
    return PlotAvgCurve(curve, pc.curve_item, pc.hull_item, error_item)

PlotAvgCurve.from_roc_curve = staticmethod(plot_avg_curve)

Some = namedtuple("Some", ["val"])


def once(f):
    """
    Return a function that will be called only once, and it's result cached.
    """
    cached = None

    @wraps(f)
    def wraped():
        nonlocal cached
        if cached is None:
            cached = Some(f())
        return cached.val
    return wraped


PlotCurves = namedtuple(
    "PlotCurves",
    ["merge",   # :: () -> PlotCurve
     "folds",   # :: () -> [PlotCurve]
     "avg_vertical",   # :: () -> PlotAvgCurve
     "avg_threshold",  # :: () -> PlotAvgCurve
     ]
)


class InfiniteLine(pg.InfiniteLine):
    """pyqtgraph.InfiniteLine extended to support antialiasing.
    """
    def __init__(self, pos=None, angle=90, pen=None, movable=False,
                 bounds=None, antialias=False):
        super().__init__(pos, angle, pen, movable, bounds)
        self.antialias = antialias

    def paint(self, p, *args):
        if self.antialias:
            p.setRenderHint(QPainter.Antialiasing, True)
        super().paint(p, *args)


class OWROCAnalysis(widget.OWWidget):
    name = "ROC Analysis"
    description = "Display the Receiver Operating Characteristics curve " \
                  "based on the evaluation of classifiers."
    icon = "icons/ROCAnalysis.svg"
    priority = 1010
    keywords = "roc analysis, analyse"

    class Inputs:
        evaluation_results = Input("Evaluation Results", Orange.evaluation.Results)

    class Outputs:
        calibrated_model = Output("Calibrated Model", Model)

    class Information(widget.OWWidget.Information):
        no_output = Msg("Can't output a model: {}")

    buttons_area_orientation = None
    settingsHandler = EvaluationResultsContextHandler()
    target_index = settings.ContextSetting(0)
    selected_classifiers = settings.ContextSetting([])

    display_perf_line = settings.Setting(True)
    display_def_threshold = settings.Setting(True)

    fp_cost = settings.Setting(500)
    fn_cost = settings.Setting(500)
    target_prior = settings.Setting(50.0, schema_only=True)

    #: ROC Averaging Types
    Merge, Vertical, Threshold, NoAveraging = 0, 1, 2, 3
    roc_averaging = settings.Setting(Merge)

    display_convex_hull = settings.Setting(False)
    display_convex_curve = settings.Setting(False)

    graph_name = "plot"  # pg.GraphicsItem (pg.PlotItem)

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

        self.results = None
        self.classifier_names = []
        self.perf_line = None
        self.colors = []
        self._curve_data = {}
        self._plot_curves = {}
        self._rocch = None
        self._perf_line = None
        self._tooltip_cache = None

        box = gui.vBox(self.controlArea, "Plot")
        self.target_cb = gui.comboBox(
            box, self, "target_index",
            label="Target", orientation=Qt.Horizontal,
            callback=self._on_target_changed,
            contentsLength=8, searchable=True)

        gui.widgetLabel(box, "Classifiers")
        line_height = 4 * QFontMetrics(self.font()).lineSpacing()
        self.classifiers_list_box = gui.listBox(
            box, self, "selected_classifiers", "classifier_names",
            selectionMode=QListView.MultiSelection,
            callback=self._on_classifiers_changed,
            sizeHint=QSize(0, line_height))

        abox = gui.vBox(self.controlArea, "Curves")
        gui.comboBox(abox, self, "roc_averaging",
                     items=["Merge Predictions from Folds", "Mean TP Rate",
                            "Mean TP and FP at Threshold", "Show Individual Curves"],
                     callback=self._replot)

        gui.checkBox(abox, self, "display_convex_curve",
                     "Show convex ROC curves", callback=self._replot)
        gui.checkBox(abox, self, "display_convex_hull",
                     "Show ROC convex hull", callback=self._replot)

        box = gui.vBox(self.controlArea, "Analysis")

        gui.checkBox(box, self, "display_def_threshold",
                     "Default threshold (0.5) point",
                     callback=self._on_display_def_threshold_changed)

        gui.checkBox(box, self, "display_perf_line", "Show performance line",
                     callback=self._on_display_perf_line_changed)
        grid = QGridLayout()
        gui.indentedBox(box, orientation=grid)

        sp = gui.spin(box, self, "fp_cost", 1, 1000, 10,
                      alignment=Qt.AlignRight,
                      callback=self._on_display_perf_line_changed)
        grid.addWidget(QLabel("FP Cost:"), 0, 0)
        grid.addWidget(sp, 0, 1)

        sp = gui.spin(box, self, "fn_cost", 1, 1000, 10,
                      alignment=Qt.AlignRight,
                      callback=self._on_display_perf_line_changed)
        grid.addWidget(QLabel("FN Cost:"))
        grid.addWidget(sp, 1, 1)
        self.target_prior_sp = gui.spin(box, self, "target_prior", 1, 99,
                                        alignment=Qt.AlignRight,
                                        spinType=float,
                                        callback=self._on_target_prior_changed)
        self.target_prior_sp.setSuffix(" %")
        self.target_prior_sp.addAction(QAction("Auto", sp))
        grid.addWidget(QLabel("Prior probability:"))
        grid.addWidget(self.target_prior_sp, 2, 1)

        self.plotview = GraphicsView(background=None)
        self.plotview.setFrameStyle(QFrame.StyledPanel)
        self.plotview.scene().sigMouseMoved.connect(self._on_mouse_moved)

        self.plot = PlotItem(enableMenu=False)
        self.plot.setMouseEnabled(False, False)
        self.plot.hideButtons()

        tickfont = QFont(self.font())
        tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))

        axis = self.plot.getAxis("bottom")
        axis.setTickFont(tickfont)
        axis.setLabel("FP Rate (1-Specificity)")
        axis.setGrid(16)

        axis = self.plot.getAxis("left")
        axis.setTickFont(tickfont)
        axis.setLabel("TP Rate (Sensitivity)")
        axis.setGrid(16)

        self.plot.showGrid(True, True, alpha=0.2)
        self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)

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

    @Inputs.evaluation_results
    def set_results(self, results):
        """Set the input evaluation results."""
        self.closeContext()
        self.clear()
        self.results = check_results_adequacy(results, self.Error)
        if self.results is not None:
            self._initialize(self.results)
            self.openContext(self.results.domain.class_var,
                             self.classifier_names)
            self._setup_plot()
        else:
            self.warning()

    def clear(self):
        """Clear the widget state."""
        self.results = None
        self.plot.clear()
        self.classifier_names = []
        self.selected_classifiers = []
        self.target_cb.clear()
        self.colors = []
        self._curve_data = {}
        self._plot_curves = {}
        self._rocch = None
        self._perf_line = None
        self._tooltip_cache = None

    def _initialize(self, results):
        names = getattr(results, "learner_names", None)

        if names is None:
            names = ["#{}".format(i + 1)
                     for i in range(len(results.predicted))]

        self.colors = colorpalettes.get_default_curve_colors(len(names))

        self.classifier_names = names
        self.selected_classifiers = list(range(len(names)))
        for i in range(len(names)):
            listitem = self.classifiers_list_box.item(i)
            listitem.setIcon(colorpalettes.ColorIcon(self.colors[i]))

        class_var = results.domain.class_var
        self.target_cb.addItems(class_var.values)
        self.target_index = 0
        self._set_target_prior()

    def _set_target_prior(self):
        """
        This function sets the initial target class probability prior value
        based on the input data.
        """
        if self.results.data:
            # here we can use target_index directly since values in the
            # dropdown are sorted in same order than values in the table
            target_values_cnt = np.count_nonzero(
                self.results.data.Y == self.target_index)
            count_all = np.count_nonzero(~np.isnan(self.results.data.Y))
            self.target_prior = np.round(target_values_cnt / count_all * 100)

            # set the spin text to gray color when set automatically
            self.target_prior_sp.setStyleSheet("color: gray;")

    def curve_data(self, target, clf_idx):
        """Return `ROCData' for the given target and classifier."""
        if (target, clf_idx) not in self._curve_data:
            # pylint: disable=no-member
            data = ROCData.from_results(self.results, clf_idx, target)
            self._curve_data[target, clf_idx] = data

        return self._curve_data[target, clf_idx]

    def plot_curves(self, target, clf_idx):
        """Return a set of functions `plot_curves` generating plot curves."""
        def generate_pens(basecolor):
            pen = QPen(basecolor, 1)
            pen.setCosmetic(True)

            shadow_pen = QPen(pen.color().lighter(160), 2.5)
            shadow_pen.setCosmetic(True)
            return pen, shadow_pen

        data = self.curve_data(target, clf_idx)

        if (target, clf_idx) not in self._plot_curves:
            pen, shadow_pen = generate_pens(self.colors[clf_idx])
            name = self.classifier_names[clf_idx]
            @once
            def merged():
                return plot_curve(
                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)
            @once
            def folds():
                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)
                        for fold in data.folds]
            @once
            def avg_vert():
                return plot_avg_curve(data.avg_vertical, pen=pen,
                                      shadow_pen=shadow_pen, name=name)
            @once
            def avg_thres():
                return plot_avg_curve(data.avg_threshold, pen=pen,
                                      shadow_pen=shadow_pen, name=name)

            self._plot_curves[target, clf_idx] = PlotCurves(
                merge=merged, folds=folds,
                avg_vertical=avg_vert, avg_threshold=avg_thres
            )

        return self._plot_curves[target, clf_idx]

    def _setup_plot(self):
        def merge_averaging():
            for curve in curves:
                graphics = curve.merge()
                curve = graphics.curve
                self.plot.addItem(graphics.curve_item)

                if self.display_convex_curve:
                    self.plot.addItem(graphics.hull_item)

                if self.display_def_threshold and curve.is_valid:
                    points = curve.points
                    ind = np.argmin(np.abs(points.thresholds - 0.5))
                    item = pg.TextItem(
                        text="{:.3f}".format(points.thresholds[ind]),
                        color=foreground
                    )
                    item.setPos(points.fpr[ind], points.tpr[ind])
                    self.plot.addItem(item)

            hull_curves = [curve.merged.hull for curve in selected]
            if hull_curves:
                self._rocch = convex_hull(hull_curves)
                iso_pen = QPen(foreground, 1.0)
                iso_pen.setCosmetic(True)
                self._perf_line = InfiniteLine(pen=iso_pen, antialias=True)
                self.plot.addItem(self._perf_line)
            return hull_curves

        def vertical_averaging():
            for curve in curves:
                graphics = curve.avg_vertical()

                self.plot.addItem(graphics.curve_item)
                self.plot.addItem(graphics.confint_item)
            return [curve.avg_vertical.hull for curve in selected]

        def threshold_averaging():
            for curve in curves:
                graphics = curve.avg_threshold()
                self.plot.addItem(graphics.curve_item)
                self.plot.addItem(graphics.confint_item)
            return [curve.avg_threshold.hull for curve in selected]

        def no_averaging():
            for curve in curves:
                graphics = curve.folds()
                for fold in graphics:
                    self.plot.addItem(fold.curve_item)
                    if self.display_convex_curve:
                        self.plot.addItem(fold.hull_item)
            return [fold.hull for curve in selected for fold in curve.folds]

        averagings = {
            OWROCAnalysis.Merge: merge_averaging,
            OWROCAnalysis.Vertical: vertical_averaging,
            OWROCAnalysis.Threshold: threshold_averaging,
            OWROCAnalysis.NoAveraging: no_averaging
        }
        foreground = self.plotview.scene().palette().color(QPalette.Text)
        target = self.target_index
        selected = self.selected_classifiers

        curves = [self.plot_curves(target, i) for i in selected]
        selected = [self.curve_data(target, i) for i in selected]
        hull_curves = averagings[self.roc_averaging]()

        if self.display_convex_hull and hull_curves:
            hull = convex_hull(hull_curves)
            hull_color = QColor(foreground)
            hull_color.setAlpha(100)
            hull_pen = QPen(hull_color, 2)
            hull_pen.setCosmetic(True)
            hull_color.setAlpha(50)
            item = self.plot.plot(
                hull.fpr, hull.tpr,
                pen=hull_pen,
                brush=QBrush(hull_color),
                fillLevel=0)
            item.setZValue(-10000)
        line_color = self.palette().color(QPalette.Disabled, QPalette.Text)
        pen = QPen(QColor(*line_color.getRgb()[:3], 200), 1.0, Qt.DashLine)
        pen.setCosmetic(True)
        self.plot.plot([0, 1], [0, 1], pen=pen, antialias=True)

        self._update_perf_line()

        self._update_axes_ticks()

        warning = ""
        if not all(c.is_valid for c in hull_curves):
            if any(c.is_valid for c in hull_curves):
                warning = "Some ROC curves are undefined"
            else:
                warning = "All ROC curves are undefined"
        self.warning(warning)

    def _update_axes_ticks(self):
        def enumticks(a):
            a = np.unique(a)
            if len(a) > 15:
                return None
            return [[(x, f"{x:.2f}") for x in a[::-1]]]

        axis_bottom = self.plot.getAxis("bottom")
        axis_left = self.plot.getAxis("left")

        if not self.selected_classifiers or len(self.selected_classifiers) > 1 \
                or self.roc_averaging != OWROCAnalysis.Merge:
            axis_bottom.setTicks(None)
            axis_left.setTicks(None)
        else:
            data = self.curve_data(self.target_index, self.selected_classifiers[0])
            points = data.merged.points
            axis_bottom.setTicks(enumticks(points.fpr))
            axis_left.setTicks(enumticks(points.tpr))

    def _on_mouse_moved(self, pos):
        target = self.target_index
        selected = self.selected_classifiers
        curves = [(clf_idx, self.plot_curves(target, clf_idx))
                  for clf_idx in selected]  # type: List[Tuple[int, PlotCurves]]
        valid_thresh, valid_clf = [], []
        pt, ave_mode = None, self.roc_averaging

        for clf_idx, crv in curves:
            if self.roc_averaging == OWROCAnalysis.Merge:
                curve = crv.merge()
            elif self.roc_averaging == OWROCAnalysis.Vertical:
                curve = crv.avg_vertical()
            elif self.roc_averaging == OWROCAnalysis.Threshold:
                curve = crv.avg_threshold()
            else:
                # currently not implemented for 'Show Individual Curves'
                return

            sp = curve.curve_item.childItems()[0]  # type: pg.ScatterPlotItem
            act_pos = sp.mapFromScene(pos)
            pts = list(sp.pointsAt(act_pos))

            if pts:
                mouse_pt = pts[0].pos()
                if self._tooltip_cache:
                    cache_pt, cache_thresh, cache_clf, cache_ave = self._tooltip_cache
                    curr_thresh, curr_clf = [], []
                    if np.linalg.norm(mouse_pt - cache_pt) < 10e-6 \
                            and cache_ave == self.roc_averaging:
                        mask = np.equal(cache_clf, clf_idx)
                        curr_thresh = np.compress(mask, cache_thresh).tolist()
                        curr_clf = np.compress(mask, cache_clf).tolist()
                    else:
                        QToolTip.showText(QCursor.pos(), "")
                        self._tooltip_cache = None

                    if curr_thresh:
                        valid_thresh.append(*curr_thresh)
                        valid_clf.append(*curr_clf)
                        pt = cache_pt
                        continue

                curve_pts = curve.curve.points
                roc_points = np.column_stack((curve_pts.fpr, curve_pts.tpr))
                diff = np.subtract(roc_points, mouse_pt)
                # Find closest point on curve and save the corresponding threshold
                idx_closest = np.argmin(np.linalg.norm(diff, axis=1))

                thresh = curve_pts.thresholds[idx_closest]
                if not np.isnan(thresh):
                    valid_thresh.append(thresh)
                    valid_clf.append(clf_idx)
                    pt = [curve_pts.fpr[idx_closest], curve_pts.tpr[idx_closest]]

        if valid_thresh:
            clf_names = self.classifier_names
            msg = "Thresholds:\n" + "\n".join(["({:s}) {:.3f}".format(clf_names[i], thresh)
                                               for i, thresh in zip(valid_clf, valid_thresh)])
            QToolTip.showText(QCursor.pos(), msg)
            self._tooltip_cache = (pt, valid_thresh, valid_clf, ave_mode)

    def _on_target_changed(self):
        self.plot.clear()
        self._set_target_prior()
        self._setup_plot()

    def _on_classifiers_changed(self):
        self.plot.clear()
        if self.results is not None:
            self._setup_plot()

    def _on_target_prior_changed(self):
        self.target_prior_sp.setStyleSheet("color: black;")
        self._on_display_perf_line_changed()

    def _on_display_perf_line_changed(self):
        self._update_perf_line()

        if self.perf_line is not None:
            self.perf_line.setVisible(self.display_perf_line)

    def _on_display_def_threshold_changed(self):
        self._replot()

    def _replot(self):
        self.plot.clear()
        if self.results is not None:
            self._setup_plot()

    def _update_perf_line(self):

        if self._perf_line is None or self.roc_averaging != OWROCAnalysis.Merge:
            self._update_output(None)
            return

        ind = None
        self._perf_line.setVisible(self.display_perf_line)
        if self.display_perf_line:
            m = roc_iso_performance_slope(
                self.fp_cost, self.fn_cost, self.target_prior / 100.0)

            hull = self._rocch
            if hull.is_valid:
                ind = roc_iso_performance_line(m, hull)
                angle = np.arctan2(m, 1)  # in radians
                self._perf_line.setAngle(angle * 180 / np.pi)
                self._perf_line.setPos((hull.fpr[ind[0]], hull.tpr[ind[0]]))
            else:
                self._perf_line.setVisible(False)

        self._update_output(None if ind is None else hull.thresholds[ind[0]])

    def _update_output(self, threshold):
        self.Information.no_output.clear()

        if threshold is None:
            self.Outputs.calibrated_model.send(None)
            return

        problems = check_can_calibrate(self.results, self.selected_classifiers)
        if problems:
            self.Information.no_output(problems)
            self.Outputs.calibrated_model.send(None)
            return

        model = ThresholdClassifier(
            self.results.models[0][self.selected_classifiers[0]],
            threshold)
        self.Outputs.calibrated_model.send(model)

    def onDeleteWidget(self):
        self.clear()

    def send_report(self):
        if self.results is None:
            return
        items = OrderedDict()
        items["Target class"] = self.target_cb.currentText()
        if self.display_perf_line:
            items["Costs"] = \
                "FP = {}, FN = {}".format(self.fp_cost, self.fn_cost)
            items["Target probability"] = "{} %".format(self.target_prior)
        caption = report.list_legend(self.classifiers_list_box,
                                     self.selected_classifiers)
        self.report_items(items)
        self.report_plot()
        self.report_caption(caption)


def interp(x, xp, fp, left=None, right=None):
    """
    Like numpy.interp except for handling of running sequences of
    same values in `xp`.
    """
    x = np.asanyarray(x)
    xp = np.asanyarray(xp)
    fp = np.asanyarray(fp)

    if xp.shape != fp.shape:
        raise ValueError("xp and fp must have the same shape")

    ind = np.searchsorted(xp, x, side="right")
    fx = np.zeros(len(x))

    under = ind == 0
    over = ind == len(xp)
    between = ~under & ~over

    fx[under] = left if left is not None else fp[0]
    fx[over] = right if right is not None else fp[-1]

    if right is not None:
        # Fix points exactly on the right boundary.
        fx[x == xp[-1]] = fp[-1]

    ind = ind[between]

    df = (fp[ind] - fp[ind - 1]) / (xp[ind] - xp[ind - 1])

    fx[between] = df * (x[between] - xp[ind]) + fp[ind]

    return fx


def roc_curve_for_fold(res, fold, clf_idx, target):
    fold_actual = res.actual[fold]
    P = np.sum(fold_actual == target)
    N = fold_actual.size - P

    if P == 0 or N == 0:
        # Undefined TP and FP rate
        return np.array([]), np.array([]), np.array([])

    fold_probs = res.probabilities[clf_idx][fold][:, target]
    drop_intermediate = len(fold_actual) > 20
    fpr, tpr, thresholds = skl_metrics.roc_curve(
        fold_actual, fold_probs, pos_label=target,
        drop_intermediate=drop_intermediate
    )

    # skl sets the first threshold to the highest threshold in the data + 1
    # since we deal with probabilities, we (carefully) set it to 1
    # Unrelated comparisons, thus pylint: disable=chained-comparison
    if len(thresholds) > 1 and thresholds[1] <= 1:
        thresholds[0] = 1
    return fpr, tpr, thresholds


def roc_curve_vertical_average(curves, samples=10):
    if not curves:
        raise ValueError("No curves")
    fpr_sample = np.linspace(0.0, 1.0, samples)
    tpr_samples = []
    for fpr, tpr, _ in curves:
        tpr_samples.append(interp(fpr_sample, fpr, tpr, left=0, right=1))

    tpr_samples = np.array(tpr_samples)
    return fpr_sample, tpr_samples.mean(axis=0), tpr_samples.std(axis=0)


def roc_curve_threshold_average(curves, thresh_samples):
    if not curves:
        raise ValueError("No curves")
    fpr_samples, tpr_samples = [], []
    for fpr, tpr, thresh in curves:
        ind = np.searchsorted(thresh[::-1], thresh_samples, side="left")
        ind = ind[::-1]
        ind = np.clip(ind, 0, len(thresh) - 1)
        fpr_samples.append(fpr[ind])
        tpr_samples.append(tpr[ind])

    fpr_samples = np.array(fpr_samples)
    tpr_samples = np.array(tpr_samples)

    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),
            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))


def roc_curve_thresh_avg_interp(curves, thresh_samples):
    fpr_samples, tpr_samples = [], []
    for fpr, tpr, thresh in curves:
        thresh = thresh[::-1]
        fpr = interp(thresh_samples, thresh, fpr[::-1], left=1.0, right=0.0)
        tpr = interp(thresh_samples, thresh, tpr[::-1], left=1.0, right=0.0)
        fpr_samples.append(fpr)
        tpr_samples.append(tpr)

    fpr_samples = np.array(fpr_samples)
    tpr_samples = np.array(tpr_samples)

    return ((fpr_samples.mean(axis=0), fpr_samples.std(axis=0)),
            (tpr_samples.mean(axis=0), fpr_samples.std(axis=0)))


RocPoint = namedtuple("RocPoint", ["fpr", "tpr", "threshold"])


def roc_curve_convex_hull(curve):
    def slope(p1, p2):
        x1, y1, _ = p1
        x2, y2, _ = p2
        if x1 != x2:
            return  (y2 - y1) / (x2 - x1)
        else:
            return np.inf

    fpr, _, _ = curve

    if len(fpr) <= 2:
        return curve
    points = map(RocPoint._make, zip(*curve))

    hull = deque([next(points)])

    for point in points:
        while True:
            if len(hull) < 2:
                hull.append(point)
                break
            else:
                last = hull[-1]
                if point.fpr != last.fpr and \
                        slope(hull[-2], last) > slope(last, point):
                    hull.append(point)
                    break
                else:
                    hull.pop()

    fpr = np.array([p.fpr for p in hull])
    tpr = np.array([p.tpr for p in hull])
    thres = np.array([p.threshold for p in hull])
    return (fpr, tpr, thres)


def convex_hull(curves):
    def slope(p1, p2):
        x1, y1, *_ = p1
        x2, y2, *_ = p2
        if x1 != x2:
            return (y2 - y1) / (x2 - x1)
        else:
            return np.inf

    curves = [list(map(RocPoint._make, zip(*curve))) for curve in curves]

    merged_points = reduce(operator.iadd, curves, [])
    merged_points = sorted(merged_points)

    if not merged_points:
        return ROCPoints(np.array([]), np.array([]), np.array([]))

    if len(merged_points) <= 2:
        return ROCPoints._make(map(np.array, zip(*merged_points)))

    points = iter(merged_points)

    hull = deque([next(points)])

    for point in points:
        while True:
            if len(hull) < 2:
                hull.append(point)
                break
            else:
                last = hull[-1]
                if point[0] != last[0] and \
                        slope(hull[-2], last) > slope(last, point):
                    hull.append(point)
                    break
                else:
                    hull.pop()

    return ROCPoints._make(map(np.array, zip(*hull)))


def roc_iso_performance_line(slope, hull, tol=1e-5):
    """
    Return the indices where a line with `slope` touches the ROC convex hull.
    """
    fpr, tpr, *_ = hull

    # Compute the distance of each point to a reference iso line
    # going through point (0, 1). The point(s) with the minimum
    # distance are our result

    # y = m * x + 1
    # m * x - 1y + 1 = 0
    a, b, c = slope, -1, 1
    dist = distance_to_line(a, b, c, fpr, tpr)
    mindist = np.min(dist)

    return np.flatnonzero((dist - mindist) <= tol)


def distance_to_line(a, b, c, x0, y0):
    """
    Return the distance to a line ax + by + c = 0
    """
    assert a != 0 or b != 0
    return np.abs(a * x0 + b * y0 + c) / np.sqrt(a ** 2 + b ** 2)


def roc_iso_performance_slope(fp_cost, fn_cost, p):
    assert 0 <= p <= 1
    if fn_cost * p == 0:
        return np.inf
    else:
        return (fp_cost * (1. - p)) / (fn_cost * p)


def _create_results():  # pragma: no cover
    probs1 = [0.984, 0.907, 0.881, 0.865, 0.815, 0.741, 0.735, 0.635,
              0.582, 0.554, 0.413, 0.317, 0.287, 0.225, 0.216, 0.183]
    probs = np.array([[[1 - x, x] for x in probs1]])
    preds = (probs > 0.5).astype(float)
    return Results(
        data=Orange.data.Table("heart_disease")[:16],
        row_indices=np.arange(16),
        actual=np.array(list(map(int, "1100111001001000"))),
        probabilities=probs, predicted=preds
    )


if __name__ == "__main__":  # pragma: no cover
    # WidgetPreview(OWROCAnalysis).run(_create_results())
    WidgetPreview(OWROCAnalysis).run(results_for_preview())

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