{
    "file_diffs": [
        {
            "old_file_content": "from typing import List\nfrom xml.sax.saxutils import escape\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QSize, QLineF, pyqtSignal as Signal\nfrom AnyQt.QtGui import QPainter, QPen, QColor\nfrom AnyQt.QtWidgets import QApplication, QGraphicsLineItem, QSizePolicy\n\nimport pyqtgraph as pg\nfrom pyqtgraph.functions import mkPen\nfrom pyqtgraph.graphicsItems.ViewBox import ViewBox\n\nfrom orangewidget.utils.listview import ListViewSearch\nfrom orangewidget.utils.visual_settings_dlg import VisualSettingsDialog\n\nfrom Orange.data import Table, DiscreteVariable\nfrom Orange.data.sql.table import SqlTable\nfrom Orange.statistics.util import countnans, nanmean, nanmin, nanmax, nanstd\nfrom Orange.widgets import gui, report\nfrom Orange.widgets.settings import (\n    Setting, ContextSetting, DomainContextHandler\n)\nfrom Orange.widgets.utils.annotated_data import (\n    create_annotated_table, ANNOTATED_DATA_SIGNAL_NAME\n)\nfrom Orange.widgets.utils.itemmodels import DomainModel\nfrom Orange.widgets.utils.plot import OWPlotGUI, SELECT, PANNING, ZOOMING\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.visualize.owdistributions import LegendItem\nfrom Orange.widgets.visualize.utils.customizableplot import Updater, \\\n    CommonParameterSetter\nfrom Orange.widgets.visualize.utils.plotutils import AxisItem\nfrom Orange.widgets.widget import OWWidget, Input, Output, Msg\n\n\ndef ccw(a, b, c):\n    \"\"\"\n    Checks whether three points are listed in a counterclockwise order.\n    \"\"\"\n    ax, ay = (a[:, 0], a[:, 1]) if a.ndim == 2 else (a[0], a[1])\n    bx, by = (b[:, 0], b[:, 1]) if b.ndim == 2 else (b[0], b[1])\n    cx, cy = (c[:, 0], c[:, 1]) if c.ndim == 2 else (c[0], c[1])\n    return (cy - ay) * (bx - ax) > (by - ay) * (cx - ax)\n\n\ndef intersects(a, b, c, d):\n    \"\"\"\n    Checks whether line segment a (given points a and b) intersects with line\n    segment b (given points c and d).\n    \"\"\"\n    return np.logical_and(ccw(a, c, d) != ccw(b, c, d),\n                          ccw(a, b, c) != ccw(a, b, d))\n\n\ndef line_intersects_profiles(p1, p2, table):\n    \"\"\"\n    Checks if a line intersects any line segments.\n\n    Parameters\n    ----------\n    p1, p2 : ndarray\n        Endpoints of the line, given x coordinate as p_[0]\n        and y coordinate as p_[1].\n    table : ndarray\n        An array of shape m x n x p; where m is number of connected points\n        for a individual profile (i. e. number of features), n is number\n        of instances, p is number of coordinates (x and y).\n\n    Returns\n    -------\n    result : ndarray\n        Array of bools with shape of number of instances in the table.\n    \"\"\"\n    res = np.zeros(len(table[0]), dtype=bool)\n    for i in range(len(table) - 1):\n        res = np.logical_or(res, intersects(p1, p2, table[i], table[i + 1]))\n    return res\n\n\nclass LinePlotStyle:\n    DEFAULT_COLOR = QColor(Qt.darkGray)\n    SELECTION_LINE_COLOR = QColor(Qt.black)\n    SELECTION_LINE_WIDTH = 2\n\n    UNSELECTED_LINE_WIDTH = 1\n    UNSELECTED_LINE_ALPHA = 100\n    UNSELECTED_LINE_ALPHA_SEL = 50  # unselected lines, when selection exists\n\n    SELECTED_LINE_WIDTH = 3\n    SELECTED_LINE_ALPHA = 170\n\n    RANGE_ALPHA = 25\n    SELECTED_RANGE_ALPHA = 50\n\n    MEAN_WIDTH = 6\n    MEAN_DARK_FACTOR = 110\n\n\nclass BottomAxisItem(AxisItem):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self._ticks = {}\n\n    def set_ticks(self, ticks):\n        self._ticks = dict(enumerate(ticks, 1)) if ticks else {}\n        if not ticks:\n            self.setTicks(None)\n\n    def tickStrings(self, values, scale, _):\n        return [self._ticks.get(v * scale, \"\") for v in values]\n\n\nclass LinePlotViewBox(ViewBox):\n    selection_changed = Signal(np.ndarray)\n\n    def __init__(self):\n        super().__init__(enableMenu=False)\n        self._profile_items = None\n        self._can_select = True\n        self._graph_state = SELECT\n\n        self.setMouseMode(self.PanMode)\n\n        pen = mkPen(LinePlotStyle.SELECTION_LINE_COLOR,\n                    width=LinePlotStyle.SELECTION_LINE_WIDTH)\n        self.selection_line = QGraphicsLineItem()\n        self.selection_line.setPen(pen)\n        self.selection_line.setZValue(1e9)\n        self.addItem(self.selection_line, ignoreBounds=True)\n\n    def update_selection_line(self, button_down_pos, current_pos):\n        p1 = self.childGroup.mapFromParent(button_down_pos)\n        p2 = self.childGroup.mapFromParent(current_pos)\n        self.selection_line.setLine(QLineF(p1, p2))\n        self.selection_line.resetTransform()\n        self.selection_line.show()\n\n    def set_graph_state(self, state):\n        self._graph_state = state\n\n    def enable_selection(self, enable):\n        self._can_select = enable\n\n    def get_selected(self, p1, p2):\n        if self._profile_items is None:\n            return np.array(False)\n        return line_intersects_profiles(np.array([p1.x(), p1.y()]),\n                                        np.array([p2.x(), p2.y()]),\n                                        self._profile_items)\n\n    def add_profiles(self, y):\n        if sp.issparse(y):\n            y = y.todense()\n        self._profile_items = np.array(\n            [np.vstack((np.full((1, y.shape[0]), i + 1), y[:, i].flatten())).T\n             for i in range(y.shape[1])])\n\n    def remove_profiles(self):\n        self._profile_items = None\n\n    def mouseDragEvent(self, ev, axis=None):\n        if self._graph_state == SELECT and axis is None and self._can_select:\n            ev.accept()\n            if ev.button() == Qt.LeftButton:\n                self.update_selection_line(ev.buttonDownPos(), ev.pos())\n                if ev.isFinish():\n                    self.selection_line.hide()\n                    p1 = self.childGroup.mapFromParent(\n                        ev.buttonDownPos(ev.button()))\n                    p2 = self.childGroup.mapFromParent(ev.pos())\n                    self.selection_changed.emit(self.get_selected(p1, p2))\n        elif self._graph_state == ZOOMING or self._graph_state == PANNING:\n            ev.ignore()\n            super().mouseDragEvent(ev, axis=axis)\n        else:\n            ev.ignore()\n\n    def mouseClickEvent(self, ev):\n        if ev.button() == Qt.RightButton:\n            self.autoRange()\n            self.enableAutoRange()\n        else:\n            ev.accept()\n            self.selection_changed.emit(np.array(False))\n\n    def reset(self):\n        self._profile_items = None\n        self._can_select = True\n        self._graph_state = SELECT\n\n\nclass ParameterSetter(CommonParameterSetter):\n    MEAN_LABEL = \"Mean\"\n    LINE_LABEL = \"Lines\"\n    SEL_LINE_LABEL = \"Selected lines\"\n    RANGE_LABEL = \"Range\"\n    SEL_RANGE_LABEL = \"Selected range\"\n\n    def __init__(self, master):\n        super().__init__()\n        self.master = master\n\n    def update_setters(self):\n        self.mean_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.MEAN_WIDTH,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n        }\n        self.line_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.UNSELECTED_LINE_WIDTH,\n            Updater.ALPHA_LABEL: LinePlotStyle.UNSELECTED_LINE_ALPHA,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n            Updater.ANTIALIAS_LABEL: True,\n        }\n        self.sel_line_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.SELECTED_LINE_WIDTH,\n            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_LINE_ALPHA,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n            Updater.ANTIALIAS_LABEL: False,\n        }\n        self.range_settings = {\n            Updater.ALPHA_LABEL: LinePlotStyle.RANGE_ALPHA,\n        }\n        self.sel_range_settings = {\n            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_RANGE_ALPHA,\n        }\n\n        self.initial_settings = {\n            self.LABELS_BOX: {\n                self.FONT_FAMILY_LABEL: self.FONT_FAMILY_SETTING,\n                self.TITLE_LABEL: self.FONT_SETTING,\n                self.AXIS_TITLE_LABEL: self.FONT_SETTING,\n                self.AXIS_TICKS_LABEL: self.FONT_SETTING,\n                self.LEGEND_LABEL: self.FONT_SETTING,\n            },\n            self.ANNOT_BOX: {\n                self.TITLE_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n                self.X_AXIS_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n                self.Y_AXIS_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n            },\n            self.PLOT_BOX: {\n                self.MEAN_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15), LinePlotStyle.MEAN_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                },\n                self.LINE_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15),\n                                          LinePlotStyle.UNSELECTED_LINE_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.UNSELECTED_LINE_ALPHA),\n                    Updater.ANTIALIAS_LABEL: (None, True),\n                },\n                self.SEL_LINE_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15),\n                                          LinePlotStyle.SELECTED_LINE_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.SELECTED_LINE_ALPHA),\n                    Updater.ANTIALIAS_LABEL: (None, False),\n                },\n                self.RANGE_LABEL: {\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.RANGE_ALPHA),\n                },\n                self.SEL_RANGE_LABEL: {\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.SELECTED_RANGE_ALPHA),\n                },\n            }\n        }\n\n        def update_mean(**settings):\n            self.mean_settings.update(**settings)\n            Updater.update_lines(self.mean_lines_items, **self.mean_settings)\n\n        def update_lines(**settings):\n            self.line_settings.update(**settings)\n            Updater.update_lines(self.lines_items, **self.line_settings)\n\n        def update_sel_lines(**settings):\n            self.sel_line_settings.update(**settings)\n            Updater.update_lines(self.sel_lines_items, **self.sel_line_settings)\n\n        def _update_brush(items, **settings):\n            for item in items:\n                brush = item.brush()\n                color = brush.color()\n                color.setAlpha(settings[Updater.ALPHA_LABEL])\n                brush.setColor(color)\n                item.setBrush(brush)\n\n        def update_range(**settings):\n            self.range_settings.update(**settings)\n            _update_brush(self.range_items, **settings)\n\n        def update_sel_range(**settings):\n            self.sel_range_settings.update(**settings)\n            _update_brush(self.sel_range_items, **settings)\n\n        self._setters[self.PLOT_BOX] = {\n            self.MEAN_LABEL: update_mean,\n            self.LINE_LABEL: update_lines,\n            self.SEL_LINE_LABEL: update_sel_lines,\n            self.RANGE_LABEL: update_range,\n            self.SEL_RANGE_LABEL: update_sel_range,\n        }\n\n    @property\n    def title_item(self):\n        return self.master.getPlotItem().titleLabel\n\n    @property\n    def axis_items(self):\n        return [value[\"item\"] for value in self.master.getPlotItem().axes.values()]\n\n    @property\n    def legend_items(self):\n        return self.master.legend.items\n\n    @property\n    def mean_lines_items(self):\n        return [group.mean for group in self.master.groups]\n\n    @property\n    def lines_items(self):\n        return [group.profiles for group in self.master.groups]\n\n    @property\n    def sel_lines_items(self):\n        return [group.sel_profiles for group in self.master.groups] + \\\n               [group.sub_profiles for group in self.master.groups]\n\n    @property\n    def range_items(self):\n        return [group.range for group in self.master.groups]\n\n    @property\n    def sel_range_items(self):\n        return [group.sel_range for group in self.master.groups]\n\n    @property\n    def getAxis(self):\n        return self.master.getAxis\n\n# Customizable plot widget\nclass LinePlotGraph(pg.PlotWidget):\n    def __init__(self, parent):\n        self.groups: List[ProfileGroup] = []\n        self.bottom_axis = BottomAxisItem(orientation=\"bottom\")\n        self.bottom_axis.setLabel(\"\")\n        left_axis = AxisItem(orientation=\"left\")\n        left_axis.setLabel(\"\")\n        super().__init__(parent, viewBox=LinePlotViewBox(),\n                         background=\"w\", enableMenu=False,\n                         axisItems={\"bottom\": self.bottom_axis,\n                                    \"left\": left_axis})\n        self.view_box = self.getViewBox()\n        self.selection = set()\n        self.legend = self._create_legend(((1, 0), (1, 0)))\n        self.getPlotItem().buttonsHidden = True\n        self.setRenderHint(QPainter.Antialiasing, True)\n\n        self.parameter_setter = ParameterSetter(self)\n\n    def _create_legend(self, anchor):\n        legend = LegendItem()\n        legend.setParentItem(self.view_box)\n        legend.restoreAnchor(anchor)\n        legend.hide()\n        return legend\n\n    def update_legend(self, variable):\n        self.legend.clear()\n        self.legend.hide()\n        if variable and variable.is_discrete:\n            for name, color in zip(variable.values, variable.colors):\n                c = QColor(*color)\n                dots = pg.ScatterPlotItem(pen=c, brush=c, size=10, shape=\"s\")\n                self.legend.addItem(dots, escape(name))\n            self.legend.show()\n        Updater.update_legend_font(self.parameter_setter.legend_items,\n                                   **self.parameter_setter.legend_settings)\n\n    def select(self, indices):\n        keys = QApplication.keyboardModifiers()\n        indices = set(indices)\n        if keys & Qt.ControlModifier:\n            self.selection ^= indices\n        elif keys & Qt.AltModifier:\n            self.selection -= indices\n        elif keys & Qt.ShiftModifier:\n            self.selection |= indices\n        else:\n            self.selection = indices\n\n    def reset(self):\n        self.selection = set()\n        self.view_box.reset()\n        self.clear()\n        self.getAxis('bottom').set_ticks(None)\n        self.legend.hide()\n        self.groups = []\n\n    def select_button_clicked(self):\n        self.view_box.set_graph_state(SELECT)\n        self.view_box.setMouseMode(self.view_box.RectMode)\n\n    def pan_button_clicked(self):\n        self.view_box.set_graph_state(PANNING)\n        self.view_box.setMouseMode(self.view_box.PanMode)\n\n    def zoom_button_clicked(self):\n        self.view_box.set_graph_state(ZOOMING)\n        self.view_box.setMouseMode(self.view_box.RectMode)\n\n    def reset_button_clicked(self):\n        self.view_box.autoRange()\n        self.view_box.enableAutoRange()\n\n\nclass ProfileGroup:\n    def __init__(self, data, indices, color, graph):\n        self.x_data = np.arange(1, data.X.shape[1] + 1)\n        self.y_data = data.X\n        self.indices = indices\n        self.ids = data.ids\n        self.color = color\n        self.graph = graph\n\n        self.profiles_added = False\n        self.sub_profiles_added = False\n        self.range_added = False\n        self.mean_added = False\n        self.error_bar_added = False\n\n        self.graph_items = []\n        self.__mean = nanmean(self.y_data, axis=0)\n        self.__create_curves()\n\n    def __create_curves(self):\n        self.profiles = self._get_profiles_curve()\n        self.sub_profiles = self._get_sel_profiles_curve()\n        self.sel_profiles = self._get_sel_profiles_curve()\n        self.range = self._get_range_curve()\n        self.sel_range = self._get_sel_range_curve()\n        self.mean = self._get_mean_curve()\n        self.error_bar = self._get_error_bar()\n        self.graph_items = [\n            self.mean, self.range, self.sel_range, self.profiles,\n            self.sub_profiles, self.sel_profiles, self.error_bar\n        ]\n\n    def _get_profiles_curve(self):\n        x, y, con = self.__get_disconnected_curve_data(self.y_data)\n        pen = self.make_pen(self.color)\n        curve = pg.PlotCurveItem(x=x, y=y, connect=con, pen=pen)\n        Updater.update_lines([curve], **self.graph.parameter_setter.line_settings)\n        return curve\n\n    def _get_sel_profiles_curve(self):\n        curve = pg.PlotCurveItem(x=None, y=None, pen=self.make_pen(self.color))\n        Updater.update_lines([curve], **self.graph.parameter_setter.sel_line_settings)\n        return curve\n\n    def _get_range_curve(self):\n        color = QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.range_settings[Updater.ALPHA_LABEL])\n        bottom, top = nanmin(self.y_data, axis=0), nanmax(self.y_data, axis=0)\n        return pg.FillBetweenItem(\n            pg.PlotDataItem(x=self.x_data, y=bottom),\n            pg.PlotDataItem(x=self.x_data, y=top), brush=color\n        )\n\n    def _get_sel_range_curve(self):\n        color = QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.sel_range_settings[Updater.ALPHA_LABEL])\n        curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)\n        return pg.FillBetweenItem(curve1, curve2, brush=color)\n\n    def _get_mean_curve(self):\n        pen = self.make_pen(self.color.darker(LinePlotStyle.MEAN_DARK_FACTOR))\n        curve = pg.PlotCurveItem(x=self.x_data, y=self.__mean, pen=pen)\n        Updater.update_lines([curve], **self.graph.parameter_setter.mean_settings)\n        return curve\n\n    def _get_error_bar(self):\n        std = nanstd(self.y_data, axis=0)\n        return pg.ErrorBarItem(x=self.x_data, y=self.__mean,\n                               bottom=std, top=std, beam=0.01)\n\n    def remove_items(self):\n        for item in self.graph_items:\n            self.graph.removeItem(item)\n        self.graph_items = []\n\n    def set_visible_profiles(self, show_profiles=True, show_range=True, **_):\n        if not self.profiles_added and show_profiles:\n            self.profiles_added = True\n            self.graph.addItem(self.profiles)\n            self.graph.addItem(self.sel_profiles)\n        if not self.sub_profiles_added and (show_profiles or show_range):\n            self.sub_profiles_added = True\n            self.graph.addItem(self.sub_profiles)\n        self.profiles.setVisible(show_profiles)\n        self.sel_profiles.setVisible(show_profiles)\n        self.sub_profiles.setVisible(show_profiles or show_range)\n\n    def set_visible_range(self, show_profiles=True, show_range=True, **_):\n        if not self.range_added and show_range:\n            self.range_added = True\n            self.graph.addItem(self.range)\n            self.graph.addItem(self.sel_range)\n        if not self.sub_profiles_added and (show_profiles or show_range):\n            self.sub_profiles_added = True\n            self.graph.addItem(self.sub_profiles)\n        self.range.setVisible(show_range)\n        self.sel_range.setVisible(show_range)\n        self.sub_profiles.setVisible(show_profiles or show_range)\n\n    def set_visible_mean(self, show_mean=True, **_):\n        if not self.mean_added and show_mean:\n            self.mean_added = True\n            self.graph.addItem(self.mean)\n        self.mean.setVisible(show_mean)\n\n    def set_visible_error(self, show_error=True, **_):\n        if not self.error_bar_added and show_error:\n            self.error_bar_added = True\n            self.graph.addItem(self.error_bar)\n        self.error_bar.setVisible(show_error)\n\n    def update_profiles_color(self, selection):\n        color = QColor(self.color)\n        alpha = self.graph.parameter_setter.line_settings[Updater.ALPHA_LABEL] \\\n            if not selection else LinePlotStyle.UNSELECTED_LINE_ALPHA_SEL\n        color.setAlpha(alpha)\n        pen = self.profiles.opts[\"pen\"]\n        pen.setColor(color)\n        self.profiles.setPen(pen)\n\n    def update_sel_profiles(self, y_data):\n        x, y, connect = self.__get_disconnected_curve_data(y_data) \\\n            if y_data is not None else (None, None, None)\n        self.sel_profiles.setData(x=x, y=y, connect=connect)\n\n    def update_sel_profiles_color(self, subset):\n        color = QColor(Qt.black) if subset else QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.sel_line_settings[Updater.ALPHA_LABEL])\n        pen = self.sel_profiles.opts[\"pen\"]\n        pen.setColor(color)\n        self.sel_profiles.setPen(pen)\n\n    def update_sub_profiles(self, y_data):\n        x, y, connect = self.__get_disconnected_curve_data(y_data) \\\n            if y_data is not None else (None, None, None)\n        self.sub_profiles.setData(x=x, y=y, connect=connect)\n\n    def update_sel_range(self, y_data):\n        if y_data is None:\n            curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)\n        else:\n            curve1 = pg.PlotDataItem(x=self.x_data, y=nanmin(y_data, axis=0))\n            curve2 = pg.PlotDataItem(x=self.x_data, y=nanmax(y_data, axis=0))\n        self.sel_range.setCurves(curve1, curve2)\n\n    @staticmethod\n    def __get_disconnected_curve_data(y_data):\n        m, n = y_data.shape\n        x = np.arange(m * n) % n + 1\n        y = y_data.A.flatten() if sp.issparse(y_data) else y_data.flatten()\n        connect = np.ones_like(y, bool)\n        connect[n - 1:: n] = False\n        return x, y, connect\n\n    @staticmethod\n    def make_pen(color, width=1):\n        pen = QPen(color, width)\n        pen.setCosmetic(True)\n        return pen\n\n\nMAX_FEATURES = 200\nSEL_MAX_INSTANCES = 10000\n\n\nclass OWLinePlot(OWWidget):\n    name = \"Line Plot\"\n    description = \"Visualization of data profiles (e.g., time series).\"\n    icon = \"icons/LinePlot.svg\"\n    priority = 180\n\n    buttons_area_orientation = Qt.Vertical\n    enable_selection = Signal(bool)\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        data_subset = Input(\"Data Subset\", Table)\n\n    class Outputs:\n        selected_data = Output(\"Selected Data\", Table, default=True)\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    settingsHandler = DomainContextHandler()\n    group_var = ContextSetting(None)\n    show_profiles = Setting(False)\n    show_range = Setting(True)\n    show_mean = Setting(True)\n    show_error = Setting(False)\n    auto_commit = Setting(True)\n    selection = Setting(None, schema_only=True)\n    visual_settings = Setting({}, schema_only=True)\n\n    graph_name = \"graph.plotItem\"\n\n    class Error(OWWidget.Error):\n        not_enough_attrs = Msg(\"Need at least one numeric feature.\")\n        no_valid_data = Msg(\"No plot due to no valid data.\")\n\n    class Warning(OWWidget.Warning):\n        no_display_option = Msg(\"No display option is selected.\")\n\n    class Information(OWWidget.Information):\n        hidden_instances = Msg(\"Instances with unknown values are not shown.\")\n        too_many_features = Msg(\"Data has too many features. Only first {}\"\n                                \" are shown.\".format(MAX_FEATURES))\n\n    def __init__(self, parent=None):\n        super().__init__(parent)\n        self.__groups = []\n        self.data = None\n        self.valid_data = None\n        self.subset_data = None\n        self.subset_indices = None\n        self.__pending_selection = self.selection\n        self.graph_variables = []\n        self.graph = None\n        self.group_vars = None\n        self.group_view = None\n        self.setup_gui()\n\n        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)\n        self.graph.view_box.selection_changed.connect(self.selection_changed)\n        self.enable_selection.connect(self.graph.view_box.enable_selection)\n\n    def setup_gui(self):\n        self._add_graph()\n        self._add_controls()\n\n    def _add_graph(self):\n        box = gui.vBox(self.mainArea, True, margin=0)\n        self.graph = LinePlotGraph(self)\n        box.layout().addWidget(self.graph)\n\n    def _add_controls(self):\n        displaybox = gui.widgetBox(self.controlArea, \"Display\")\n        gui.checkBox(displaybox, self, \"show_profiles\", \"Lines\",\n                     callback=self.__show_profiles_changed,\n                     tooltip=\"Plot lines\")\n        gui.checkBox(displaybox, self, \"show_range\", \"Range\",\n                     callback=self.__show_range_changed,\n                     tooltip=\"Plot range between 10th and 90th percentile\")\n        gui.checkBox(displaybox, self, \"show_mean\", \"Mean\",\n                     callback=self.__show_mean_changed,\n                     tooltip=\"Plot mean curve\")\n        gui.checkBox(displaybox, self, \"show_error\", \"Error bars\",\n                     callback=self.__show_error_changed,\n                     tooltip=\"Show standard deviation\")\n\n        self.group_vars = DomainModel(\n            placeholder=\"None\", separators=False, valid_types=DiscreteVariable)\n        self.group_view = gui.listView(\n            self.controlArea, self, \"group_var\", box=\"Group by\",\n            model=self.group_vars, callback=self.__group_var_changed,\n            sizeHint=QSize(30, 100), viewType=ListViewSearch,\n            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)\n        )\n        self.group_view.setEnabled(False)\n\n        plot_gui = OWPlotGUI(self)\n        plot_gui.box_zoom_select(self.buttonsArea)\n        gui.auto_send(self.buttonsArea, self, \"auto_commit\")\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n    def __show_profiles_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"profiles\")\n\n    def __show_range_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"range\")\n\n    def __show_mean_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"mean\")\n\n    def __show_error_changed(self):\n        self._update_visibility(\"error\")\n\n    def __group_var_changed(self):\n        if self.data is None or not self.graph_variables:\n            return\n        self.plot_groups()\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self._update_sub_profiles()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        self._set_input_summary()\n        self.clear()\n        self.check_data()\n        self.check_display_options()\n\n        if self.data is not None:\n            self.group_vars.set_domain(self.data.domain)\n            self.group_view.setEnabled(len(self.group_vars) > 1)\n            self.group_var = self.data.domain.class_var \\\n                if self.data.domain.has_discrete_class else None\n\n        self.openContext(data)\n        self.setup_plot()\n        self.unconditional_commit()\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        self.clear_messages()\n        if self.data is not None:\n            self.graph_variables = [var for var in self.data.domain.attributes\n                                    if var.is_continuous]\n            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)\n            if len(self.graph_variables) < 1:\n                error(self.Error.not_enough_attrs)\n            elif not np.sum(self.valid_data):\n                error(self.Error.no_valid_data)\n            else:\n                if not np.all(self.valid_data):\n                    self.Information.hidden_instances()\n                if len(self.graph_variables) > MAX_FEATURES:\n                    self.Information.too_many_features()\n                    self.graph_variables = self.graph_variables[:MAX_FEATURES]\n\n    def check_display_options(self):\n        self.Warning.no_display_option.clear()\n        if self.data is not None:\n            if not (self.show_profiles or self.show_range or self.show_mean):\n                self.Warning.no_display_option()\n            enable = (self.show_profiles or self.show_range) and \\\n                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES\n            self.enable_selection.emit(enable)\n\n    def _set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    @Inputs.data_subset\n    @check_sql_input\n    def set_subset_data(self, subset):\n        self.subset_data = subset\n\n    def handleNewSignals(self):\n        self.set_subset_ids()\n        if self.data is not None:\n            self._update_profiles_color()\n            self._update_sel_profiles_color()\n            self._update_sub_profiles()\n\n    def set_subset_ids(self):\n        sub_ids = {e.id for e in self.subset_data} \\\n            if self.subset_data is not None else {}\n        self.subset_indices = None\n        if self.data is not None and sub_ids:\n            self.subset_indices = [x.id for x in self.data[self.valid_data]\n                                   if x.id in sub_ids]\n\n    def setup_plot(self):\n        if self.data is None:\n            return\n\n        ticks = [a.name for a in self.graph_variables]\n        self.graph.getAxis(\"bottom\").set_ticks(ticks)\n        self.plot_groups()\n        self.apply_selection()\n        self.graph.view_box.enableAutoRange()\n        self.graph.view_box.updateAutoRange()\n\n    def plot_groups(self):\n        self._remove_groups()\n        data = self.data[self.valid_data, self.graph_variables]\n        if self.group_var is None:\n            self._plot_group(data, np.where(self.valid_data)[0])\n        else:\n            class_col_data, _ = self.data.get_column_view(self.group_var)\n            for index in range(len(self.group_var.values)):\n                mask = np.logical_and(class_col_data == index, self.valid_data)\n                indices = np.flatnonzero(mask)\n                if not len(indices):\n                    continue\n                group_data = self.data[indices, self.graph_variables]\n                self._plot_group(group_data, indices, index)\n        self.graph.update_legend(self.group_var)\n        self.graph.groups = self.__groups\n        self.graph.view_box.add_profiles(data.X)\n\n    def _remove_groups(self):\n        for group in self.__groups:\n            group.remove_items()\n        self.graph.view_box.remove_profiles()\n        self.graph.groups = []\n        self.__groups = []\n\n    def _plot_group(self, data, indices, index=None):\n        color = self.__get_group_color(index)\n        group = ProfileGroup(data, indices, color, self.graph)\n        kwargs = self.__get_visibility_flags()\n        group.set_visible_error(**kwargs)\n        group.set_visible_mean(**kwargs)\n        group.set_visible_range(**kwargs)\n        group.set_visible_profiles(**kwargs)\n        self.__groups.append(group)\n\n    def __get_group_color(self, index):\n        if self.group_var is not None:\n            return QColor(*self.group_var.colors[index])\n        return QColor(LinePlotStyle.DEFAULT_COLOR)\n\n    def __get_visibility_flags(self):\n        return {\"show_profiles\": self.show_profiles,\n                \"show_range\": self.show_range,\n                \"show_mean\": self.show_mean,\n                \"show_error\": self.show_error}\n\n    def _update_profiles_color(self):\n        # color alpha depends on subset and selection; with selection or\n        # subset profiles color has more opacity\n        if not self.show_profiles:\n            return\n        for group in self.__groups:\n            has_sel = bool(self.subset_indices) or bool(self.selection)\n            group.update_profiles_color(has_sel)\n\n    def _update_sel_profiles_and_range(self):\n        # mark selected instances and selected range\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i in group.indices if self.__in(i, self.selection)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            if self.show_profiles:\n                group.update_sel_profiles(table)\n            if self.show_range:\n                group.update_sel_range(table)\n\n    def _update_sel_profiles_color(self):\n        # color depends on subset; when subset is present,\n        # selected profiles are black\n        if not self.selection or not self.show_profiles:\n            return\n        for group in self.__groups:\n            group.update_sel_profiles_color(bool(self.subset_indices))\n\n    def _update_sub_profiles(self):\n        # mark subset instances\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i, _id in zip(group.indices, group.ids)\n                    if self.__in(_id, self.subset_indices)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            group.update_sub_profiles(table)\n\n    def _update_visibility(self, obj_name):\n        if not len(self.__groups):\n            return\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        kwargs = self.__get_visibility_flags()\n        for group in self.__groups:\n            getattr(group, \"set_visible_{}\".format(obj_name))(**kwargs)\n        self.graph.view_box.updateAutoRange()\n\n    def apply_selection(self):\n        if self.data is not None and self.__pending_selection is not None:\n            sel = [i for i in self.__pending_selection if i < len(self.data)]\n            mask = np.zeros(len(self.data), dtype=bool)\n            mask[sel] = True\n            mask = mask[self.valid_data]\n            self.selection_changed(mask)\n            self.__pending_selection = None\n\n    def selection_changed(self, mask):\n        if self.data is None:\n            return\n        # need indices for self.data: mask refers to self.data[self.valid_data]\n        indices = np.arange(len(self.data))[self.valid_data][mask]\n        self.graph.select(indices)\n        old = self.selection\n        self.selection = None if self.data and isinstance(self.data, SqlTable)\\\n            else list(self.graph.selection)\n        if not old and self.selection or old and not self.selection:\n            self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self.commit()\n\n    def commit(self):\n        selected = self.data[self.selection] \\\n            if self.data is not None and bool(self.selection) else None\n        annotated = create_annotated_table(self.data, self.selection)\n\n        summary = len(selected) if selected else self.info.NoOutput\n        details = format_summary_details(selected) if selected else \"\"\n        self.info.set_output_summary(summary, details)\n        self.Outputs.selected_data.send(selected)\n        self.Outputs.annotated_data.send(annotated)\n\n    def send_report(self):\n        if self.data is None:\n            return\n\n        caption = report.render_items_vert(((\"Group by\", self.group_var),))\n        self.report_plot()\n        if caption:\n            self.report_caption(caption)\n\n    def sizeHint(self):\n        return QSize(1132, 708)\n\n    def clear(self):\n        self.valid_data = None\n        self.selection = None\n        self.__groups = []\n        self.graph_variables = []\n        self.graph.reset()\n        self.group_vars.set_domain(None)\n        self.group_view.setEnabled(False)\n\n    @staticmethod\n    def __in(obj, collection):\n        return collection is not None and obj in collection\n\n    def set_visual_settings(self, key, value):\n        self.graph.parameter_setter.set_parameter(key, value)\n        self.visual_settings[key] = value\n\n\nif __name__ == \"__main__\":\n    brown = Table(\"brown-selected\")\n    WidgetPreview(OWLinePlot).run(set_data=brown, set_subset_data=brown[:30])\n",
            "new_file_content": "from typing import List\nfrom xml.sax.saxutils import escape\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QSize, QLineF, pyqtSignal as Signal\nfrom AnyQt.QtGui import QPainter, QPen, QColor\nfrom AnyQt.QtWidgets import QApplication, QGraphicsLineItem, QSizePolicy\n\nimport pyqtgraph as pg\nfrom pyqtgraph.functions import mkPen\nfrom pyqtgraph.graphicsItems.ViewBox import ViewBox\n\nfrom orangewidget.utils.listview import ListViewSearch\nfrom orangewidget.utils.visual_settings_dlg import VisualSettingsDialog\n\nfrom Orange.data import Table, DiscreteVariable\nfrom Orange.data.sql.table import SqlTable\nfrom Orange.statistics.util import countnans, nanmean, nanmin, nanmax, nanstd\nfrom Orange.widgets import gui, report\nfrom Orange.widgets.settings import (\n    Setting, ContextSetting, DomainContextHandler\n)\nfrom Orange.widgets.utils.annotated_data import (\n    create_annotated_table, ANNOTATED_DATA_SIGNAL_NAME\n)\nfrom Orange.widgets.utils.itemmodels import DomainModel\nfrom Orange.widgets.utils.plot import OWPlotGUI, SELECT, PANNING, ZOOMING\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.visualize.owdistributions import LegendItem\nfrom Orange.widgets.visualize.utils.customizableplot import Updater, \\\n    CommonParameterSetter\nfrom Orange.widgets.visualize.utils.plotutils import AxisItem\nfrom Orange.widgets.widget import OWWidget, Input, Output, Msg\n\n\ndef ccw(a, b, c):\n    \"\"\"\n    Checks whether three points are listed in a counterclockwise order.\n    \"\"\"\n    ax, ay = (a[:, 0], a[:, 1]) if a.ndim == 2 else (a[0], a[1])\n    bx, by = (b[:, 0], b[:, 1]) if b.ndim == 2 else (b[0], b[1])\n    cx, cy = (c[:, 0], c[:, 1]) if c.ndim == 2 else (c[0], c[1])\n    return (cy - ay) * (bx - ax) > (by - ay) * (cx - ax)\n\n\ndef intersects(a, b, c, d):\n    \"\"\"\n    Checks whether line segment a (given points a and b) intersects with line\n    segment b (given points c and d).\n    \"\"\"\n    return np.logical_and(ccw(a, c, d) != ccw(b, c, d),\n                          ccw(a, b, c) != ccw(a, b, d))\n\n\ndef line_intersects_profiles(p1, p2, table):\n    \"\"\"\n    Checks if a line intersects any line segments.\n\n    Parameters\n    ----------\n    p1, p2 : ndarray\n        Endpoints of the line, given x coordinate as p_[0]\n        and y coordinate as p_[1].\n    table : ndarray\n        An array of shape m x n x p; where m is number of connected points\n        for a individual profile (i. e. number of features), n is number\n        of instances, p is number of coordinates (x and y).\n\n    Returns\n    -------\n    result : ndarray\n        Array of bools with shape of number of instances in the table.\n    \"\"\"\n    res = np.zeros(len(table[0]), dtype=bool)\n    for i in range(len(table) - 1):\n        res = np.logical_or(res, intersects(p1, p2, table[i], table[i + 1]))\n    return res\n\n\nclass LinePlotStyle:\n    DEFAULT_COLOR = QColor(Qt.darkGray)\n    SELECTION_LINE_COLOR = QColor(Qt.black)\n    SELECTION_LINE_WIDTH = 2\n\n    UNSELECTED_LINE_WIDTH = 1\n    UNSELECTED_LINE_ALPHA = 100\n    UNSELECTED_LINE_ALPHA_SEL = 50  # unselected lines, when selection exists\n\n    SELECTED_LINE_WIDTH = 3\n    SELECTED_LINE_ALPHA = 170\n\n    RANGE_ALPHA = 25\n    SELECTED_RANGE_ALPHA = 50\n\n    MEAN_WIDTH = 6\n    MEAN_DARK_FACTOR = 110\n\n\nclass BottomAxisItem(AxisItem):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self._ticks = {}\n\n    def set_ticks(self, ticks):\n        self._ticks = dict(enumerate(ticks, 1)) if ticks else {}\n        if not ticks:\n            self.setTicks(None)\n\n    def tickStrings(self, values, scale, _):\n        return [self._ticks.get(v * scale, \"\") for v in values]\n\n\nclass LinePlotViewBox(ViewBox):\n    selection_changed = Signal(np.ndarray)\n\n    def __init__(self):\n        super().__init__(enableMenu=False)\n        self._profile_items = None\n        self._can_select = True\n        self._graph_state = SELECT\n\n        self.setMouseMode(self.PanMode)\n\n        pen = mkPen(LinePlotStyle.SELECTION_LINE_COLOR,\n                    width=LinePlotStyle.SELECTION_LINE_WIDTH)\n        self.selection_line = QGraphicsLineItem()\n        self.selection_line.setPen(pen)\n        self.selection_line.setZValue(1e9)\n        self.addItem(self.selection_line, ignoreBounds=True)\n\n    def update_selection_line(self, button_down_pos, current_pos):\n        p1 = self.childGroup.mapFromParent(button_down_pos)\n        p2 = self.childGroup.mapFromParent(current_pos)\n        self.selection_line.setLine(QLineF(p1, p2))\n        self.selection_line.resetTransform()\n        self.selection_line.show()\n\n    def set_graph_state(self, state):\n        self._graph_state = state\n\n    def enable_selection(self, enable):\n        self._can_select = enable\n\n    def get_selected(self, p1, p2):\n        if self._profile_items is None:\n            return np.array(False)\n        return line_intersects_profiles(np.array([p1.x(), p1.y()]),\n                                        np.array([p2.x(), p2.y()]),\n                                        self._profile_items)\n\n    def add_profiles(self, y):\n        if sp.issparse(y):\n            y = y.todense()\n        self._profile_items = np.array(\n            [np.vstack((np.full((1, y.shape[0]), i + 1), y[:, i].flatten())).T\n             for i in range(y.shape[1])])\n\n    def remove_profiles(self):\n        self._profile_items = None\n\n    def mouseDragEvent(self, ev, axis=None):\n        if self._graph_state == SELECT and axis is None and self._can_select:\n            ev.accept()\n            if ev.button() == Qt.LeftButton:\n                self.update_selection_line(ev.buttonDownPos(), ev.pos())\n                if ev.isFinish():\n                    self.selection_line.hide()\n                    p1 = self.childGroup.mapFromParent(\n                        ev.buttonDownPos(ev.button()))\n                    p2 = self.childGroup.mapFromParent(ev.pos())\n                    self.selection_changed.emit(self.get_selected(p1, p2))\n        elif self._graph_state == ZOOMING or self._graph_state == PANNING:\n            ev.ignore()\n            super().mouseDragEvent(ev, axis=axis)\n        else:\n            ev.ignore()\n\n    def mouseClickEvent(self, ev):\n        if ev.button() == Qt.RightButton:\n            self.autoRange()\n            self.enableAutoRange()\n        else:\n            ev.accept()\n            self.selection_changed.emit(np.array(False))\n\n    def reset(self):\n        self._profile_items = None\n        self._can_select = True\n        self._graph_state = SELECT\n\n\nclass ParameterSetter(CommonParameterSetter):\n    MEAN_LABEL = \"Mean\"\n    LINE_LABEL = \"Lines\"\n    SEL_LINE_LABEL = \"Selected lines\"\n    RANGE_LABEL = \"Range\"\n    SEL_RANGE_LABEL = \"Selected range\"\n\n    def __init__(self, master):\n        super().__init__()\n        self.master = master\n\n    def update_setters(self):\n        self.mean_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.MEAN_WIDTH,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n        }\n        self.line_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.UNSELECTED_LINE_WIDTH,\n            Updater.ALPHA_LABEL: LinePlotStyle.UNSELECTED_LINE_ALPHA,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n            Updater.ANTIALIAS_LABEL: True,\n        }\n        self.sel_line_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.SELECTED_LINE_WIDTH,\n            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_LINE_ALPHA,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n            Updater.ANTIALIAS_LABEL: False,\n        }\n        self.range_settings = {\n            Updater.ALPHA_LABEL: LinePlotStyle.RANGE_ALPHA,\n        }\n        self.sel_range_settings = {\n            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_RANGE_ALPHA,\n        }\n\n        self.initial_settings = {\n            self.LABELS_BOX: {\n                self.FONT_FAMILY_LABEL: self.FONT_FAMILY_SETTING,\n                self.TITLE_LABEL: self.FONT_SETTING,\n                self.AXIS_TITLE_LABEL: self.FONT_SETTING,\n                self.AXIS_TICKS_LABEL: self.FONT_SETTING,\n                self.LEGEND_LABEL: self.FONT_SETTING,\n            },\n            self.ANNOT_BOX: {\n                self.TITLE_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n                self.X_AXIS_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n                self.Y_AXIS_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n            },\n            self.PLOT_BOX: {\n                self.MEAN_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15), LinePlotStyle.MEAN_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                },\n                self.LINE_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15),\n                                          LinePlotStyle.UNSELECTED_LINE_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.UNSELECTED_LINE_ALPHA),\n                    Updater.ANTIALIAS_LABEL: (None, True),\n                },\n                self.SEL_LINE_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15),\n                                          LinePlotStyle.SELECTED_LINE_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.SELECTED_LINE_ALPHA),\n                    Updater.ANTIALIAS_LABEL: (None, False),\n                },\n                self.RANGE_LABEL: {\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.RANGE_ALPHA),\n                },\n                self.SEL_RANGE_LABEL: {\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.SELECTED_RANGE_ALPHA),\n                },\n            }\n        }\n\n        def update_mean(**settings):\n            self.mean_settings.update(**settings)\n            Updater.update_lines(self.mean_lines_items, **self.mean_settings)\n\n        def update_lines(**settings):\n            self.line_settings.update(**settings)\n            Updater.update_lines(self.lines_items, **self.line_settings)\n\n        def update_sel_lines(**settings):\n            self.sel_line_settings.update(**settings)\n            Updater.update_lines(self.sel_lines_items, **self.sel_line_settings)\n\n        def _update_brush(items, **settings):\n            for item in items:\n                brush = item.brush()\n                color = brush.color()\n                color.setAlpha(settings[Updater.ALPHA_LABEL])\n                brush.setColor(color)\n                item.setBrush(brush)\n\n        def update_range(**settings):\n            self.range_settings.update(**settings)\n            _update_brush(self.range_items, **settings)\n\n        def update_sel_range(**settings):\n            self.sel_range_settings.update(**settings)\n            _update_brush(self.sel_range_items, **settings)\n\n        self._setters[self.PLOT_BOX] = {\n            self.MEAN_LABEL: update_mean,\n            self.LINE_LABEL: update_lines,\n            self.SEL_LINE_LABEL: update_sel_lines,\n            self.RANGE_LABEL: update_range,\n            self.SEL_RANGE_LABEL: update_sel_range,\n        }\n\n    @property\n    def title_item(self):\n        return self.master.getPlotItem().titleLabel\n\n    @property\n    def axis_items(self):\n        return [value[\"item\"] for value in self.master.getPlotItem().axes.values()]\n\n    @property\n    def legend_items(self):\n        return self.master.legend.items\n\n    @property\n    def mean_lines_items(self):\n        return [group.mean for group in self.master.groups]\n\n    @property\n    def lines_items(self):\n        return [group.profiles for group in self.master.groups]\n\n    @property\n    def sel_lines_items(self):\n        return [group.sel_profiles for group in self.master.groups] + \\\n               [group.sub_profiles for group in self.master.groups]\n\n    @property\n    def range_items(self):\n        return [group.range for group in self.master.groups]\n\n    @property\n    def sel_range_items(self):\n        return [group.sel_range for group in self.master.groups]\n\n    @property\n    def getAxis(self):\n        return self.master.getAxis\n\n# Customizable plot widget\nclass LinePlotGraph(pg.PlotWidget):\n    def __init__(self, parent):\n        self.groups: List[ProfileGroup] = []\n        self.bottom_axis = BottomAxisItem(orientation=\"bottom\")\n        self.bottom_axis.setLabel(\"\")\n        left_axis = AxisItem(orientation=\"left\")\n        left_axis.setLabel(\"\")\n        super().__init__(parent, viewBox=LinePlotViewBox(),\n                         background=\"w\", enableMenu=False,\n                         axisItems={\"bottom\": self.bottom_axis,\n                                    \"left\": left_axis})\n        self.view_box = self.getViewBox()\n        self.selection = set()\n        self.legend = self._create_legend(((1, 0), (1, 0)))\n        self.getPlotItem().buttonsHidden = True\n        self.setRenderHint(QPainter.Antialiasing, True)\n\n        self.parameter_setter = ParameterSetter(self)\n\n    def _create_legend(self, anchor):\n        legend = LegendItem()\n        legend.setParentItem(self.view_box)\n        legend.restoreAnchor(anchor)\n        legend.hide()\n        return legend\n\n    def update_legend(self, variable):\n        self.legend.clear()\n        self.legend.hide()\n        if variable and variable.is_discrete:\n            for name, color in zip(variable.values, variable.colors):\n                c = QColor(*color)\n                dots = pg.ScatterPlotItem(pen=c, brush=c, size=10, shape=\"s\")\n                self.legend.addItem(dots, escape(name))\n            self.legend.show()\n        Updater.update_legend_font(self.parameter_setter.legend_items,\n                                   **self.parameter_setter.legend_settings)\n\n    def select(self, indices):\n        keys = QApplication.keyboardModifiers()\n        indices = set(indices)\n        if keys & Qt.ControlModifier:\n            self.selection ^= indices\n        elif keys & Qt.AltModifier:\n            self.selection -= indices\n        elif keys & Qt.ShiftModifier:\n            self.selection |= indices\n        else:\n            self.selection = indices\n\n    def reset(self):\n        self.selection = set()\n        self.view_box.reset()\n        self.clear()\n        self.getAxis('bottom').set_ticks(None)\n        self.legend.hide()\n        self.groups = []\n\n    def select_button_clicked(self):\n        self.view_box.set_graph_state(SELECT)\n        self.view_box.setMouseMode(self.view_box.RectMode)\n\n    def pan_button_clicked(self):\n        self.view_box.set_graph_state(PANNING)\n        self.view_box.setMouseMode(self.view_box.PanMode)\n\n    def zoom_button_clicked(self):\n        self.view_box.set_graph_state(ZOOMING)\n        self.view_box.setMouseMode(self.view_box.RectMode)\n\n    def reset_button_clicked(self):\n        self.view_box.autoRange()\n        self.view_box.enableAutoRange()\n\n\nclass ProfileGroup:\n    def __init__(self, data, indices, color, graph):\n        self.x_data = np.arange(1, data.X.shape[1] + 1)\n        self.y_data = data.X\n        self.indices = indices\n        self.ids = data.ids\n        self.color = color\n        self.graph = graph\n\n        self.profiles_added = False\n        self.sub_profiles_added = False\n        self.range_added = False\n        self.mean_added = False\n        self.error_bar_added = False\n\n        self.graph_items = []\n        self.__mean = nanmean(self.y_data, axis=0)\n        self.__create_curves()\n\n    def __create_curves(self):\n        self.profiles = self._get_profiles_curve()\n        self.sub_profiles = self._get_sel_profiles_curve()\n        self.sel_profiles = self._get_sel_profiles_curve()\n        self.range = self._get_range_curve()\n        self.sel_range = self._get_sel_range_curve()\n        self.mean = self._get_mean_curve()\n        self.error_bar = self._get_error_bar()\n        self.graph_items = [\n            self.mean, self.range, self.sel_range, self.profiles,\n            self.sub_profiles, self.sel_profiles, self.error_bar\n        ]\n\n    def _get_profiles_curve(self):\n        x, y, con = self.__get_disconnected_curve_data(self.y_data)\n        pen = self.make_pen(self.color)\n        curve = pg.PlotCurveItem(x=x, y=y, connect=con, pen=pen)\n        Updater.update_lines([curve], **self.graph.parameter_setter.line_settings)\n        return curve\n\n    def _get_sel_profiles_curve(self):\n        curve = pg.PlotCurveItem(x=None, y=None, pen=self.make_pen(self.color))\n        Updater.update_lines([curve], **self.graph.parameter_setter.sel_line_settings)\n        return curve\n\n    def _get_range_curve(self):\n        color = QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.range_settings[Updater.ALPHA_LABEL])\n        bottom, top = nanmin(self.y_data, axis=0), nanmax(self.y_data, axis=0)\n        return pg.FillBetweenItem(\n            pg.PlotDataItem(x=self.x_data, y=bottom),\n            pg.PlotDataItem(x=self.x_data, y=top), brush=color\n        )\n\n    def _get_sel_range_curve(self):\n        color = QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.sel_range_settings[Updater.ALPHA_LABEL])\n        curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)\n        return pg.FillBetweenItem(curve1, curve2, brush=color)\n\n    def _get_mean_curve(self):\n        pen = self.make_pen(self.color.darker(LinePlotStyle.MEAN_DARK_FACTOR))\n        curve = pg.PlotCurveItem(x=self.x_data, y=self.__mean, pen=pen)\n        Updater.update_lines([curve], **self.graph.parameter_setter.mean_settings)\n        return curve\n\n    def _get_error_bar(self):\n        std = nanstd(self.y_data, axis=0)\n        return pg.ErrorBarItem(x=self.x_data, y=self.__mean,\n                               bottom=std, top=std, beam=0.01)\n\n    def remove_items(self):\n        for item in self.graph_items:\n            self.graph.removeItem(item)\n        self.graph_items = []\n\n    def set_visible_profiles(self, show_profiles=True, show_range=True, **_):\n        if not self.profiles_added and show_profiles:\n            self.profiles_added = True\n            self.graph.addItem(self.profiles)\n            self.graph.addItem(self.sel_profiles)\n        if not self.sub_profiles_added and (show_profiles or show_range):\n            self.sub_profiles_added = True\n            self.graph.addItem(self.sub_profiles)\n        self.profiles.setVisible(show_profiles)\n        self.sel_profiles.setVisible(show_profiles)\n        self.sub_profiles.setVisible(show_profiles or show_range)\n\n    def set_visible_range(self, show_profiles=True, show_range=True, **_):\n        if not self.range_added and show_range:\n            self.range_added = True\n            self.graph.addItem(self.range)\n            self.graph.addItem(self.sel_range)\n        if not self.sub_profiles_added and (show_profiles or show_range):\n            self.sub_profiles_added = True\n            self.graph.addItem(self.sub_profiles)\n        self.range.setVisible(show_range)\n        self.sel_range.setVisible(show_range)\n        self.sub_profiles.setVisible(show_profiles or show_range)\n\n    def set_visible_mean(self, show_mean=True, **_):\n        if not self.mean_added and show_mean:\n            self.mean_added = True\n            self.graph.addItem(self.mean)\n        self.mean.setVisible(show_mean)\n\n    def set_visible_error(self, show_error=True, **_):\n        if not self.error_bar_added and show_error:\n            self.error_bar_added = True\n            self.graph.addItem(self.error_bar)\n        self.error_bar.setVisible(show_error)\n\n    def update_profiles_color(self, selection):\n        color = QColor(self.color)\n        alpha = self.graph.parameter_setter.line_settings[Updater.ALPHA_LABEL] \\\n            if not selection else LinePlotStyle.UNSELECTED_LINE_ALPHA_SEL\n        color.setAlpha(alpha)\n        pen = self.profiles.opts[\"pen\"]\n        pen.setColor(color)\n        self.profiles.setPen(pen)\n\n    def update_sel_profiles(self, y_data):\n        x, y, connect = self.__get_disconnected_curve_data(y_data) \\\n            if y_data is not None else (None, None, None)\n        self.sel_profiles.setData(x=x, y=y, connect=connect)\n\n    def update_sel_profiles_color(self, subset):\n        color = QColor(Qt.black) if subset else QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.sel_line_settings[Updater.ALPHA_LABEL])\n        pen = self.sel_profiles.opts[\"pen\"]\n        pen.setColor(color)\n        self.sel_profiles.setPen(pen)\n\n    def update_sub_profiles(self, y_data):\n        x, y, connect = self.__get_disconnected_curve_data(y_data) \\\n            if y_data is not None else (None, None, None)\n        self.sub_profiles.setData(x=x, y=y, connect=connect)\n\n    def update_sel_range(self, y_data):\n        if y_data is None:\n            curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)\n        else:\n            curve1 = pg.PlotDataItem(x=self.x_data, y=nanmin(y_data, axis=0))\n            curve2 = pg.PlotDataItem(x=self.x_data, y=nanmax(y_data, axis=0))\n        self.sel_range.setCurves(curve1, curve2)\n\n    @staticmethod\n    def __get_disconnected_curve_data(y_data):\n        m, n = y_data.shape\n        x = np.arange(m * n) % n + 1\n        y = y_data.A.flatten() if sp.issparse(y_data) else y_data.flatten()\n        connect = np.ones_like(y, bool)\n        connect[n - 1:: n] = False\n        return x, y, connect\n\n    @staticmethod\n    def make_pen(color, width=1):\n        pen = QPen(color, width)\n        pen.setCosmetic(True)\n        return pen\n\n\nMAX_FEATURES = 200\nSEL_MAX_INSTANCES = 10000\n\n\nclass OWLinePlot(OWWidget):\n    name = \"Line Plot\"\n    description = \"Visualization of data profiles (e.g., time series).\"\n    icon = \"icons/LinePlot.svg\"\n    priority = 180\n\n    buttons_area_orientation = Qt.Vertical\n    enable_selection = Signal(bool)\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        data_subset = Input(\"Data Subset\", Table)\n\n    class Outputs:\n        selected_data = Output(\"Selected Data\", Table, default=True)\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    settingsHandler = DomainContextHandler()\n    group_var = ContextSetting(None)\n    show_profiles = Setting(False)\n    show_range = Setting(True)\n    show_mean = Setting(True)\n    show_error = Setting(False)\n    auto_commit = Setting(True)\n    selection = Setting(None, schema_only=True)\n    visual_settings = Setting({}, schema_only=True)\n\n    graph_name = \"graph.plotItem\"\n\n    class Error(OWWidget.Error):\n        not_enough_attrs = Msg(\"Need at least one numeric feature.\")\n        no_valid_data = Msg(\"No plot due to no valid data.\")\n\n    class Warning(OWWidget.Warning):\n        no_display_option = Msg(\"No display option is selected.\")\n\n    class Information(OWWidget.Information):\n        hidden_instances = Msg(\"Instances with unknown values are not shown.\")\n        too_many_features = Msg(\"Data has too many features. Only first {}\"\n                                \" are shown.\".format(MAX_FEATURES))\n\n    def __init__(self, parent=None):\n        super().__init__(parent)\n        self.__groups = []\n        self.data = None\n        self.valid_data = None\n        self.subset_data = None\n        self.subset_indices = None\n        self.__pending_selection = self.selection\n        self.graph_variables = []\n        self.graph = None\n        self.group_vars = None\n        self.group_view = None\n        self.setup_gui()\n\n        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)\n        self.graph.view_box.selection_changed.connect(self.selection_changed)\n        self.enable_selection.connect(self.graph.view_box.enable_selection)\n\n    def setup_gui(self):\n        self._add_graph()\n        self._add_controls()\n\n    def _add_graph(self):\n        box = gui.vBox(self.mainArea, True, margin=0)\n        self.graph = LinePlotGraph(self)\n        box.layout().addWidget(self.graph)\n\n    def _add_controls(self):\n        displaybox = gui.widgetBox(self.controlArea, \"Display\")\n        gui.checkBox(displaybox, self, \"show_profiles\", \"Lines\",\n                     callback=self.__show_profiles_changed,\n                     tooltip=\"Plot lines\")\n        gui.checkBox(displaybox, self, \"show_range\", \"Range\",\n                     callback=self.__show_range_changed,\n                     tooltip=\"Plot range between 10th and 90th percentile\")\n        gui.checkBox(displaybox, self, \"show_mean\", \"Mean\",\n                     callback=self.__show_mean_changed,\n                     tooltip=\"Plot mean curve\")\n        gui.checkBox(displaybox, self, \"show_error\", \"Error bars\",\n                     callback=self.__show_error_changed,\n                     tooltip=\"Show standard deviation\")\n\n        self.group_vars = DomainModel(\n            placeholder=\"None\", separators=False, valid_types=DiscreteVariable)\n        self.group_view = gui.listView(\n            self.controlArea, self, \"group_var\", box=\"Group by\",\n            model=self.group_vars, callback=self.__group_var_changed,\n            sizeHint=QSize(30, 100), viewType=ListViewSearch,\n            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)\n        )\n        self.group_view.setEnabled(False)\n\n        plot_gui = OWPlotGUI(self)\n        plot_gui.box_zoom_select(self.buttonsArea)\n        gui.auto_send(self.buttonsArea, self, \"auto_commit\")\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n    def __show_profiles_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"profiles\")\n\n    def __show_range_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"range\")\n\n    def __show_mean_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"mean\")\n\n    def __show_error_changed(self):\n        self._update_visibility(\"error\")\n\n    def __group_var_changed(self):\n        if self.data is None or not self.graph_variables:\n            return\n        self.plot_groups()\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self._update_sub_profiles()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        self._set_input_summary()\n        self.clear()\n        self.check_data()\n        self.check_display_options()\n\n        if self.data is not None:\n            self.group_vars.set_domain(self.data.domain)\n            self.group_view.setEnabled(len(self.group_vars) > 1)\n            self.group_var = self.data.domain.class_var \\\n                if self.data.domain.has_discrete_class else None\n\n        self.openContext(data)\n        self.setup_plot()\n        self.unconditional_commit()\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        self.clear_messages()\n        if self.data is not None:\n            self.graph_variables = [var for var in self.data.domain.attributes\n                                    if var.is_continuous]\n            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)\n            if len(self.graph_variables) < 1:\n                error(self.Error.not_enough_attrs)\n            elif not np.sum(self.valid_data):\n                error(self.Error.no_valid_data)\n            else:\n                if not np.all(self.valid_data):\n                    self.Information.hidden_instances()\n                if len(self.graph_variables) > MAX_FEATURES:\n                    self.Information.too_many_features()\n                    self.graph_variables = self.graph_variables[:MAX_FEATURES]\n\n    def check_display_options(self):\n        self.Warning.no_display_option.clear()\n        if self.data is not None:\n            if not (self.show_profiles or self.show_range or self.show_mean):\n                self.Warning.no_display_option()\n            enable = (self.show_profiles or self.show_range) and \\\n                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES\n            self.enable_selection.emit(enable)\n\n    def _set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    @Inputs.data_subset\n    @check_sql_input\n    def set_subset_data(self, subset):\n        self.subset_data = subset\n\n    def handleNewSignals(self):\n        self.set_subset_ids()\n        if self.data is not None:\n            self._update_profiles_color()\n            self._update_sel_profiles_color()\n            self._update_sub_profiles()\n\n    def set_subset_ids(self):\n        sub_ids = {e.id for e in self.subset_data} \\\n            if self.subset_data is not None else {}\n        self.subset_indices = None\n        if self.data is not None and sub_ids:\n            self.subset_indices = [x.id for x in self.data[self.valid_data]\n                                   if x.id in sub_ids]\n\n    def setup_plot(self):\n        if self.data is None:\n            return\n\n        ticks = [a.name for a in self.graph_variables]\n        self.graph.getAxis(\"bottom\").set_ticks(ticks)\n        self.plot_groups()\n        self.apply_selection()\n        self.graph.view_box.enableAutoRange()\n        self.graph.view_box.updateAutoRange()\n\n    def plot_groups(self):\n        self._remove_groups()\n        data = self.data[self.valid_data][:, self.graph_variables]\n        if self.group_var is None:\n            self._plot_group(data, np.where(self.valid_data)[0])\n        else:\n            class_col_data, _ = self.data.get_column_view(self.group_var)\n            for index in range(len(self.group_var.values)):\n                mask = np.logical_and(class_col_data == index, self.valid_data)\n                indices = np.flatnonzero(mask)\n                if not len(indices):\n                    continue\n                group_data = self.data[indices, self.graph_variables]\n                self._plot_group(group_data, indices, index)\n        self.graph.update_legend(self.group_var)\n        self.graph.groups = self.__groups\n        self.graph.view_box.add_profiles(data.X)\n\n    def _remove_groups(self):\n        for group in self.__groups:\n            group.remove_items()\n        self.graph.view_box.remove_profiles()\n        self.graph.groups = []\n        self.__groups = []\n\n    def _plot_group(self, data, indices, index=None):\n        color = self.__get_group_color(index)\n        group = ProfileGroup(data, indices, color, self.graph)\n        kwargs = self.__get_visibility_flags()\n        group.set_visible_error(**kwargs)\n        group.set_visible_mean(**kwargs)\n        group.set_visible_range(**kwargs)\n        group.set_visible_profiles(**kwargs)\n        self.__groups.append(group)\n\n    def __get_group_color(self, index):\n        if self.group_var is not None:\n            return QColor(*self.group_var.colors[index])\n        return QColor(LinePlotStyle.DEFAULT_COLOR)\n\n    def __get_visibility_flags(self):\n        return {\"show_profiles\": self.show_profiles,\n                \"show_range\": self.show_range,\n                \"show_mean\": self.show_mean,\n                \"show_error\": self.show_error}\n\n    def _update_profiles_color(self):\n        # color alpha depends on subset and selection; with selection or\n        # subset profiles color has more opacity\n        if not self.show_profiles:\n            return\n        for group in self.__groups:\n            has_sel = bool(self.subset_indices) or bool(self.selection)\n            group.update_profiles_color(has_sel)\n\n    def _update_sel_profiles_and_range(self):\n        # mark selected instances and selected range\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i in group.indices if self.__in(i, self.selection)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            if self.show_profiles:\n                group.update_sel_profiles(table)\n            if self.show_range:\n                group.update_sel_range(table)\n\n    def _update_sel_profiles_color(self):\n        # color depends on subset; when subset is present,\n        # selected profiles are black\n        if not self.selection or not self.show_profiles:\n            return\n        for group in self.__groups:\n            group.update_sel_profiles_color(bool(self.subset_indices))\n\n    def _update_sub_profiles(self):\n        # mark subset instances\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i, _id in zip(group.indices, group.ids)\n                    if self.__in(_id, self.subset_indices)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            group.update_sub_profiles(table)\n\n    def _update_visibility(self, obj_name):\n        if not len(self.__groups):\n            return\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        kwargs = self.__get_visibility_flags()\n        for group in self.__groups:\n            getattr(group, \"set_visible_{}\".format(obj_name))(**kwargs)\n        self.graph.view_box.updateAutoRange()\n\n    def apply_selection(self):\n        if self.data is not None and self.__pending_selection is not None:\n            sel = [i for i in self.__pending_selection if i < len(self.data)]\n            mask = np.zeros(len(self.data), dtype=bool)\n            mask[sel] = True\n            mask = mask[self.valid_data]\n            self.selection_changed(mask)\n            self.__pending_selection = None\n\n    def selection_changed(self, mask):\n        if self.data is None:\n            return\n        # need indices for self.data: mask refers to self.data[self.valid_data]\n        indices = np.arange(len(self.data))[self.valid_data][mask]\n        self.graph.select(indices)\n        old = self.selection\n        self.selection = None if self.data and isinstance(self.data, SqlTable)\\\n            else list(self.graph.selection)\n        if not old and self.selection or old and not self.selection:\n            self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self.commit()\n\n    def commit(self):\n        selected = self.data[self.selection] \\\n            if self.data is not None and bool(self.selection) else None\n        annotated = create_annotated_table(self.data, self.selection)\n\n        summary = len(selected) if selected else self.info.NoOutput\n        details = format_summary_details(selected) if selected else \"\"\n        self.info.set_output_summary(summary, details)\n        self.Outputs.selected_data.send(selected)\n        self.Outputs.annotated_data.send(annotated)\n\n    def send_report(self):\n        if self.data is None:\n            return\n\n        caption = report.render_items_vert(((\"Group by\", self.group_var),))\n        self.report_plot()\n        if caption:\n            self.report_caption(caption)\n\n    def sizeHint(self):\n        return QSize(1132, 708)\n\n    def clear(self):\n        self.valid_data = None\n        self.selection = None\n        self.__groups = []\n        self.graph_variables = []\n        self.graph.reset()\n        self.group_vars.set_domain(None)\n        self.group_view.setEnabled(False)\n\n    @staticmethod\n    def __in(obj, collection):\n        return collection is not None and obj in collection\n\n    def set_visual_settings(self, key, value):\n        self.graph.parameter_setter.set_parameter(key, value)\n        self.visual_settings[key] = value\n\n\nif __name__ == \"__main__\":\n    brown = Table(\"brown-selected\")\n    WidgetPreview(OWLinePlot).run(set_data=brown, set_subset_data=brown[:30])\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/visualize/owlineplot.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "bce51e2b4",
                "new_commit_hash": "0a013584c",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/visualize/owlineplot.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/visualize/owlineplot.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 802,
                            "length": 7
                        },
                        "new_range": {
                            "start": 802,
                            "length": 7
                        },
                        "section": "class OWLinePlot(OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def plot_groups(self):",
                                "type": "context"
                            },
                            {
                                "content": "        self._remove_groups()",
                                "type": "context"
                            },
                            {
                                "content": "        data = self.data[self.valid_data, self.graph_variables]",
                                "type": "deleted"
                            },
                            {
                                "content": "        data = self.data[self.valid_data][:, self.graph_variables]",
                                "type": "added"
                            },
                            {
                                "content": "        if self.group_var is None:",
                                "type": "context"
                            },
                            {
                                "content": "            self._plot_group(data, np.where(self.valid_data)[0])",
                                "type": "context"
                            },
                            {
                                "content": "        else:",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/owlineplot.py",
                            "type": "method",
                            "name": "OWLinePlot.plot_groups",
                            "content": "class OWLinePlot(OWWidget):\n    name = \"Line Plot\"\n    description = \"Visualization of data profiles (e.g., time series).\"\n    icon = \"icons/LinePlot.svg\"\n    priority = 180\n\n    buttons_area_orientation = Qt.Vertical\n    enable_selection = Signal(bool)\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        data_subset = Input(\"Data Subset\", Table)\n\n    class Outputs:\n        selected_data = Output(\"Selected Data\", Table, default=True)\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    settingsHandler = DomainContextHandler()\n    group_var = ContextSetting(None)\n    show_profiles = Setting(False)\n    show_range = Setting(True)\n    show_mean = Setting(True)\n    show_error = Setting(False)\n    auto_commit = Setting(True)\n    selection = Setting(None, schema_only=True)\n    visual_settings = Setting({}, schema_only=True)\n\n    graph_name = \"graph.plotItem\"\n\n    class Error(OWWidget.Error):\n        not_enough_attrs = Msg(\"Need at least one numeric feature.\")\n        no_valid_data = Msg(\"No plot due to no valid data.\")\n\n    class Warning(OWWidget.Warning):\n        no_display_option = Msg(\"No display option is selected.\")\n\n    class Information(OWWidget.Information):\n        hidden_instances = Msg(\"Instances with unknown values are not shown.\")\n        too_many_features = Msg(\"Data has too many features. Only first {}\"\n                                \" are shown.\".format(MAX_FEATURES))\n\n    def __init__(self, parent=None):\n        super().__init__(parent)\n        self.__groups = []\n        self.data = None\n        self.valid_data = None\n        self.subset_data = None\n        self.subset_indices = None\n        self.__pending_selection = self.selection\n        self.graph_variables = []\n        self.graph = None\n        self.group_vars = None\n        self.group_view = None\n        self.setup_gui()\n\n        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)\n        self.graph.view_box.selection_changed.connect(self.selection_changed)\n        self.enable_selection.connect(self.graph.view_box.enable_selection)\n\n    def setup_gui(self):\n        self._add_graph()\n        self._add_controls()\n\n    def _add_graph(self):\n        box = gui.vBox(self.mainArea, True, margin=0)\n        self.graph = LinePlotGraph(self)\n        box.layout().addWidget(self.graph)\n\n    def _add_controls(self):\n        displaybox = gui.widgetBox(self.controlArea, \"Display\")\n        gui.checkBox(displaybox, self, \"show_profiles\", \"Lines\",\n                     callback=self.__show_profiles_changed,\n                     tooltip=\"Plot lines\")\n        gui.checkBox(displaybox, self, \"show_range\", \"Range\",\n                     callback=self.__show_range_changed,\n                     tooltip=\"Plot range between 10th and 90th percentile\")\n        gui.checkBox(displaybox, self, \"show_mean\", \"Mean\",\n                     callback=self.__show_mean_changed,\n                     tooltip=\"Plot mean curve\")\n        gui.checkBox(displaybox, self, \"show_error\", \"Error bars\",\n                     callback=self.__show_error_changed,\n                     tooltip=\"Show standard deviation\")\n\n        self.group_vars = DomainModel(\n            placeholder=\"None\", separators=False, valid_types=DiscreteVariable)\n        self.group_view = gui.listView(\n            self.controlArea, self, \"group_var\", box=\"Group by\",\n            model=self.group_vars, callback=self.__group_var_changed,\n            sizeHint=QSize(30, 100), viewType=ListViewSearch,\n            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)\n        )\n        self.group_view.setEnabled(False)\n\n        plot_gui = OWPlotGUI(self)\n        plot_gui.box_zoom_select(self.buttonsArea)\n        gui.auto_send(self.buttonsArea, self, \"auto_commit\")\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n    def __show_profiles_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"profiles\")\n\n    def __show_range_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"range\")\n\n    def __show_mean_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"mean\")\n\n    def __show_error_changed(self):\n        self._update_visibility(\"error\")\n\n    def __group_var_changed(self):\n        if self.data is None or not self.graph_variables:\n            return\n        self.plot_groups()\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self._update_sub_profiles()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        self._set_input_summary()\n        self.clear()\n        self.check_data()\n        self.check_display_options()\n\n        if self.data is not None:\n            self.group_vars.set_domain(self.data.domain)\n            self.group_view.setEnabled(len(self.group_vars) > 1)\n            self.group_var = self.data.domain.class_var \\\n                if self.data.domain.has_discrete_class else None\n\n        self.openContext(data)\n        self.setup_plot()\n        self.unconditional_commit()\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        self.clear_messages()\n        if self.data is not None:\n            self.graph_variables = [var for var in self.data.domain.attributes\n                                    if var.is_continuous]\n            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)\n            if len(self.graph_variables) < 1:\n                error(self.Error.not_enough_attrs)\n            elif not np.sum(self.valid_data):\n                error(self.Error.no_valid_data)\n            else:\n                if not np.all(self.valid_data):\n                    self.Information.hidden_instances()\n                if len(self.graph_variables) > MAX_FEATURES:\n                    self.Information.too_many_features()\n                    self.graph_variables = self.graph_variables[:MAX_FEATURES]\n\n    def check_display_options(self):\n        self.Warning.no_display_option.clear()\n        if self.data is not None:\n            if not (self.show_profiles or self.show_range or self.show_mean):\n                self.Warning.no_display_option()\n            enable = (self.show_profiles or self.show_range) and \\\n                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES\n            self.enable_selection.emit(enable)\n\n    def _set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    @Inputs.data_subset\n    @check_sql_input\n    def set_subset_data(self, subset):\n        self.subset_data = subset\n\n    def handleNewSignals(self):\n        self.set_subset_ids()\n        if self.data is not None:\n            self._update_profiles_color()\n            self._update_sel_profiles_color()\n            self._update_sub_profiles()\n\n    def set_subset_ids(self):\n        sub_ids = {e.id for e in self.subset_data} \\\n            if self.subset_data is not None else {}\n        self.subset_indices = None\n        if self.data is not None and sub_ids:\n            self.subset_indices = [x.id for x in self.data[self.valid_data]\n                                   if x.id in sub_ids]\n\n    def setup_plot(self):\n        if self.data is None:\n            return\n\n        ticks = [a.name for a in self.graph_variables]\n        self.graph.getAxis(\"bottom\").set_ticks(ticks)\n        self.plot_groups()\n        self.apply_selection()\n        self.graph.view_box.enableAutoRange()\n        self.graph.view_box.updateAutoRange()\n\n    def plot_groups(self):\n        self._remove_groups()\n        data = self.data[self.valid_data, self.graph_variables]\n        if self.group_var is None:\n            self._plot_group(data, np.where(self.valid_data)[0])\n        else:\n            class_col_data, _ = self.data.get_column_view(self.group_var)\n            for index in range(len(self.group_var.values)):\n                mask = np.logical_and(class_col_data == index, self.valid_data)\n                indices = np.flatnonzero(mask)\n                if not len(indices):\n                    continue\n                group_data = self.data[indices, self.graph_variables]\n                self._plot_group(group_data, indices, index)\n        self.graph.update_legend(self.group_var)\n        self.graph.groups = self.__groups\n        self.graph.view_box.add_profiles(data.X)\n\n    def _remove_groups(self):\n        for group in self.__groups:\n            group.remove_items()\n        self.graph.view_box.remove_profiles()\n        self.graph.groups = []\n        self.__groups = []\n\n    def _plot_group(self, data, indices, index=None):\n        color = self.__get_group_color(index)\n        group = ProfileGroup(data, indices, color, self.graph)\n        kwargs = self.__get_visibility_flags()\n        group.set_visible_error(**kwargs)\n        group.set_visible_mean(**kwargs)\n        group.set_visible_range(**kwargs)\n        group.set_visible_profiles(**kwargs)\n        self.__groups.append(group)\n\n    def __get_group_color(self, index):\n        if self.group_var is not None:\n            return QColor(*self.group_var.colors[index])\n        return QColor(LinePlotStyle.DEFAULT_COLOR)\n\n    def __get_visibility_flags(self):\n        return {\"show_profiles\": self.show_profiles,\n                \"show_range\": self.show_range,\n                \"show_mean\": self.show_mean,\n                \"show_error\": self.show_error}\n\n    def _update_profiles_color(self):\n        # color alpha depends on subset and selection; with selection or\n        # subset profiles color has more opacity\n        if not self.show_profiles:\n            return\n        for group in self.__groups:\n            has_sel = bool(self.subset_indices) or bool(self.selection)\n            group.update_profiles_color(has_sel)\n\n    def _update_sel_profiles_and_range(self):\n        # mark selected instances and selected range\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i in group.indices if self.__in(i, self.selection)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            if self.show_profiles:\n                group.update_sel_profiles(table)\n            if self.show_range:\n                group.update_sel_range(table)\n\n    def _update_sel_profiles_color(self):\n        # color depends on subset; when subset is present,\n        # selected profiles are black\n        if not self.selection or not self.show_profiles:\n            return\n        for group in self.__groups:\n            group.update_sel_profiles_color(bool(self.subset_indices))\n\n    def _update_sub_profiles(self):\n        # mark subset instances\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i, _id in zip(group.indices, group.ids)\n                    if self.__in(_id, self.subset_indices)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            group.update_sub_profiles(table)\n\n    def _update_visibility(self, obj_name):\n        if not len(self.__groups):\n            return\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        kwargs = self.__get_visibility_flags()\n        for group in self.__groups:\n            getattr(group, \"set_visible_{}\".format(obj_name))(**kwargs)\n        self.graph.view_box.updateAutoRange()\n\n    def apply_selection(self):\n        if self.data is not None and self.__pending_selection is not None:\n            sel = [i for i in self.__pending_selection if i < len(self.data)]\n            mask = np.zeros(len(self.data), dtype=bool)\n            mask[sel] = True\n            mask = mask[self.valid_data]\n            self.selection_changed(mask)\n            self.__pending_selection = None\n\n    def selection_changed(self, mask):\n        if self.data is None:\n            return\n        # need indices for self.data: mask refers to self.data[self.valid_data]\n        indices = np.arange(len(self.data))[self.valid_data][mask]\n        self.graph.select(indices)\n        old = self.selection\n        self.selection = None if self.data and isinstance(self.data, SqlTable)\\\n            else list(self.graph.selection)\n        if not old and self.selection or old and not self.selection:\n            self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self.commit()\n\n    def commit(self):\n        selected = self.data[self.selection] \\\n            if self.data is not None and bool(self.selection) else None\n        annotated = create_annotated_table(self.data, self.selection)\n\n        summary = len(selected) if selected else self.info.NoOutput\n        details = format_summary_details(selected) if selected else \"\"\n        self.info.set_output_summary(summary, details)\n        self.Outputs.selected_data.send(selected)\n        self.Outputs.annotated_data.send(annotated)\n\n    def send_report(self):\n        if self.data is None:\n            return\n\n        caption = report.render_items_vert(((\"Group by\", self.group_var),))\n        self.report_plot()\n        if caption:\n            self.report_caption(caption)\n\n    def sizeHint(self):\n        return QSize(1132, 708)\n\n    def clear(self):\n        self.valid_data = None\n        self.selection = None\n        self.__groups = []\n        self.graph_variables = []\n        self.graph.reset()\n        self.group_vars.set_domain(None)\n        self.group_view.setEnabled(False)\n\n    @staticmethod\n    def __in(obj, collection):\n        return collection is not None and obj in collection\n\n    def set_visual_settings(self, key, value):\n        self.graph.parameter_setter.set_parameter(key, value)\n        self.visual_settings[key] = value",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 803,
                            "end_lineno": 819,
                            "parent": {
                                "file_name": "Orange/widgets/visualize/owlineplot.py",
                                "type": "class",
                                "name": "OWLinePlot",
                                "content": "class OWLinePlot(OWWidget):\n    name = \"Line Plot\"\n    description = \"Visualization of data profiles (e.g., time series).\"\n    icon = \"icons/LinePlot.svg\"\n    priority = 180\n\n    buttons_area_orientation = Qt.Vertical\n    enable_selection = Signal(bool)\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        data_subset = Input(\"Data Subset\", Table)\n\n    class Outputs:\n        selected_data = Output(\"Selected Data\", Table, default=True)\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    settingsHandler = DomainContextHandler()\n    group_var = ContextSetting(None)\n    show_profiles = Setting(False)\n    show_range = Setting(True)\n    show_mean = Setting(True)\n    show_error = Setting(False)\n    auto_commit = Setting(True)\n    selection = Setting(None, schema_only=True)\n    visual_settings = Setting({}, schema_only=True)\n\n    graph_name = \"graph.plotItem\"\n\n    class Error(OWWidget.Error):\n        not_enough_attrs = Msg(\"Need at least one numeric feature.\")\n        no_valid_data = Msg(\"No plot due to no valid data.\")\n\n    class Warning(OWWidget.Warning):\n        no_display_option = Msg(\"No display option is selected.\")\n\n    class Information(OWWidget.Information):\n        hidden_instances = Msg(\"Instances with unknown values are not shown.\")\n        too_many_features = Msg(\"Data has too many features. Only first {}\"\n                                \" are shown.\".format(MAX_FEATURES))\n\n    def __init__(self, parent=None):\n        super().__init__(parent)\n        self.__groups = []\n        self.data = None\n        self.valid_data = None\n        self.subset_data = None\n        self.subset_indices = None\n        self.__pending_selection = self.selection\n        self.graph_variables = []\n        self.graph = None\n        self.group_vars = None\n        self.group_view = None\n        self.setup_gui()\n\n        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)\n        self.graph.view_box.selection_changed.connect(self.selection_changed)\n        self.enable_selection.connect(self.graph.view_box.enable_selection)\n\n    def setup_gui(self):\n        self._add_graph()\n        self._add_controls()\n\n    def _add_graph(self):\n        box = gui.vBox(self.mainArea, True, margin=0)\n        self.graph = LinePlotGraph(self)\n        box.layout().addWidget(self.graph)\n\n    def _add_controls(self):\n        displaybox = gui.widgetBox(self.controlArea, \"Display\")\n        gui.checkBox(displaybox, self, \"show_profiles\", \"Lines\",\n                     callback=self.__show_profiles_changed,\n                     tooltip=\"Plot lines\")\n        gui.checkBox(displaybox, self, \"show_range\", \"Range\",\n                     callback=self.__show_range_changed,\n                     tooltip=\"Plot range between 10th and 90th percentile\")\n        gui.checkBox(displaybox, self, \"show_mean\", \"Mean\",\n                     callback=self.__show_mean_changed,\n                     tooltip=\"Plot mean curve\")\n        gui.checkBox(displaybox, self, \"show_error\", \"Error bars\",\n                     callback=self.__show_error_changed,\n                     tooltip=\"Show standard deviation\")\n\n        self.group_vars = DomainModel(\n            placeholder=\"None\", separators=False, valid_types=DiscreteVariable)\n        self.group_view = gui.listView(\n            self.controlArea, self, \"group_var\", box=\"Group by\",\n            model=self.group_vars, callback=self.__group_var_changed,\n            sizeHint=QSize(30, 100), viewType=ListViewSearch,\n            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)\n        )\n        self.group_view.setEnabled(False)\n\n        plot_gui = OWPlotGUI(self)\n        plot_gui.box_zoom_select(self.buttonsArea)\n        gui.auto_send(self.buttonsArea, self, \"auto_commit\")\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n    def __show_profiles_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"profiles\")\n\n    def __show_range_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"range\")\n\n    def __show_mean_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"mean\")\n\n    def __show_error_changed(self):\n        self._update_visibility(\"error\")\n\n    def __group_var_changed(self):\n        if self.data is None or not self.graph_variables:\n            return\n        self.plot_groups()\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self._update_sub_profiles()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        self._set_input_summary()\n        self.clear()\n        self.check_data()\n        self.check_display_options()\n\n        if self.data is not None:\n            self.group_vars.set_domain(self.data.domain)\n            self.group_view.setEnabled(len(self.group_vars) > 1)\n            self.group_var = self.data.domain.class_var \\\n                if self.data.domain.has_discrete_class else None\n\n        self.openContext(data)\n        self.setup_plot()\n        self.unconditional_commit()\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        self.clear_messages()\n        if self.data is not None:\n            self.graph_variables = [var for var in self.data.domain.attributes\n                                    if var.is_continuous]\n            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)\n            if len(self.graph_variables) < 1:\n                error(self.Error.not_enough_attrs)\n            elif not np.sum(self.valid_data):\n                error(self.Error.no_valid_data)\n            else:\n                if not np.all(self.valid_data):\n                    self.Information.hidden_instances()\n                if len(self.graph_variables) > MAX_FEATURES:\n                    self.Information.too_many_features()\n                    self.graph_variables = self.graph_variables[:MAX_FEATURES]\n\n    def check_display_options(self):\n        self.Warning.no_display_option.clear()\n        if self.data is not None:\n            if not (self.show_profiles or self.show_range or self.show_mean):\n                self.Warning.no_display_option()\n            enable = (self.show_profiles or self.show_range) and \\\n                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES\n            self.enable_selection.emit(enable)\n\n    def _set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    @Inputs.data_subset\n    @check_sql_input\n    def set_subset_data(self, subset):\n        self.subset_data = subset\n\n    def handleNewSignals(self):\n        self.set_subset_ids()\n        if self.data is not None:\n            self._update_profiles_color()\n            self._update_sel_profiles_color()\n            self._update_sub_profiles()\n\n    def set_subset_ids(self):\n        sub_ids = {e.id for e in self.subset_data} \\\n            if self.subset_data is not None else {}\n        self.subset_indices = None\n        if self.data is not None and sub_ids:\n            self.subset_indices = [x.id for x in self.data[self.valid_data]\n                                   if x.id in sub_ids]\n\n    def setup_plot(self):\n        if self.data is None:\n            return\n\n        ticks = [a.name for a in self.graph_variables]\n        self.graph.getAxis(\"bottom\").set_ticks(ticks)\n        self.plot_groups()\n        self.apply_selection()\n        self.graph.view_box.enableAutoRange()\n        self.graph.view_box.updateAutoRange()\n\n    def plot_groups(self):\n        self._remove_groups()\n        data = self.data[self.valid_data, self.graph_variables]\n        if self.group_var is None:\n            self._plot_group(data, np.where(self.valid_data)[0])\n        else:\n            class_col_data, _ = self.data.get_column_view(self.group_var)\n            for index in range(len(self.group_var.values)):\n                mask = np.logical_and(class_col_data == index, self.valid_data)\n                indices = np.flatnonzero(mask)\n                if not len(indices):\n                    continue\n                group_data = self.data[indices, self.graph_variables]\n                self._plot_group(group_data, indices, index)\n        self.graph.update_legend(self.group_var)\n        self.graph.groups = self.__groups\n        self.graph.view_box.add_profiles(data.X)\n\n    def _remove_groups(self):\n        for group in self.__groups:\n            group.remove_items()\n        self.graph.view_box.remove_profiles()\n        self.graph.groups = []\n        self.__groups = []\n\n    def _plot_group(self, data, indices, index=None):\n        color = self.__get_group_color(index)\n        group = ProfileGroup(data, indices, color, self.graph)\n        kwargs = self.__get_visibility_flags()\n        group.set_visible_error(**kwargs)\n        group.set_visible_mean(**kwargs)\n        group.set_visible_range(**kwargs)\n        group.set_visible_profiles(**kwargs)\n        self.__groups.append(group)\n\n    def __get_group_color(self, index):\n        if self.group_var is not None:\n            return QColor(*self.group_var.colors[index])\n        return QColor(LinePlotStyle.DEFAULT_COLOR)\n\n    def __get_visibility_flags(self):\n        return {\"show_profiles\": self.show_profiles,\n                \"show_range\": self.show_range,\n                \"show_mean\": self.show_mean,\n                \"show_error\": self.show_error}\n\n    def _update_profiles_color(self):\n        # color alpha depends on subset and selection; with selection or\n        # subset profiles color has more opacity\n        if not self.show_profiles:\n            return\n        for group in self.__groups:\n            has_sel = bool(self.subset_indices) or bool(self.selection)\n            group.update_profiles_color(has_sel)\n\n    def _update_sel_profiles_and_range(self):\n        # mark selected instances and selected range\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i in group.indices if self.__in(i, self.selection)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            if self.show_profiles:\n                group.update_sel_profiles(table)\n            if self.show_range:\n                group.update_sel_range(table)\n\n    def _update_sel_profiles_color(self):\n        # color depends on subset; when subset is present,\n        # selected profiles are black\n        if not self.selection or not self.show_profiles:\n            return\n        for group in self.__groups:\n            group.update_sel_profiles_color(bool(self.subset_indices))\n\n    def _update_sub_profiles(self):\n        # mark subset instances\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i, _id in zip(group.indices, group.ids)\n                    if self.__in(_id, self.subset_indices)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            group.update_sub_profiles(table)\n\n    def _update_visibility(self, obj_name):\n        if not len(self.__groups):\n            return\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        kwargs = self.__get_visibility_flags()\n        for group in self.__groups:\n            getattr(group, \"set_visible_{}\".format(obj_name))(**kwargs)\n        self.graph.view_box.updateAutoRange()\n\n    def apply_selection(self):\n        if self.data is not None and self.__pending_selection is not None:\n            sel = [i for i in self.__pending_selection if i < len(self.data)]\n            mask = np.zeros(len(self.data), dtype=bool)\n            mask[sel] = True\n            mask = mask[self.valid_data]\n            self.selection_changed(mask)\n            self.__pending_selection = None\n\n    def selection_changed(self, mask):\n        if self.data is None:\n            return\n        # need indices for self.data: mask refers to self.data[self.valid_data]\n        indices = np.arange(len(self.data))[self.valid_data][mask]\n        self.graph.select(indices)\n        old = self.selection\n        self.selection = None if self.data and isinstance(self.data, SqlTable)\\\n            else list(self.graph.selection)\n        if not old and self.selection or old and not self.selection:\n            self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self.commit()\n\n    def commit(self):\n        selected = self.data[self.selection] \\\n            if self.data is not None and bool(self.selection) else None\n        annotated = create_annotated_table(self.data, self.selection)\n\n        summary = len(selected) if selected else self.info.NoOutput\n        details = format_summary_details(selected) if selected else \"\"\n        self.info.set_output_summary(summary, details)\n        self.Outputs.selected_data.send(selected)\n        self.Outputs.annotated_data.send(annotated)\n\n    def send_report(self):\n        if self.data is None:\n            return\n\n        caption = report.render_items_vert(((\"Group by\", self.group_var),))\n        self.report_plot()\n        if caption:\n            self.report_caption(caption)\n\n    def sizeHint(self):\n        return QSize(1132, 708)\n\n    def clear(self):\n        self.valid_data = None\n        self.selection = None\n        self.__groups = []\n        self.graph_variables = []\n        self.graph.reset()\n        self.group_vars.set_domain(None)\n        self.group_view.setEnabled(False)\n\n    @staticmethod\n    def __in(obj, collection):\n        return collection is not None and obj in collection\n\n    def set_visual_settings(self, key, value):\n        self.graph.parameter_setter.set_parameter(key, value)\n        self.visual_settings[key] = value",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 593,
                                "end_lineno": 961,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/visualize/owlineplot.py",
                            "type": "class",
                            "name": "OWLinePlot",
                            "content": "class OWLinePlot(OWWidget):\n    name = \"Line Plot\"\n    description = \"Visualization of data profiles (e.g., time series).\"\n    icon = \"icons/LinePlot.svg\"\n    priority = 180\n\n    buttons_area_orientation = Qt.Vertical\n    enable_selection = Signal(bool)\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        data_subset = Input(\"Data Subset\", Table)\n\n    class Outputs:\n        selected_data = Output(\"Selected Data\", Table, default=True)\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    settingsHandler = DomainContextHandler()\n    group_var = ContextSetting(None)\n    show_profiles = Setting(False)\n    show_range = Setting(True)\n    show_mean = Setting(True)\n    show_error = Setting(False)\n    auto_commit = Setting(True)\n    selection = Setting(None, schema_only=True)\n    visual_settings = Setting({}, schema_only=True)\n\n    graph_name = \"graph.plotItem\"\n\n    class Error(OWWidget.Error):\n        not_enough_attrs = Msg(\"Need at least one numeric feature.\")\n        no_valid_data = Msg(\"No plot due to no valid data.\")\n\n    class Warning(OWWidget.Warning):\n        no_display_option = Msg(\"No display option is selected.\")\n\n    class Information(OWWidget.Information):\n        hidden_instances = Msg(\"Instances with unknown values are not shown.\")\n        too_many_features = Msg(\"Data has too many features. Only first {}\"\n                                \" are shown.\".format(MAX_FEATURES))\n\n    def __init__(self, parent=None):\n        super().__init__(parent)\n        self.__groups = []\n        self.data = None\n        self.valid_data = None\n        self.subset_data = None\n        self.subset_indices = None\n        self.__pending_selection = self.selection\n        self.graph_variables = []\n        self.graph = None\n        self.group_vars = None\n        self.group_view = None\n        self.setup_gui()\n\n        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)\n        self.graph.view_box.selection_changed.connect(self.selection_changed)\n        self.enable_selection.connect(self.graph.view_box.enable_selection)\n\n    def setup_gui(self):\n        self._add_graph()\n        self._add_controls()\n\n    def _add_graph(self):\n        box = gui.vBox(self.mainArea, True, margin=0)\n        self.graph = LinePlotGraph(self)\n        box.layout().addWidget(self.graph)\n\n    def _add_controls(self):\n        displaybox = gui.widgetBox(self.controlArea, \"Display\")\n        gui.checkBox(displaybox, self, \"show_profiles\", \"Lines\",\n                     callback=self.__show_profiles_changed,\n                     tooltip=\"Plot lines\")\n        gui.checkBox(displaybox, self, \"show_range\", \"Range\",\n                     callback=self.__show_range_changed,\n                     tooltip=\"Plot range between 10th and 90th percentile\")\n        gui.checkBox(displaybox, self, \"show_mean\", \"Mean\",\n                     callback=self.__show_mean_changed,\n                     tooltip=\"Plot mean curve\")\n        gui.checkBox(displaybox, self, \"show_error\", \"Error bars\",\n                     callback=self.__show_error_changed,\n                     tooltip=\"Show standard deviation\")\n\n        self.group_vars = DomainModel(\n            placeholder=\"None\", separators=False, valid_types=DiscreteVariable)\n        self.group_view = gui.listView(\n            self.controlArea, self, \"group_var\", box=\"Group by\",\n            model=self.group_vars, callback=self.__group_var_changed,\n            sizeHint=QSize(30, 100), viewType=ListViewSearch,\n            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)\n        )\n        self.group_view.setEnabled(False)\n\n        plot_gui = OWPlotGUI(self)\n        plot_gui.box_zoom_select(self.buttonsArea)\n        gui.auto_send(self.buttonsArea, self, \"auto_commit\")\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n    def __show_profiles_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"profiles\")\n\n    def __show_range_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"range\")\n\n    def __show_mean_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"mean\")\n\n    def __show_error_changed(self):\n        self._update_visibility(\"error\")\n\n    def __group_var_changed(self):\n        if self.data is None or not self.graph_variables:\n            return\n        self.plot_groups()\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self._update_sub_profiles()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        self._set_input_summary()\n        self.clear()\n        self.check_data()\n        self.check_display_options()\n\n        if self.data is not None:\n            self.group_vars.set_domain(self.data.domain)\n            self.group_view.setEnabled(len(self.group_vars) > 1)\n            self.group_var = self.data.domain.class_var \\\n                if self.data.domain.has_discrete_class else None\n\n        self.openContext(data)\n        self.setup_plot()\n        self.unconditional_commit()\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        self.clear_messages()\n        if self.data is not None:\n            self.graph_variables = [var for var in self.data.domain.attributes\n                                    if var.is_continuous]\n            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)\n            if len(self.graph_variables) < 1:\n                error(self.Error.not_enough_attrs)\n            elif not np.sum(self.valid_data):\n                error(self.Error.no_valid_data)\n            else:\n                if not np.all(self.valid_data):\n                    self.Information.hidden_instances()\n                if len(self.graph_variables) > MAX_FEATURES:\n                    self.Information.too_many_features()\n                    self.graph_variables = self.graph_variables[:MAX_FEATURES]\n\n    def check_display_options(self):\n        self.Warning.no_display_option.clear()\n        if self.data is not None:\n            if not (self.show_profiles or self.show_range or self.show_mean):\n                self.Warning.no_display_option()\n            enable = (self.show_profiles or self.show_range) and \\\n                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES\n            self.enable_selection.emit(enable)\n\n    def _set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    @Inputs.data_subset\n    @check_sql_input\n    def set_subset_data(self, subset):\n        self.subset_data = subset\n\n    def handleNewSignals(self):\n        self.set_subset_ids()\n        if self.data is not None:\n            self._update_profiles_color()\n            self._update_sel_profiles_color()\n            self._update_sub_profiles()\n\n    def set_subset_ids(self):\n        sub_ids = {e.id for e in self.subset_data} \\\n            if self.subset_data is not None else {}\n        self.subset_indices = None\n        if self.data is not None and sub_ids:\n            self.subset_indices = [x.id for x in self.data[self.valid_data]\n                                   if x.id in sub_ids]\n\n    def setup_plot(self):\n        if self.data is None:\n            return\n\n        ticks = [a.name for a in self.graph_variables]\n        self.graph.getAxis(\"bottom\").set_ticks(ticks)\n        self.plot_groups()\n        self.apply_selection()\n        self.graph.view_box.enableAutoRange()\n        self.graph.view_box.updateAutoRange()\n\n    def plot_groups(self):\n        self._remove_groups()\n        data = self.data[self.valid_data, self.graph_variables]\n        if self.group_var is None:\n            self._plot_group(data, np.where(self.valid_data)[0])\n        else:\n            class_col_data, _ = self.data.get_column_view(self.group_var)\n            for index in range(len(self.group_var.values)):\n                mask = np.logical_and(class_col_data == index, self.valid_data)\n                indices = np.flatnonzero(mask)\n                if not len(indices):\n                    continue\n                group_data = self.data[indices, self.graph_variables]\n                self._plot_group(group_data, indices, index)\n        self.graph.update_legend(self.group_var)\n        self.graph.groups = self.__groups\n        self.graph.view_box.add_profiles(data.X)\n\n    def _remove_groups(self):\n        for group in self.__groups:\n            group.remove_items()\n        self.graph.view_box.remove_profiles()\n        self.graph.groups = []\n        self.__groups = []\n\n    def _plot_group(self, data, indices, index=None):\n        color = self.__get_group_color(index)\n        group = ProfileGroup(data, indices, color, self.graph)\n        kwargs = self.__get_visibility_flags()\n        group.set_visible_error(**kwargs)\n        group.set_visible_mean(**kwargs)\n        group.set_visible_range(**kwargs)\n        group.set_visible_profiles(**kwargs)\n        self.__groups.append(group)\n\n    def __get_group_color(self, index):\n        if self.group_var is not None:\n            return QColor(*self.group_var.colors[index])\n        return QColor(LinePlotStyle.DEFAULT_COLOR)\n\n    def __get_visibility_flags(self):\n        return {\"show_profiles\": self.show_profiles,\n                \"show_range\": self.show_range,\n                \"show_mean\": self.show_mean,\n                \"show_error\": self.show_error}\n\n    def _update_profiles_color(self):\n        # color alpha depends on subset and selection; with selection or\n        # subset profiles color has more opacity\n        if not self.show_profiles:\n            return\n        for group in self.__groups:\n            has_sel = bool(self.subset_indices) or bool(self.selection)\n            group.update_profiles_color(has_sel)\n\n    def _update_sel_profiles_and_range(self):\n        # mark selected instances and selected range\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i in group.indices if self.__in(i, self.selection)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            if self.show_profiles:\n                group.update_sel_profiles(table)\n            if self.show_range:\n                group.update_sel_range(table)\n\n    def _update_sel_profiles_color(self):\n        # color depends on subset; when subset is present,\n        # selected profiles are black\n        if not self.selection or not self.show_profiles:\n            return\n        for group in self.__groups:\n            group.update_sel_profiles_color(bool(self.subset_indices))\n\n    def _update_sub_profiles(self):\n        # mark subset instances\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i, _id in zip(group.indices, group.ids)\n                    if self.__in(_id, self.subset_indices)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            group.update_sub_profiles(table)\n\n    def _update_visibility(self, obj_name):\n        if not len(self.__groups):\n            return\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        kwargs = self.__get_visibility_flags()\n        for group in self.__groups:\n            getattr(group, \"set_visible_{}\".format(obj_name))(**kwargs)\n        self.graph.view_box.updateAutoRange()\n\n    def apply_selection(self):\n        if self.data is not None and self.__pending_selection is not None:\n            sel = [i for i in self.__pending_selection if i < len(self.data)]\n            mask = np.zeros(len(self.data), dtype=bool)\n            mask[sel] = True\n            mask = mask[self.valid_data]\n            self.selection_changed(mask)\n            self.__pending_selection = None\n\n    def selection_changed(self, mask):\n        if self.data is None:\n            return\n        # need indices for self.data: mask refers to self.data[self.valid_data]\n        indices = np.arange(len(self.data))[self.valid_data][mask]\n        self.graph.select(indices)\n        old = self.selection\n        self.selection = None if self.data and isinstance(self.data, SqlTable)\\\n            else list(self.graph.selection)\n        if not old and self.selection or old and not self.selection:\n            self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self.commit()\n\n    def commit(self):\n        selected = self.data[self.selection] \\\n            if self.data is not None and bool(self.selection) else None\n        annotated = create_annotated_table(self.data, self.selection)\n\n        summary = len(selected) if selected else self.info.NoOutput\n        details = format_summary_details(selected) if selected else \"\"\n        self.info.set_output_summary(summary, details)\n        self.Outputs.selected_data.send(selected)\n        self.Outputs.annotated_data.send(annotated)\n\n    def send_report(self):\n        if self.data is None:\n            return\n\n        caption = report.render_items_vert(((\"Group by\", self.group_var),))\n        self.report_plot()\n        if caption:\n            self.report_caption(caption)\n\n    def sizeHint(self):\n        return QSize(1132, 708)\n\n    def clear(self):\n        self.valid_data = None\n        self.selection = None\n        self.__groups = []\n        self.graph_variables = []\n        self.graph.reset()\n        self.group_vars.set_domain(None)\n        self.group_view.setEnabled(False)\n\n    @staticmethod\n    def __in(obj, collection):\n        return collection is not None and obj in collection\n\n    def set_visual_settings(self, key, value):\n        self.graph.parameter_setter.set_parameter(key, value)\n        self.visual_settings[key] = value",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 593,
                            "end_lineno": 961,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,protected-access\nimport random\nimport unittest\nfrom unittest.mock import patch, Mock\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QPointF\nfrom AnyQt.QtGui import QFont\n\nimport pyqtgraph\nfrom pyqtgraph import PlotCurveItem\nfrom pyqtgraph.Point import Point\n\nfrom orangewidget.tests.base import DEFAULT_TIMEOUT\n\nfrom orangewidget.widget import StateInfo\n\nfrom Orange.data import Table\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, datasets\n)\nfrom Orange.widgets.visualize.owlineplot import (\n    OWLinePlot, ccw, intersects, line_intersects_profiles\n)\nfrom Orange.widgets.utils.state_summary import format_summary_details\n\n\nclass TestOWLinePLot(WidgetTest, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinePlot)\n        self.titanic = Table(\"titanic\")\n        self.housing = Table(\"housing\")\n\n    def _select_data(self):\n        random.seed(42)\n        indices = random.sample(range(0, len(self.data)), 20)\n        self.widget.selection_changed(indices)\n        return self.widget.selection\n\n    def test_input_data(self):\n        no_data = \"No data on input\"\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 2)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n\n    def test_input_continuous_class(self):\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n\n    def test_input_discrete_features(self):\n        self.send_signal(self.widget.Inputs.data, self.titanic)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertTrue(self.widget.Error.not_enough_attrs.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.not_enough_attrs.is_shown())\n\n    def test_input_subset_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:70])\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.assertEqual(len(self.widget.subset_indices), 7)\n        self.widget.controls.show_profiles.click()\n        self.widget.selection_changed(range(20))\n        self.assertEqual(len(self.widget.selection), 20)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsNone(self.widget.selection)\n\n    def test_select(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertIsNone(self.get_output(self.widget.Outputs.selected_data))\n\n        # Select 0:5\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Shift-select 10:15 (add 10:15 to selection)\n        indices = list(range(10, 15))\n        sel_indices.extend(indices)\n        with self.modifiers(Qt.ShiftModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Select 15:20\n        sel_indices = list(range(15, 20))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Control-select 10:17 (add 10:15, remove 15:17)\n        indices = list(range(10, 17))\n        sel_indices.extend(indices[:5])\n        sel_indices.remove(15)\n        sel_indices.remove(16)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.ControlModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Alt-select 15:30 (remove 17:20)\n        indices = list(range(15, 30))\n        sel_indices.remove(17)\n        sel_indices.remove(18)\n        sel_indices.remove(19)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.AltModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n    def test_saved_selection(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        mask = np.zeros(len(data) - 1, dtype=bool)\n        mask[::10] = True\n        self.widget.selection_changed(mask)\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), np.sum(mask))\n        np.testing.assert_equal(self.widget.graph.selection, w.graph.selection)\n        output = self.get_output(w.Outputs.selected_data, widget=w)\n        self.assertIsNotNone(output)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), 0)\n        self.assertIsNone(self.get_output(w.Outputs.selected_data, widget=w))\n\n    def test_selection_line(self):\n        event = Mock()\n        event.button.return_value = Qt.LeftButton\n        event.buttonDownPos.return_value = Point(0, 0)\n        event.pos.return_value = Point(1, 1)\n        event.isFinish.return_value = True\n\n        # drag a line before data is sent\n        self.widget.graph.view_box.mouseDragEvent(event)\n        self.assertIsNone(self.widget.selection)\n\n        # drag a line after data is sent\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        # set view-dependent click coordinates\n        pos_down, pos_up = QPointF(2.38, 4.84), QPointF(3.58, 4.76)\n        mapToParent = self.widget.graph.view_box.childGroup.mapToParent\n\n        event.buttonDownPos.return_value = mapToParent(pos_down)\n        event.pos.return_value = mapToParent(pos_up)\n\n        self.widget.graph.view_box.mouseDragEvent(event)\n        line = self.widget.graph.view_box.selection_line\n        self.assertFalse(line.line().isNull())\n\n        # click on the plot resets selection\n        self.assertEqual(len(self.widget.selection), 55)\n        self.widget.graph.view_box.mouseClickEvent(event)\n        self.assertListEqual(self.widget.selection, [])\n\n    @patch(\"Orange.widgets.visualize.owlineplot.SEL_MAX_INSTANCES\", 100)\n    def test_select_lines_enabled(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::2])\n        self.assertTrue(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(self.widget.graph.view_box._can_select)\n\n    @patch(\"Orange.widgets.visualize.owlineplot.MAX_FEATURES\", 2)\n    def test_max_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.graph_variables), 2)\n        self.assertTrue(self.widget.Information.too_many_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.too_many_features.is_shown())\n\n    def test_data_with_missing_values(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Information.hidden_instances.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.hidden_instances.is_shown())\n\n    def test_display_options(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10])\n        # Plot lines, range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        self.widget.controls.show_error.click()\n        # Plot range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        # Plot mean and error bars\n        self.widget.controls.show_range.click()\n        # Only show error bars is selected\n        self.widget.controls.show_mean.click()\n        self.assertTrue(self.widget.Warning.no_display_option.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.no_display_option.is_shown())\n\n    def test_group_view(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        model = self.widget.group_view.model()\n        self.assertEqual(len(model), 2)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), self.data.domain.class_var.name)\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), \"None\")\n\n    def test_group_var_none(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        index = self.widget.group_view.model().index(0)\n        self.widget.group_view.setCurrentIndex(index)\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.data.domain.attributes))\n        self.assertEqual(n, len(self.data))\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_datasets(self):\n        for ds in datasets.datasets():\n            self.send_signal(self.widget.Inputs.data, ds)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_valid_data.is_shown())\n\n    def test_none_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:0])\n        self.widget.controls.show_profiles.click()\n\n    def test_plot_subset(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        w.graph.addItem = Mock()\n\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        w.graph.addItem.assert_called()\n        w.graph.addItem.reset_mock()\n\n        # don't show subset instances\n        self.send_signal(w.Inputs.data_subset, self.data[::10], widget=w)\n        w.graph.addItem.assert_not_called()\n\n        # show subset instances\n        w.controls.show_profiles.setChecked(True)\n        w.graph.addItem.assert_called()\n\n    def test_plot_only_mean(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        curves = [i for i in w.graph.items() if isinstance(i, PlotCurveItem)]\n        self.assertEqual(len(curves), 3)\n\n    def test_sparse_data(self):\n        table = Table(\"iris\").to_sparse()\n        self.assertTrue(sp.issparse(table.X))\n        self.send_signal(self.widget.Inputs.data, table)\n        self.send_signal(self.widget.Inputs.data_subset, table[::30])\n        self.assertEqual(len(self.widget.subset_indices), 5)\n\n    def test_send_report(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.report_button.click()\n        self.send_signal(self.widget.Inputs.data, None)\n        self.widget.report_button.click()\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget, 'unconditional_commit') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.data, self.titanic)\n            commit.assert_called()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        data = self.housing\n        self.send_signal(self.widget.Inputs.data, data)\n        summary, details = f\"{len(data)}\", format_summary_details(data)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        output = self.get_output(self.widget.Outputs.selected_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n    def test_visual_settings(self, timeout=DEFAULT_TIMEOUT):\n        graph = self.widget.graph\n        font = QFont()\n        font.setItalic(True)\n        font.setFamily(\"Helvetica\")\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_finished(timeout=timeout)\n\n        key, value = (\"Fonts\", \"Font family\", \"Font family\"), \"Helvetica\"\n        self.widget.set_visual_settings(key, value)\n\n        key, value = (\"Fonts\", \"Title\", \"Font size\"), 20\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(20)\n        self.assertFontEqual(graph.parameter_setter.title_item.item.font(), font)\n\n        key, value = (\"Fonts\", \"Axis title\", \"Font size\"), 14\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Axis title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(14)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.label.font(), font)\n\n        key, value = ('Fonts', 'Axis ticks', 'Font size'), 15\n        self.widget.set_visual_settings(key, value)\n        key, value = ('Fonts', 'Axis ticks', 'Italic'), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(15)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.style[\"tickFont\"], font)\n\n        key, value = (\"Fonts\", \"Legend\", \"Font size\"), 16\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Legend\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(16)\n        legend_item = list(graph.parameter_setter.legend_items)[0]\n        self.assertFontEqual(legend_item[1].item.font(), font)\n\n        key, value = (\"Annotations\", \"Title\", \"Title\"), \"Foo\"\n        self.widget.set_visual_settings(key, value)\n        self.assertEqual(graph.parameter_setter.title_item.item.toPlainText(), \"Foo\")\n        self.assertEqual(graph.parameter_setter.title_item.text, \"Foo\")\n\n        key, value = (\"Annotations\", \"x-axis title\", \"Title\"), \"Foo2\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"bottom\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo2\")\n        self.assertEqual(axis.labelText, \"Foo2\")\n\n        key, value = (\"Annotations\", \"y-axis title\", \"Title\"), \"Foo3\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"left\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo3\")\n        self.assertEqual(axis.labelText, \"Foo3\")\n\n    def assertFontEqual(self, font1, font2):\n        self.assertEqual(font1.family(), font2.family())\n        self.assertEqual(font1.pointSize(), font2.pointSize())\n        self.assertEqual(font1.italic(), font2.italic())\n\n\nclass TestSegmentsIntersection(unittest.TestCase):\n    def test_ccw(self):\n        a = np.array([[4, 1], [1, 1]])\n        b = np.array([[3, 2], [2, 2]])\n        c = np.array([[2, 1], [3, 3]])\n        np.testing.assert_array_equal(np.array([True, False]), ccw(a, b, c))\n\n    def test_intersects(self):\n        a = np.array([1, 0])\n        b = np.array([2, -1])\n        c = np.array([[2, -2], [1, -1], [0, 0], [1, -0.01]])\n        d = np.array([[4, 0], [2, 0], [-1, -1], [2, 0]])\n        np.testing.assert_array_equal(np.array([False, True, False, True]),\n                                      intersects(a, b, c, d))\n\n    def test_lines_intersection(self):\n        a = np.array([1, 0])\n        b = np.array([2, -1])\n        # create data with four instances and three features\n        x = np.array([[2, 4, 4], [1, 2, 2], [0, -1, 2], [1, 2, 2]])\n        y = np.array([[-2, 0, 1], [-1, 0, 1], [0, -1, 0], [-0.01, 0, 3]])\n        table = np.array([np.vstack((x[:, i], y[:, i])).T\n                          for i in range(y.shape[1])])\n        i = line_intersects_profiles(a, b, table)\n        np.testing.assert_array_equal(np.array([False, True, True, True]), i)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,protected-access\nimport random\nimport unittest\nfrom unittest.mock import patch, Mock\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QPointF\nfrom AnyQt.QtGui import QFont\n\nimport pyqtgraph\nfrom pyqtgraph import PlotCurveItem\nfrom pyqtgraph.Point import Point\n\nfrom orangewidget.tests.base import DEFAULT_TIMEOUT\n\nfrom orangewidget.widget import StateInfo\n\nfrom Orange.data import Table\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, datasets\n)\nfrom Orange.widgets.visualize.owlineplot import (\n    OWLinePlot, ccw, intersects, line_intersects_profiles\n)\nfrom Orange.widgets.utils.state_summary import format_summary_details\n\n\nclass TestOWLinePLot(WidgetTest, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinePlot)\n        self.titanic = Table(\"titanic\")\n        self.housing = Table(\"housing\")\n\n    def _select_data(self):\n        random.seed(42)\n        indices = random.sample(range(0, len(self.data)), 20)\n        self.widget.selection_changed(indices)\n        return self.widget.selection\n\n    def test_input_data(self):\n        no_data = \"No data on input\"\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 2)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n\n    def test_input_continuous_class(self):\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n\n    def test_input_discrete_features(self):\n        self.send_signal(self.widget.Inputs.data, self.titanic)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertTrue(self.widget.Error.not_enough_attrs.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.not_enough_attrs.is_shown())\n\n    def test_input_subset_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:70])\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.assertEqual(len(self.widget.subset_indices), 7)\n        self.widget.controls.show_profiles.click()\n        self.widget.selection_changed(range(20))\n        self.assertEqual(len(self.widget.selection), 20)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsNone(self.widget.selection)\n\n    def test_select(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertIsNone(self.get_output(self.widget.Outputs.selected_data))\n\n        # Select 0:5\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Shift-select 10:15 (add 10:15 to selection)\n        indices = list(range(10, 15))\n        sel_indices.extend(indices)\n        with self.modifiers(Qt.ShiftModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Select 15:20\n        sel_indices = list(range(15, 20))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Control-select 10:17 (add 10:15, remove 15:17)\n        indices = list(range(10, 17))\n        sel_indices.extend(indices[:5])\n        sel_indices.remove(15)\n        sel_indices.remove(16)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.ControlModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Alt-select 15:30 (remove 17:20)\n        indices = list(range(15, 30))\n        sel_indices.remove(17)\n        sel_indices.remove(18)\n        sel_indices.remove(19)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.AltModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n    def test_saved_selection(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        mask = np.zeros(len(data) - 1, dtype=bool)\n        mask[::10] = True\n        self.widget.selection_changed(mask)\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), np.sum(mask))\n        np.testing.assert_equal(self.widget.graph.selection, w.graph.selection)\n        output = self.get_output(w.Outputs.selected_data, widget=w)\n        self.assertIsNotNone(output)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), 0)\n        self.assertIsNone(self.get_output(w.Outputs.selected_data, widget=w))\n\n    def test_selection_line(self):\n        event = Mock()\n        event.button.return_value = Qt.LeftButton\n        event.buttonDownPos.return_value = Point(0, 0)\n        event.pos.return_value = Point(1, 1)\n        event.isFinish.return_value = True\n\n        # drag a line before data is sent\n        self.widget.graph.view_box.mouseDragEvent(event)\n        self.assertIsNone(self.widget.selection)\n\n        # drag a line after data is sent\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        # set view-dependent click coordinates\n        pos_down, pos_up = QPointF(2.38, 4.84), QPointF(3.58, 4.76)\n        mapToParent = self.widget.graph.view_box.childGroup.mapToParent\n\n        event.buttonDownPos.return_value = mapToParent(pos_down)\n        event.pos.return_value = mapToParent(pos_up)\n\n        self.widget.graph.view_box.mouseDragEvent(event)\n        line = self.widget.graph.view_box.selection_line\n        self.assertFalse(line.line().isNull())\n\n        # click on the plot resets selection\n        self.assertEqual(len(self.widget.selection), 55)\n        self.widget.graph.view_box.mouseClickEvent(event)\n        self.assertListEqual(self.widget.selection, [])\n\n    @patch(\"Orange.widgets.visualize.owlineplot.SEL_MAX_INSTANCES\", 100)\n    def test_select_lines_enabled(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::2])\n        self.assertTrue(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(self.widget.graph.view_box._can_select)\n\n    @patch(\"Orange.widgets.visualize.owlineplot.MAX_FEATURES\", 2)\n    def test_max_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.graph_variables), 2)\n        self.assertTrue(self.widget.Information.too_many_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.too_many_features.is_shown())\n\n    def test_data_with_missing_values(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Information.hidden_instances.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.hidden_instances.is_shown())\n\n    def test_display_options(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10])\n        # Plot lines, range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        self.widget.controls.show_error.click()\n        # Plot range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        # Plot mean and error bars\n        self.widget.controls.show_range.click()\n        # Only show error bars is selected\n        self.widget.controls.show_mean.click()\n        self.assertTrue(self.widget.Warning.no_display_option.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.no_display_option.is_shown())\n\n    def test_group_view(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        model = self.widget.group_view.model()\n        self.assertEqual(len(model), 2)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), self.data.domain.class_var.name)\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), \"None\")\n\n    def test_group_var_none(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        index = self.widget.group_view.model().index(0)\n        self.widget.group_view.setCurrentIndex(index)\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.data.domain.attributes))\n        self.assertEqual(n, len(self.data))\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_group_var_none_single_instance(self):\n        self.send_signal(self.widget.Inputs.data, self.housing[:1])\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.housing.domain.attributes))\n        self.assertEqual(n, 1)\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_datasets(self):\n        for ds in datasets.datasets():\n            self.send_signal(self.widget.Inputs.data, ds)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_valid_data.is_shown())\n\n    def test_none_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:0])\n        self.widget.controls.show_profiles.click()\n\n    def test_plot_subset(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        w.graph.addItem = Mock()\n\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        w.graph.addItem.assert_called()\n        w.graph.addItem.reset_mock()\n\n        # don't show subset instances\n        self.send_signal(w.Inputs.data_subset, self.data[::10], widget=w)\n        w.graph.addItem.assert_not_called()\n\n        # show subset instances\n        w.controls.show_profiles.setChecked(True)\n        w.graph.addItem.assert_called()\n\n    def test_plot_only_mean(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        curves = [i for i in w.graph.items() if isinstance(i, PlotCurveItem)]\n        self.assertEqual(len(curves), 3)\n\n    def test_sparse_data(self):\n        table = Table(\"iris\").to_sparse()\n        self.assertTrue(sp.issparse(table.X))\n        self.send_signal(self.widget.Inputs.data, table)\n        self.send_signal(self.widget.Inputs.data_subset, table[::30])\n        self.assertEqual(len(self.widget.subset_indices), 5)\n\n    def test_send_report(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.report_button.click()\n        self.send_signal(self.widget.Inputs.data, None)\n        self.widget.report_button.click()\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget, 'unconditional_commit') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.data, self.titanic)\n            commit.assert_called()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        data = self.housing\n        self.send_signal(self.widget.Inputs.data, data)\n        summary, details = f\"{len(data)}\", format_summary_details(data)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        output = self.get_output(self.widget.Outputs.selected_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n    def test_visual_settings(self, timeout=DEFAULT_TIMEOUT):\n        graph = self.widget.graph\n        font = QFont()\n        font.setItalic(True)\n        font.setFamily(\"Helvetica\")\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_finished(timeout=timeout)\n\n        key, value = (\"Fonts\", \"Font family\", \"Font family\"), \"Helvetica\"\n        self.widget.set_visual_settings(key, value)\n\n        key, value = (\"Fonts\", \"Title\", \"Font size\"), 20\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(20)\n        self.assertFontEqual(graph.parameter_setter.title_item.item.font(), font)\n\n        key, value = (\"Fonts\", \"Axis title\", \"Font size\"), 14\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Axis title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(14)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.label.font(), font)\n\n        key, value = ('Fonts', 'Axis ticks', 'Font size'), 15\n        self.widget.set_visual_settings(key, value)\n        key, value = ('Fonts', 'Axis ticks', 'Italic'), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(15)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.style[\"tickFont\"], font)\n\n        key, value = (\"Fonts\", \"Legend\", \"Font size\"), 16\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Legend\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(16)\n        legend_item = list(graph.parameter_setter.legend_items)[0]\n        self.assertFontEqual(legend_item[1].item.font(), font)\n\n        key, value = (\"Annotations\", \"Title\", \"Title\"), \"Foo\"\n        self.widget.set_visual_settings(key, value)\n        self.assertEqual(graph.parameter_setter.title_item.item.toPlainText(), \"Foo\")\n        self.assertEqual(graph.parameter_setter.title_item.text, \"Foo\")\n\n        key, value = (\"Annotations\", \"x-axis title\", \"Title\"), \"Foo2\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"bottom\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo2\")\n        self.assertEqual(axis.labelText, \"Foo2\")\n\n        key, value = (\"Annotations\", \"y-axis title\", \"Title\"), \"Foo3\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"left\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo3\")\n        self.assertEqual(axis.labelText, \"Foo3\")\n\n    def assertFontEqual(self, font1, font2):\n        self.assertEqual(font1.family(), font2.family())\n        self.assertEqual(font1.pointSize(), font2.pointSize())\n        self.assertEqual(font1.italic(), font2.italic())\n\n\nclass TestSegmentsIntersection(unittest.TestCase):\n    def test_ccw(self):\n        a = np.array([[4, 1], [1, 1]])\n        b = np.array([[3, 2], [2, 2]])\n        c = np.array([[2, 1], [3, 3]])\n        np.testing.assert_array_equal(np.array([True, False]), ccw(a, b, c))\n\n    def test_intersects(self):\n        a = np.array([1, 0])\n        b = np.array([2, -1])\n        c = np.array([[2, -2], [1, -1], [0, 0], [1, -0.01]])\n        d = np.array([[4, 0], [2, 0], [-1, -1], [2, 0]])\n        np.testing.assert_array_equal(np.array([False, True, False, True]),\n                                      intersects(a, b, c, d))\n\n    def test_lines_intersection(self):\n        a = np.array([1, 0])\n        b = np.array([2, -1])\n        # create data with four instances and three features\n        x = np.array([[2, 4, 4], [1, 2, 2], [0, -1, 2], [1, 2, 2]])\n        y = np.array([[-2, 0, 1], [-1, 0, 1], [0, -1, 0], [-0.01, 0, 3]])\n        table = np.array([np.vstack((x[:, i], y[:, i])).T\n                          for i in range(y.shape[1])])\n        i = line_intersects_profiles(a, b, table)\n        np.testing.assert_array_equal(np.array([False, True, True, True]), i)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/visualize/tests/test_owlineplot.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "e82a223ea",
                "new_commit_hash": "8260a1f04",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/visualize/tests/test_owlineplot.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/visualize/tests/test_owlineplot.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 232,
                            "length": 6
                        },
                        "new_range": {
                            "start": 232,
                            "length": 14
                        },
                        "section": "class TestOWLinePLot(WidgetTest, WidgetOutputsTestMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.assertEqual(p, 2)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.graph.legend.isVisible())",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_group_var_none_single_instance(self):",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, self.housing[:1])",
                                "type": "added"
                            },
                            {
                                "content": "        m, n, p = self.widget.graph.view_box._profile_items.shape",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(m, len(self.housing.domain.attributes))",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(n, 1)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(p, 2)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.graph.legend.isVisible())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_datasets(self):",
                                "type": "context"
                            },
                            {
                                "content": "        for ds in datasets.datasets():",
                                "type": "context"
                            },
                            {
                                "content": "            self.send_signal(self.widget.Inputs.data, ds)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owlineplot.py",
                            "type": "class",
                            "name": "TestOWLinePLot",
                            "content": "class TestOWLinePLot(WidgetTest, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinePlot)\n        self.titanic = Table(\"titanic\")\n        self.housing = Table(\"housing\")\n\n    def _select_data(self):\n        random.seed(42)\n        indices = random.sample(range(0, len(self.data)), 20)\n        self.widget.selection_changed(indices)\n        return self.widget.selection\n\n    def test_input_data(self):\n        no_data = \"No data on input\"\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 2)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n\n    def test_input_continuous_class(self):\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n\n    def test_input_discrete_features(self):\n        self.send_signal(self.widget.Inputs.data, self.titanic)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertTrue(self.widget.Error.not_enough_attrs.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.not_enough_attrs.is_shown())\n\n    def test_input_subset_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:70])\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.assertEqual(len(self.widget.subset_indices), 7)\n        self.widget.controls.show_profiles.click()\n        self.widget.selection_changed(range(20))\n        self.assertEqual(len(self.widget.selection), 20)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsNone(self.widget.selection)\n\n    def test_select(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertIsNone(self.get_output(self.widget.Outputs.selected_data))\n\n        # Select 0:5\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Shift-select 10:15 (add 10:15 to selection)\n        indices = list(range(10, 15))\n        sel_indices.extend(indices)\n        with self.modifiers(Qt.ShiftModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Select 15:20\n        sel_indices = list(range(15, 20))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Control-select 10:17 (add 10:15, remove 15:17)\n        indices = list(range(10, 17))\n        sel_indices.extend(indices[:5])\n        sel_indices.remove(15)\n        sel_indices.remove(16)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.ControlModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Alt-select 15:30 (remove 17:20)\n        indices = list(range(15, 30))\n        sel_indices.remove(17)\n        sel_indices.remove(18)\n        sel_indices.remove(19)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.AltModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n    def test_saved_selection(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        mask = np.zeros(len(data) - 1, dtype=bool)\n        mask[::10] = True\n        self.widget.selection_changed(mask)\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), np.sum(mask))\n        np.testing.assert_equal(self.widget.graph.selection, w.graph.selection)\n        output = self.get_output(w.Outputs.selected_data, widget=w)\n        self.assertIsNotNone(output)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), 0)\n        self.assertIsNone(self.get_output(w.Outputs.selected_data, widget=w))\n\n    def test_selection_line(self):\n        event = Mock()\n        event.button.return_value = Qt.LeftButton\n        event.buttonDownPos.return_value = Point(0, 0)\n        event.pos.return_value = Point(1, 1)\n        event.isFinish.return_value = True\n\n        # drag a line before data is sent\n        self.widget.graph.view_box.mouseDragEvent(event)\n        self.assertIsNone(self.widget.selection)\n\n        # drag a line after data is sent\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        # set view-dependent click coordinates\n        pos_down, pos_up = QPointF(2.38, 4.84), QPointF(3.58, 4.76)\n        mapToParent = self.widget.graph.view_box.childGroup.mapToParent\n\n        event.buttonDownPos.return_value = mapToParent(pos_down)\n        event.pos.return_value = mapToParent(pos_up)\n\n        self.widget.graph.view_box.mouseDragEvent(event)\n        line = self.widget.graph.view_box.selection_line\n        self.assertFalse(line.line().isNull())\n\n        # click on the plot resets selection\n        self.assertEqual(len(self.widget.selection), 55)\n        self.widget.graph.view_box.mouseClickEvent(event)\n        self.assertListEqual(self.widget.selection, [])\n\n    @patch(\"Orange.widgets.visualize.owlineplot.SEL_MAX_INSTANCES\", 100)\n    def test_select_lines_enabled(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::2])\n        self.assertTrue(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(self.widget.graph.view_box._can_select)\n\n    @patch(\"Orange.widgets.visualize.owlineplot.MAX_FEATURES\", 2)\n    def test_max_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.graph_variables), 2)\n        self.assertTrue(self.widget.Information.too_many_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.too_many_features.is_shown())\n\n    def test_data_with_missing_values(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Information.hidden_instances.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.hidden_instances.is_shown())\n\n    def test_display_options(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10])\n        # Plot lines, range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        self.widget.controls.show_error.click()\n        # Plot range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        # Plot mean and error bars\n        self.widget.controls.show_range.click()\n        # Only show error bars is selected\n        self.widget.controls.show_mean.click()\n        self.assertTrue(self.widget.Warning.no_display_option.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.no_display_option.is_shown())\n\n    def test_group_view(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        model = self.widget.group_view.model()\n        self.assertEqual(len(model), 2)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), self.data.domain.class_var.name)\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), \"None\")\n\n    def test_group_var_none(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        index = self.widget.group_view.model().index(0)\n        self.widget.group_view.setCurrentIndex(index)\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.data.domain.attributes))\n        self.assertEqual(n, len(self.data))\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_group_var_none_single_instance(self):\n        self.send_signal(self.widget.Inputs.data, self.housing[:1])\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.housing.domain.attributes))\n        self.assertEqual(n, 1)\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_datasets(self):\n        for ds in datasets.datasets():\n            self.send_signal(self.widget.Inputs.data, ds)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_valid_data.is_shown())\n\n    def test_none_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:0])\n        self.widget.controls.show_profiles.click()\n\n    def test_plot_subset(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        w.graph.addItem = Mock()\n\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        w.graph.addItem.assert_called()\n        w.graph.addItem.reset_mock()\n\n        # don't show subset instances\n        self.send_signal(w.Inputs.data_subset, self.data[::10], widget=w)\n        w.graph.addItem.assert_not_called()\n\n        # show subset instances\n        w.controls.show_profiles.setChecked(True)\n        w.graph.addItem.assert_called()\n\n    def test_plot_only_mean(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        curves = [i for i in w.graph.items() if isinstance(i, PlotCurveItem)]\n        self.assertEqual(len(curves), 3)\n\n    def test_sparse_data(self):\n        table = Table(\"iris\").to_sparse()\n        self.assertTrue(sp.issparse(table.X))\n        self.send_signal(self.widget.Inputs.data, table)\n        self.send_signal(self.widget.Inputs.data_subset, table[::30])\n        self.assertEqual(len(self.widget.subset_indices), 5)\n\n    def test_send_report(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.report_button.click()\n        self.send_signal(self.widget.Inputs.data, None)\n        self.widget.report_button.click()\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget, 'unconditional_commit') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.data, self.titanic)\n            commit.assert_called()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        data = self.housing\n        self.send_signal(self.widget.Inputs.data, data)\n        summary, details = f\"{len(data)}\", format_summary_details(data)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        output = self.get_output(self.widget.Outputs.selected_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n    def test_visual_settings(self, timeout=DEFAULT_TIMEOUT):\n        graph = self.widget.graph\n        font = QFont()\n        font.setItalic(True)\n        font.setFamily(\"Helvetica\")\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_finished(timeout=timeout)\n\n        key, value = (\"Fonts\", \"Font family\", \"Font family\"), \"Helvetica\"\n        self.widget.set_visual_settings(key, value)\n\n        key, value = (\"Fonts\", \"Title\", \"Font size\"), 20\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(20)\n        self.assertFontEqual(graph.parameter_setter.title_item.item.font(), font)\n\n        key, value = (\"Fonts\", \"Axis title\", \"Font size\"), 14\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Axis title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(14)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.label.font(), font)\n\n        key, value = ('Fonts', 'Axis ticks', 'Font size'), 15\n        self.widget.set_visual_settings(key, value)\n        key, value = ('Fonts', 'Axis ticks', 'Italic'), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(15)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.style[\"tickFont\"], font)\n\n        key, value = (\"Fonts\", \"Legend\", \"Font size\"), 16\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Legend\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(16)\n        legend_item = list(graph.parameter_setter.legend_items)[0]\n        self.assertFontEqual(legend_item[1].item.font(), font)\n\n        key, value = (\"Annotations\", \"Title\", \"Title\"), \"Foo\"\n        self.widget.set_visual_settings(key, value)\n        self.assertEqual(graph.parameter_setter.title_item.item.toPlainText(), \"Foo\")\n        self.assertEqual(graph.parameter_setter.title_item.text, \"Foo\")\n\n        key, value = (\"Annotations\", \"x-axis title\", \"Title\"), \"Foo2\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"bottom\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo2\")\n        self.assertEqual(axis.labelText, \"Foo2\")\n\n        key, value = (\"Annotations\", \"y-axis title\", \"Title\"), \"Foo3\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"left\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo3\")\n        self.assertEqual(axis.labelText, \"Foo3\")\n\n    def assertFontEqual(self, font1, font2):\n        self.assertEqual(font1.family(), font2.family())\n        self.assertEqual(font1.pointSize(), font2.pointSize())\n        self.assertEqual(font1.italic(), font2.italic())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 31,
                            "end_lineno": 390,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owlineplot.py",
                            "type": "method",
                            "name": "TestOWLinePLot.test_group_var_none_single_instance",
                            "content": "class TestOWLinePLot(WidgetTest, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinePlot)\n        self.titanic = Table(\"titanic\")\n        self.housing = Table(\"housing\")\n\n    def _select_data(self):\n        random.seed(42)\n        indices = random.sample(range(0, len(self.data)), 20)\n        self.widget.selection_changed(indices)\n        return self.widget.selection\n\n    def test_input_data(self):\n        no_data = \"No data on input\"\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 2)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n\n    def test_input_continuous_class(self):\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n\n    def test_input_discrete_features(self):\n        self.send_signal(self.widget.Inputs.data, self.titanic)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertTrue(self.widget.Error.not_enough_attrs.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.not_enough_attrs.is_shown())\n\n    def test_input_subset_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:70])\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.assertEqual(len(self.widget.subset_indices), 7)\n        self.widget.controls.show_profiles.click()\n        self.widget.selection_changed(range(20))\n        self.assertEqual(len(self.widget.selection), 20)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsNone(self.widget.selection)\n\n    def test_select(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertIsNone(self.get_output(self.widget.Outputs.selected_data))\n\n        # Select 0:5\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Shift-select 10:15 (add 10:15 to selection)\n        indices = list(range(10, 15))\n        sel_indices.extend(indices)\n        with self.modifiers(Qt.ShiftModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Select 15:20\n        sel_indices = list(range(15, 20))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Control-select 10:17 (add 10:15, remove 15:17)\n        indices = list(range(10, 17))\n        sel_indices.extend(indices[:5])\n        sel_indices.remove(15)\n        sel_indices.remove(16)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.ControlModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Alt-select 15:30 (remove 17:20)\n        indices = list(range(15, 30))\n        sel_indices.remove(17)\n        sel_indices.remove(18)\n        sel_indices.remove(19)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.AltModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n    def test_saved_selection(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        mask = np.zeros(len(data) - 1, dtype=bool)\n        mask[::10] = True\n        self.widget.selection_changed(mask)\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), np.sum(mask))\n        np.testing.assert_equal(self.widget.graph.selection, w.graph.selection)\n        output = self.get_output(w.Outputs.selected_data, widget=w)\n        self.assertIsNotNone(output)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), 0)\n        self.assertIsNone(self.get_output(w.Outputs.selected_data, widget=w))\n\n    def test_selection_line(self):\n        event = Mock()\n        event.button.return_value = Qt.LeftButton\n        event.buttonDownPos.return_value = Point(0, 0)\n        event.pos.return_value = Point(1, 1)\n        event.isFinish.return_value = True\n\n        # drag a line before data is sent\n        self.widget.graph.view_box.mouseDragEvent(event)\n        self.assertIsNone(self.widget.selection)\n\n        # drag a line after data is sent\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        # set view-dependent click coordinates\n        pos_down, pos_up = QPointF(2.38, 4.84), QPointF(3.58, 4.76)\n        mapToParent = self.widget.graph.view_box.childGroup.mapToParent\n\n        event.buttonDownPos.return_value = mapToParent(pos_down)\n        event.pos.return_value = mapToParent(pos_up)\n\n        self.widget.graph.view_box.mouseDragEvent(event)\n        line = self.widget.graph.view_box.selection_line\n        self.assertFalse(line.line().isNull())\n\n        # click on the plot resets selection\n        self.assertEqual(len(self.widget.selection), 55)\n        self.widget.graph.view_box.mouseClickEvent(event)\n        self.assertListEqual(self.widget.selection, [])\n\n    @patch(\"Orange.widgets.visualize.owlineplot.SEL_MAX_INSTANCES\", 100)\n    def test_select_lines_enabled(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::2])\n        self.assertTrue(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(self.widget.graph.view_box._can_select)\n\n    @patch(\"Orange.widgets.visualize.owlineplot.MAX_FEATURES\", 2)\n    def test_max_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.graph_variables), 2)\n        self.assertTrue(self.widget.Information.too_many_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.too_many_features.is_shown())\n\n    def test_data_with_missing_values(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Information.hidden_instances.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.hidden_instances.is_shown())\n\n    def test_display_options(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10])\n        # Plot lines, range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        self.widget.controls.show_error.click()\n        # Plot range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        # Plot mean and error bars\n        self.widget.controls.show_range.click()\n        # Only show error bars is selected\n        self.widget.controls.show_mean.click()\n        self.assertTrue(self.widget.Warning.no_display_option.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.no_display_option.is_shown())\n\n    def test_group_view(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        model = self.widget.group_view.model()\n        self.assertEqual(len(model), 2)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), self.data.domain.class_var.name)\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), \"None\")\n\n    def test_group_var_none(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        index = self.widget.group_view.model().index(0)\n        self.widget.group_view.setCurrentIndex(index)\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.data.domain.attributes))\n        self.assertEqual(n, len(self.data))\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_group_var_none_single_instance(self):\n        self.send_signal(self.widget.Inputs.data, self.housing[:1])\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.housing.domain.attributes))\n        self.assertEqual(n, 1)\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_datasets(self):\n        for ds in datasets.datasets():\n            self.send_signal(self.widget.Inputs.data, ds)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_valid_data.is_shown())\n\n    def test_none_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:0])\n        self.widget.controls.show_profiles.click()\n\n    def test_plot_subset(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        w.graph.addItem = Mock()\n\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        w.graph.addItem.assert_called()\n        w.graph.addItem.reset_mock()\n\n        # don't show subset instances\n        self.send_signal(w.Inputs.data_subset, self.data[::10], widget=w)\n        w.graph.addItem.assert_not_called()\n\n        # show subset instances\n        w.controls.show_profiles.setChecked(True)\n        w.graph.addItem.assert_called()\n\n    def test_plot_only_mean(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        curves = [i for i in w.graph.items() if isinstance(i, PlotCurveItem)]\n        self.assertEqual(len(curves), 3)\n\n    def test_sparse_data(self):\n        table = Table(\"iris\").to_sparse()\n        self.assertTrue(sp.issparse(table.X))\n        self.send_signal(self.widget.Inputs.data, table)\n        self.send_signal(self.widget.Inputs.data_subset, table[::30])\n        self.assertEqual(len(self.widget.subset_indices), 5)\n\n    def test_send_report(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.report_button.click()\n        self.send_signal(self.widget.Inputs.data, None)\n        self.widget.report_button.click()\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget, 'unconditional_commit') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.data, self.titanic)\n            commit.assert_called()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        data = self.housing\n        self.send_signal(self.widget.Inputs.data, data)\n        summary, details = f\"{len(data)}\", format_summary_details(data)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        output = self.get_output(self.widget.Outputs.selected_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n    def test_visual_settings(self, timeout=DEFAULT_TIMEOUT):\n        graph = self.widget.graph\n        font = QFont()\n        font.setItalic(True)\n        font.setFamily(\"Helvetica\")\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_finished(timeout=timeout)\n\n        key, value = (\"Fonts\", \"Font family\", \"Font family\"), \"Helvetica\"\n        self.widget.set_visual_settings(key, value)\n\n        key, value = (\"Fonts\", \"Title\", \"Font size\"), 20\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(20)\n        self.assertFontEqual(graph.parameter_setter.title_item.item.font(), font)\n\n        key, value = (\"Fonts\", \"Axis title\", \"Font size\"), 14\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Axis title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(14)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.label.font(), font)\n\n        key, value = ('Fonts', 'Axis ticks', 'Font size'), 15\n        self.widget.set_visual_settings(key, value)\n        key, value = ('Fonts', 'Axis ticks', 'Italic'), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(15)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.style[\"tickFont\"], font)\n\n        key, value = (\"Fonts\", \"Legend\", \"Font size\"), 16\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Legend\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(16)\n        legend_item = list(graph.parameter_setter.legend_items)[0]\n        self.assertFontEqual(legend_item[1].item.font(), font)\n\n        key, value = (\"Annotations\", \"Title\", \"Title\"), \"Foo\"\n        self.widget.set_visual_settings(key, value)\n        self.assertEqual(graph.parameter_setter.title_item.item.toPlainText(), \"Foo\")\n        self.assertEqual(graph.parameter_setter.title_item.text, \"Foo\")\n\n        key, value = (\"Annotations\", \"x-axis title\", \"Title\"), \"Foo2\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"bottom\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo2\")\n        self.assertEqual(axis.labelText, \"Foo2\")\n\n        key, value = (\"Annotations\", \"y-axis title\", \"Title\"), \"Foo3\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"left\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo3\")\n        self.assertEqual(axis.labelText, \"Foo3\")\n\n    def assertFontEqual(self, font1, font2):\n        self.assertEqual(font1.family(), font2.family())\n        self.assertEqual(font1.pointSize(), font2.pointSize())\n        self.assertEqual(font1.italic(), font2.italic())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 235,
                            "end_lineno": 241,
                            "parent": {
                                "file_name": "Orange/widgets/visualize/tests/test_owlineplot.py",
                                "type": "class",
                                "name": "TestOWLinePLot",
                                "content": "class TestOWLinePLot(WidgetTest, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinePlot)\n        self.titanic = Table(\"titanic\")\n        self.housing = Table(\"housing\")\n\n    def _select_data(self):\n        random.seed(42)\n        indices = random.sample(range(0, len(self.data)), 20)\n        self.widget.selection_changed(indices)\n        return self.widget.selection\n\n    def test_input_data(self):\n        no_data = \"No data on input\"\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 2)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n\n    def test_input_continuous_class(self):\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n\n    def test_input_discrete_features(self):\n        self.send_signal(self.widget.Inputs.data, self.titanic)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertTrue(self.widget.Error.not_enough_attrs.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.not_enough_attrs.is_shown())\n\n    def test_input_subset_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:70])\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.assertEqual(len(self.widget.subset_indices), 7)\n        self.widget.controls.show_profiles.click()\n        self.widget.selection_changed(range(20))\n        self.assertEqual(len(self.widget.selection), 20)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsNone(self.widget.selection)\n\n    def test_select(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertIsNone(self.get_output(self.widget.Outputs.selected_data))\n\n        # Select 0:5\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Shift-select 10:15 (add 10:15 to selection)\n        indices = list(range(10, 15))\n        sel_indices.extend(indices)\n        with self.modifiers(Qt.ShiftModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Select 15:20\n        sel_indices = list(range(15, 20))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Control-select 10:17 (add 10:15, remove 15:17)\n        indices = list(range(10, 17))\n        sel_indices.extend(indices[:5])\n        sel_indices.remove(15)\n        sel_indices.remove(16)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.ControlModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Alt-select 15:30 (remove 17:20)\n        indices = list(range(15, 30))\n        sel_indices.remove(17)\n        sel_indices.remove(18)\n        sel_indices.remove(19)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.AltModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n    def test_saved_selection(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        mask = np.zeros(len(data) - 1, dtype=bool)\n        mask[::10] = True\n        self.widget.selection_changed(mask)\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), np.sum(mask))\n        np.testing.assert_equal(self.widget.graph.selection, w.graph.selection)\n        output = self.get_output(w.Outputs.selected_data, widget=w)\n        self.assertIsNotNone(output)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), 0)\n        self.assertIsNone(self.get_output(w.Outputs.selected_data, widget=w))\n\n    def test_selection_line(self):\n        event = Mock()\n        event.button.return_value = Qt.LeftButton\n        event.buttonDownPos.return_value = Point(0, 0)\n        event.pos.return_value = Point(1, 1)\n        event.isFinish.return_value = True\n\n        # drag a line before data is sent\n        self.widget.graph.view_box.mouseDragEvent(event)\n        self.assertIsNone(self.widget.selection)\n\n        # drag a line after data is sent\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        # set view-dependent click coordinates\n        pos_down, pos_up = QPointF(2.38, 4.84), QPointF(3.58, 4.76)\n        mapToParent = self.widget.graph.view_box.childGroup.mapToParent\n\n        event.buttonDownPos.return_value = mapToParent(pos_down)\n        event.pos.return_value = mapToParent(pos_up)\n\n        self.widget.graph.view_box.mouseDragEvent(event)\n        line = self.widget.graph.view_box.selection_line\n        self.assertFalse(line.line().isNull())\n\n        # click on the plot resets selection\n        self.assertEqual(len(self.widget.selection), 55)\n        self.widget.graph.view_box.mouseClickEvent(event)\n        self.assertListEqual(self.widget.selection, [])\n\n    @patch(\"Orange.widgets.visualize.owlineplot.SEL_MAX_INSTANCES\", 100)\n    def test_select_lines_enabled(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::2])\n        self.assertTrue(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(self.widget.graph.view_box._can_select)\n\n    @patch(\"Orange.widgets.visualize.owlineplot.MAX_FEATURES\", 2)\n    def test_max_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.graph_variables), 2)\n        self.assertTrue(self.widget.Information.too_many_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.too_many_features.is_shown())\n\n    def test_data_with_missing_values(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Information.hidden_instances.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.hidden_instances.is_shown())\n\n    def test_display_options(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10])\n        # Plot lines, range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        self.widget.controls.show_error.click()\n        # Plot range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        # Plot mean and error bars\n        self.widget.controls.show_range.click()\n        # Only show error bars is selected\n        self.widget.controls.show_mean.click()\n        self.assertTrue(self.widget.Warning.no_display_option.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.no_display_option.is_shown())\n\n    def test_group_view(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        model = self.widget.group_view.model()\n        self.assertEqual(len(model), 2)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), self.data.domain.class_var.name)\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), \"None\")\n\n    def test_group_var_none(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        index = self.widget.group_view.model().index(0)\n        self.widget.group_view.setCurrentIndex(index)\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.data.domain.attributes))\n        self.assertEqual(n, len(self.data))\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_group_var_none_single_instance(self):\n        self.send_signal(self.widget.Inputs.data, self.housing[:1])\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.housing.domain.attributes))\n        self.assertEqual(n, 1)\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_datasets(self):\n        for ds in datasets.datasets():\n            self.send_signal(self.widget.Inputs.data, ds)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_valid_data.is_shown())\n\n    def test_none_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:0])\n        self.widget.controls.show_profiles.click()\n\n    def test_plot_subset(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        w.graph.addItem = Mock()\n\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        w.graph.addItem.assert_called()\n        w.graph.addItem.reset_mock()\n\n        # don't show subset instances\n        self.send_signal(w.Inputs.data_subset, self.data[::10], widget=w)\n        w.graph.addItem.assert_not_called()\n\n        # show subset instances\n        w.controls.show_profiles.setChecked(True)\n        w.graph.addItem.assert_called()\n\n    def test_plot_only_mean(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        curves = [i for i in w.graph.items() if isinstance(i, PlotCurveItem)]\n        self.assertEqual(len(curves), 3)\n\n    def test_sparse_data(self):\n        table = Table(\"iris\").to_sparse()\n        self.assertTrue(sp.issparse(table.X))\n        self.send_signal(self.widget.Inputs.data, table)\n        self.send_signal(self.widget.Inputs.data_subset, table[::30])\n        self.assertEqual(len(self.widget.subset_indices), 5)\n\n    def test_send_report(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.report_button.click()\n        self.send_signal(self.widget.Inputs.data, None)\n        self.widget.report_button.click()\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget, 'unconditional_commit') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.data, self.titanic)\n            commit.assert_called()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        data = self.housing\n        self.send_signal(self.widget.Inputs.data, data)\n        summary, details = f\"{len(data)}\", format_summary_details(data)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        output = self.get_output(self.widget.Outputs.selected_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n    def test_visual_settings(self, timeout=DEFAULT_TIMEOUT):\n        graph = self.widget.graph\n        font = QFont()\n        font.setItalic(True)\n        font.setFamily(\"Helvetica\")\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_finished(timeout=timeout)\n\n        key, value = (\"Fonts\", \"Font family\", \"Font family\"), \"Helvetica\"\n        self.widget.set_visual_settings(key, value)\n\n        key, value = (\"Fonts\", \"Title\", \"Font size\"), 20\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(20)\n        self.assertFontEqual(graph.parameter_setter.title_item.item.font(), font)\n\n        key, value = (\"Fonts\", \"Axis title\", \"Font size\"), 14\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Axis title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(14)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.label.font(), font)\n\n        key, value = ('Fonts', 'Axis ticks', 'Font size'), 15\n        self.widget.set_visual_settings(key, value)\n        key, value = ('Fonts', 'Axis ticks', 'Italic'), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(15)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.style[\"tickFont\"], font)\n\n        key, value = (\"Fonts\", \"Legend\", \"Font size\"), 16\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Legend\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(16)\n        legend_item = list(graph.parameter_setter.legend_items)[0]\n        self.assertFontEqual(legend_item[1].item.font(), font)\n\n        key, value = (\"Annotations\", \"Title\", \"Title\"), \"Foo\"\n        self.widget.set_visual_settings(key, value)\n        self.assertEqual(graph.parameter_setter.title_item.item.toPlainText(), \"Foo\")\n        self.assertEqual(graph.parameter_setter.title_item.text, \"Foo\")\n\n        key, value = (\"Annotations\", \"x-axis title\", \"Title\"), \"Foo2\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"bottom\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo2\")\n        self.assertEqual(axis.labelText, \"Foo2\")\n\n        key, value = (\"Annotations\", \"y-axis title\", \"Title\"), \"Foo3\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"left\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo3\")\n        self.assertEqual(axis.labelText, \"Foo3\")\n\n    def assertFontEqual(self, font1, font2):\n        self.assertEqual(font1.family(), font2.family())\n        self.assertEqual(font1.pointSize(), font2.pointSize())\n        self.assertEqual(font1.italic(), font2.italic())",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 31,
                                "end_lineno": 390,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "b20ecae853031b1b26ebced94491d2cefd4c0b7f^",
    "new_commit_hash": "b20ecae853031b1b26ebced94491d2cefd4c0b7f",
    "commit_message": "Line Plot: Single instance input fix",
    "commit_date": "2021-04-22T09:39:22+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "b20ecae853031b1b26ebced94491d2cefd4c0b7f",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,protected-access\nimport random\nimport unittest\nfrom unittest.mock import patch, Mock\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QPointF\nfrom AnyQt.QtGui import QFont\n\nimport pyqtgraph\nfrom pyqtgraph import PlotCurveItem\nfrom pyqtgraph.Point import Point\n\nfrom orangewidget.tests.base import DEFAULT_TIMEOUT\n\nfrom orangewidget.widget import StateInfo\n\nfrom Orange.data import Table\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, datasets\n)\nfrom Orange.widgets.visualize.owlineplot import (\n    OWLinePlot, ccw, intersects, line_intersects_profiles\n)\nfrom Orange.widgets.utils.state_summary import format_summary_details\n\n\nclass TestOWLinePLot(WidgetTest, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinePlot)\n        self.titanic = Table(\"titanic\")\n        self.housing = Table(\"housing\")\n\n    def _select_data(self):\n        random.seed(42)\n        indices = random.sample(range(0, len(self.data)), 20)\n        self.widget.selection_changed(indices)\n        return self.widget.selection\n\n    def test_input_data(self):\n        no_data = \"No data on input\"\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 2)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertEqual(self.widget.info._StateInfo__input_summary.details, no_data)\n\n    def test_input_continuous_class(self):\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n\n    def test_input_discrete_features(self):\n        self.send_signal(self.widget.Inputs.data, self.titanic)\n        self.assertEqual(self.widget.group_view.model().rowCount(), 1)\n        self.assertTrue(self.widget.Error.not_enough_attrs.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.not_enough_attrs.is_shown())\n\n    def test_input_subset_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:70])\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.assertEqual(len(self.widget.subset_indices), 7)\n        self.widget.controls.show_profiles.click()\n        self.widget.selection_changed(range(20))\n        self.assertEqual(len(self.widget.selection), 20)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsNone(self.widget.selection)\n\n    def test_select(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertIsNone(self.get_output(self.widget.Outputs.selected_data))\n\n        # Select 0:5\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Shift-select 10:15 (add 10:15 to selection)\n        indices = list(range(10, 15))\n        sel_indices.extend(indices)\n        with self.modifiers(Qt.ShiftModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Select 15:20\n        sel_indices = list(range(15, 20))\n        self.widget.selection_changed(sel_indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Control-select 10:17 (add 10:15, remove 15:17)\n        indices = list(range(10, 17))\n        sel_indices.extend(indices[:5])\n        sel_indices.remove(15)\n        sel_indices.remove(16)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.ControlModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n        # Alt-select 15:30 (remove 17:20)\n        indices = list(range(15, 30))\n        sel_indices.remove(17)\n        sel_indices.remove(18)\n        sel_indices.remove(19)\n        sel_indices = sorted(sel_indices)\n        with self.modifiers(Qt.AltModifier):\n            self.widget.selection_changed(indices)\n        selected = self.get_output(self.widget.Outputs.selected_data)\n        np.testing.assert_array_equal(selected.X, self.data[sel_indices].X)\n\n    def test_saved_selection(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        mask = np.zeros(len(data) - 1, dtype=bool)\n        mask[::10] = True\n        self.widget.selection_changed(mask)\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), np.sum(mask))\n        np.testing.assert_equal(self.widget.graph.selection, w.graph.selection)\n        output = self.get_output(w.Outputs.selected_data, widget=w)\n        self.assertIsNotNone(output)\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertEqual(len(w.graph.selection), 0)\n        self.assertIsNone(self.get_output(w.Outputs.selected_data, widget=w))\n\n    def test_selection_line(self):\n        event = Mock()\n        event.button.return_value = Qt.LeftButton\n        event.buttonDownPos.return_value = Point(0, 0)\n        event.pos.return_value = Point(1, 1)\n        event.isFinish.return_value = True\n\n        # drag a line before data is sent\n        self.widget.graph.view_box.mouseDragEvent(event)\n        self.assertIsNone(self.widget.selection)\n\n        # drag a line after data is sent\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        # set view-dependent click coordinates\n        pos_down, pos_up = QPointF(2.38, 4.84), QPointF(3.58, 4.76)\n        mapToParent = self.widget.graph.view_box.childGroup.mapToParent\n\n        event.buttonDownPos.return_value = mapToParent(pos_down)\n        event.pos.return_value = mapToParent(pos_up)\n\n        self.widget.graph.view_box.mouseDragEvent(event)\n        line = self.widget.graph.view_box.selection_line\n        self.assertFalse(line.line().isNull())\n\n        # click on the plot resets selection\n        self.assertEqual(len(self.widget.selection), 55)\n        self.widget.graph.view_box.mouseClickEvent(event)\n        self.assertListEqual(self.widget.selection, [])\n\n    @patch(\"Orange.widgets.visualize.owlineplot.SEL_MAX_INSTANCES\", 100)\n    def test_select_lines_enabled(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::2])\n        self.assertTrue(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.graph.view_box._can_select)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(self.widget.graph.view_box._can_select)\n\n    @patch(\"Orange.widgets.visualize.owlineplot.MAX_FEATURES\", 2)\n    def test_max_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.graph_variables), 2)\n        self.assertTrue(self.widget.Information.too_many_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.too_many_features.is_shown())\n\n    def test_data_with_missing_values(self):\n        data = self.data.copy()\n        data[0, 0] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Information.hidden_instances.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Information.hidden_instances.is_shown())\n\n    def test_display_options(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10])\n        # Plot lines, range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        self.widget.controls.show_error.click()\n        # Plot range, mean and error bars\n        self.widget.controls.show_profiles.click()\n        # Plot mean and error bars\n        self.widget.controls.show_range.click()\n        # Only show error bars is selected\n        self.widget.controls.show_mean.click()\n        self.assertTrue(self.widget.Warning.no_display_option.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.no_display_option.is_shown())\n\n    def test_group_view(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        model = self.widget.group_view.model()\n        self.assertEqual(len(model), 2)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), self.data.domain.class_var.name)\n        self.send_signal(self.widget.Inputs.data, self.housing)\n        index = self.widget.group_view.selectedIndexes()[0]\n        self.assertEqual(model.data(index), \"None\")\n\n    def test_group_var_none(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        index = self.widget.group_view.model().index(0)\n        self.widget.group_view.setCurrentIndex(index)\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.data.domain.attributes))\n        self.assertEqual(n, len(self.data))\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_group_var_none_single_instance(self):\n        self.send_signal(self.widget.Inputs.data, self.housing[:1])\n        m, n, p = self.widget.graph.view_box._profile_items.shape\n        self.assertEqual(m, len(self.housing.domain.attributes))\n        self.assertEqual(n, 1)\n        self.assertEqual(p, 2)\n        self.assertFalse(self.widget.graph.legend.isVisible())\n\n    def test_datasets(self):\n        for ds in datasets.datasets():\n            self.send_signal(self.widget.Inputs.data, ds)\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_valid_data.is_shown())\n\n    def test_none_data(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:0])\n        self.widget.controls.show_profiles.click()\n\n    def test_plot_subset(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        w.graph.addItem = Mock()\n\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        w.graph.addItem.assert_called()\n        w.graph.addItem.reset_mock()\n\n        # don't show subset instances\n        self.send_signal(w.Inputs.data_subset, self.data[::10], widget=w)\n        w.graph.addItem.assert_not_called()\n\n        # show subset instances\n        w.controls.show_profiles.setChecked(True)\n        w.graph.addItem.assert_called()\n\n    def test_plot_only_mean(self):\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        settings[\"show_range\"] = False\n        w = self.create_widget(OWLinePlot, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        curves = [i for i in w.graph.items() if isinstance(i, PlotCurveItem)]\n        self.assertEqual(len(curves), 3)\n\n    def test_sparse_data(self):\n        table = Table(\"iris\").to_sparse()\n        self.assertTrue(sp.issparse(table.X))\n        self.send_signal(self.widget.Inputs.data, table)\n        self.send_signal(self.widget.Inputs.data_subset, table[::30])\n        self.assertEqual(len(self.widget.subset_indices), 5)\n\n    def test_send_report(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.report_button.click()\n        self.send_signal(self.widget.Inputs.data, None)\n        self.widget.report_button.click()\n\n    def test_unconditional_commit_on_new_signal(self):\n        with patch.object(self.widget, 'unconditional_commit') as commit:\n            self.widget.auto_commit = False\n            commit.reset_mock()\n            self.send_signal(self.widget.Inputs.data, self.titanic)\n            commit.assert_called()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        info = self.widget.info\n        no_input, no_output = \"No data on input\", \"No data on output\"\n\n        data = self.housing\n        self.send_signal(self.widget.Inputs.data, data)\n        summary, details = f\"{len(data)}\", format_summary_details(data)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n        sel_indices = list(range(5))\n        self.widget.selection_changed(sel_indices)\n        output = self.get_output(self.widget.Outputs.selected_data)\n        summary, details = f\"{len(output)}\", format_summary_details(output)\n        self.assertEqual(info._StateInfo__output_summary.brief, summary)\n        self.assertEqual(info._StateInfo__output_summary.details, details)\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertIsInstance(info._StateInfo__input_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n        self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)\n        self.assertEqual(info._StateInfo__output_summary.details, no_output)\n\n    def test_visual_settings(self, timeout=DEFAULT_TIMEOUT):\n        graph = self.widget.graph\n        font = QFont()\n        font.setItalic(True)\n        font.setFamily(\"Helvetica\")\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_finished(timeout=timeout)\n\n        key, value = (\"Fonts\", \"Font family\", \"Font family\"), \"Helvetica\"\n        self.widget.set_visual_settings(key, value)\n\n        key, value = (\"Fonts\", \"Title\", \"Font size\"), 20\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(20)\n        self.assertFontEqual(graph.parameter_setter.title_item.item.font(), font)\n\n        key, value = (\"Fonts\", \"Axis title\", \"Font size\"), 14\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Axis title\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(14)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.label.font(), font)\n\n        key, value = ('Fonts', 'Axis ticks', 'Font size'), 15\n        self.widget.set_visual_settings(key, value)\n        key, value = ('Fonts', 'Axis ticks', 'Italic'), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(15)\n        for ax in [\"bottom\", \"left\"]:\n            axis = graph.parameter_setter.getAxis(ax)\n            self.assertFontEqual(axis.style[\"tickFont\"], font)\n\n        key, value = (\"Fonts\", \"Legend\", \"Font size\"), 16\n        self.widget.set_visual_settings(key, value)\n        key, value = (\"Fonts\", \"Legend\", \"Italic\"), True\n        self.widget.set_visual_settings(key, value)\n        font.setPointSize(16)\n        legend_item = list(graph.parameter_setter.legend_items)[0]\n        self.assertFontEqual(legend_item[1].item.font(), font)\n\n        key, value = (\"Annotations\", \"Title\", \"Title\"), \"Foo\"\n        self.widget.set_visual_settings(key, value)\n        self.assertEqual(graph.parameter_setter.title_item.item.toPlainText(), \"Foo\")\n        self.assertEqual(graph.parameter_setter.title_item.text, \"Foo\")\n\n        key, value = (\"Annotations\", \"x-axis title\", \"Title\"), \"Foo2\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"bottom\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo2\")\n        self.assertEqual(axis.labelText, \"Foo2\")\n\n        key, value = (\"Annotations\", \"y-axis title\", \"Title\"), \"Foo3\"\n        self.widget.set_visual_settings(key, value)\n        axis = graph.parameter_setter.getAxis(\"left\")\n        self.assertEqual(axis.label.toPlainText().strip(), \"Foo3\")\n        self.assertEqual(axis.labelText, \"Foo3\")\n\n    def assertFontEqual(self, font1, font2):\n        self.assertEqual(font1.family(), font2.family())\n        self.assertEqual(font1.pointSize(), font2.pointSize())\n        self.assertEqual(font1.italic(), font2.italic())\n\n\nclass TestSegmentsIntersection(unittest.TestCase):\n    def test_ccw(self):\n        a = np.array([[4, 1], [1, 1]])\n        b = np.array([[3, 2], [2, 2]])\n        c = np.array([[2, 1], [3, 3]])\n        np.testing.assert_array_equal(np.array([True, False]), ccw(a, b, c))\n\n    def test_intersects(self):\n        a = np.array([1, 0])\n        b = np.array([2, -1])\n        c = np.array([[2, -2], [1, -1], [0, 0], [1, -0.01]])\n        d = np.array([[4, 0], [2, 0], [-1, -1], [2, 0]])\n        np.testing.assert_array_equal(np.array([False, True, False, True]),\n                                      intersects(a, b, c, d))\n\n    def test_lines_intersection(self):\n        a = np.array([1, 0])\n        b = np.array([2, -1])\n        # create data with four instances and three features\n        x = np.array([[2, 4, 4], [1, 2, 2], [0, -1, 2], [1, 2, 2]])\n        y = np.array([[-2, 0, 1], [-1, 0, 1], [0, -1, 0], [-0.01, 0, 3]])\n        table = np.array([np.vstack((x[:, i], y[:, i])).T\n                          for i in range(y.shape[1])])\n        i = line_intersects_profiles(a, b, table)\n        np.testing.assert_array_equal(np.array([False, True, True, True]), i)\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...\nrunning build_ext\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._simple_tree' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.29.0.dev0+b20ecae to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f\nProcessing dependencies for Orange3==3.29.0.dev0+b20ecae\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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for setuptools==59.8.0\nBest match: setuptools 59.8.0\nAdding setuptools 59.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for scipy==1.7.3\nBest match: scipy 1.7.3\nAdding scipy 1.7.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==1.0.2\nBest match: scikit-learn 1.0.2\nAdding scikit-learn 1.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for requests==2.31.0\nBest match: requests 2.31.0\nAdding requests 2.31.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for PyYAML==6.0.1\nBest match: PyYAML 6.0.1\nAdding PyYAML 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.4\nBest match: pyqtgraph 0.12.4\nAdding pyqtgraph 0.12.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for pip==24.0\nBest match: pip 24.0\nAdding pip 24.0 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for pandas==1.3.5\nBest match: pandas 1.3.5\nAdding pandas 1.3.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for openpyxl==3.1.3\nBest match: openpyxl 3.1.3\nAdding openpyxl 3.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for numpy==1.17.5\nBest match: numpy 1.17.5\nAdding numpy 1.17.5 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for networkx==2.6.3\nBest match: networkx 2.6.3\nAdding networkx 2.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for matplotlib==3.5.3\nBest match: matplotlib 3.5.3\nAdding matplotlib 3.5.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for keyrings.alt==4.2.0\nBest match: keyrings.alt 4.2.0\nAdding keyrings.alt 4.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for keyring==24.1.1\nBest match: keyring 24.1.1\nAdding keyring 24.1.1 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for joblib==1.3.2\nBest match: joblib 1.3.2\nAdding joblib 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for httpx==0.16.1\nBest match: httpx 0.16.1\nAdding httpx 0.16.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine==5.15.6\nBest match: PyQtWebEngine 5.15.6\nAdding PyQtWebEngine 5.15.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for PyQt5==5.15.10\nBest match: PyQt5 5.15.10\nAdding PyQt5 5.15.10 to easy-install.pth file\nInstalling pylupdate5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling pyrcc5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling pyuic5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for threadpoolctl==3.1.0\nBest match: threadpoolctl 3.1.0\nAdding threadpoolctl 3.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for urllib3==2.0.7\nBest match: urllib3 2.0.7\nAdding urllib3 2.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for typing-extensions==4.7.1\nBest match: typing-extensions 4.7.1\nAdding typing-extensions 4.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for packaging==24.0\nBest match: packaging 24.0\nAdding packaging 24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for importlib-metadata==6.7.0\nBest match: importlib-metadata 6.7.0\nAdding importlib-metadata 6.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for qasync==0.25.0\nBest match: qasync 0.25.0\nAdding qasync 0.25.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for requests-cache==1.1.1\nBest match: requests-cache 1.1.1\nAdding requests-cache 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for et-xmlfile==1.1.0\nBest match: et-xmlfile 1.1.0\nAdding et-xmlfile 1.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for cycler==0.11.0\nBest match: cycler 0.11.0\nAdding cycler 0.11.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for kiwisolver==1.4.5\nBest match: kiwisolver 1.4.5\nAdding kiwisolver 1.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for Pillow==9.5.0\nBest match: Pillow 9.5.0\nAdding Pillow 9.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for fonttools==4.38.0\nBest match: fonttools 4.38.0\nAdding fonttools 4.38.0 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for jaraco.classes==3.2.3\nBest match: jaraco.classes 3.2.3\nAdding jaraco.classes 3.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for importlib-resources==5.12.0\nBest match: importlib-resources 5.12.0\nAdding importlib-resources 5.12.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.12.3\nBest match: httpcore 0.12.3\nAdding httpcore 0.12.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for rfc3986==1.5.0\nBest match: rfc3986 1.5.0\nAdding rfc3986 1.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine-Qt5==5.15.16\nBest match: PyQtWebEngine-Qt5 5.15.16\nAdding PyQtWebEngine-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for PyQt5-sip==12.13.0\nBest match: PyQt5-sip 12.13.0\nAdding PyQt5-sip 12.13.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for PyQt5-Qt5==5.15.16\nBest match: PyQt5-Qt5 5.15.16\nAdding PyQt5-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for zipp==3.15.0\nBest match: zipp 3.15.0\nAdding zipp 3.15.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for attrs==24.2.0\nBest match: attrs 24.2.0\nAdding attrs 24.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for platformdirs==4.0.0\nBest match: platformdirs 4.0.0\nAdding platformdirs 4.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for cattrs==23.1.2\nBest match: cattrs 23.1.2\nAdding cattrs 23.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for more-itertools==9.1.0\nBest match: more-itertools 9.1.0\nAdding more-itertools 9.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for cffi==1.15.1\nBest match: cffi 1.15.1\nAdding cffi 1.15.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nSearching for pycparser==2.21\nBest match: pycparser 2.21\nAdding pycparser 2.21 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.29.0.dev0+b20ecae\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.7\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 74ms\nPrepared 18 packages in 2ms\nInstalled 18 packages in 125ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 53 packages in 241ms\nInstalled 47 packages in 678ms\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + h11==0.14.0\n + httpcore==0.12.3\n + httpx==0.16.1\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + rfc3986==1.5.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 39 packages in 58ms\nInstalled 13 packages in 91ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + platformdirs==4.0.0\n + pyqtgraph==0.12.4\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 3ms\nInstalled 2 packages in 19ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 65ms\nInstalled 5 packages in 1.32s\n + catboost==1.2.7\n + graphviz==0.20.1\n + plotly==5.18.0\n + tenacity==8.2.3\n + xgboost==1.6.2\nAudited 2 packages in 11ms\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3413:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3413 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4869:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4869 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5615:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5615 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5736:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5736 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5742:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5742 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7202:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7202 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7857:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7857 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7917:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7917 |               __pyx_t_15 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_14 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.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_b20ecae853031b1b26ebced94491d2cefd4c0b7f/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 0,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f\ncollected 33 items\n\nr2e_tests/test_1.py sss..............................                    [100%]\n\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_data_with_missing_values\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_datasets\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_display_options\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_group_var_none\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_group_var_none_single_instance\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_group_view\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_image_export\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_continuous_class\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_discrete_features\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_subset_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_max_features\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_none_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_outputs\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_plot_only_mean\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_plot_subset\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_select\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_select_lines_enabled\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_selection_line\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_send_report\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_summary\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_unconditional_commit_on_new_signal\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_visual_settings\nPASSED r2e_tests/test_1.py::TestSegmentsIntersection::test_ccw\nPASSED r2e_tests/test_1.py::TestSegmentsIntersection::test_intersects\nPASSED r2e_tests/test_1.py::TestSegmentsIntersection::test_lines_intersection\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\n======================== 30 passed, 3 skipped in 7.77s =========================\nWidgets left: 0    Max widgets: 5976 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_b20ecae853031b1b26ebced94491d2cefd4c0b7f\ncollected 33 items\n\nr2e_tests/test_1.py sss....F.........................                    [100%]\n\n=================================== FAILURES ===================================\n______________ TestOWLinePLot.test_group_var_none_single_instance ______________\n\nself = <r2e_tests.test_1.TestOWLinePLot testMethod=test_group_var_none_single_instance>\n\n    def test_group_var_none_single_instance(self):\n>       self.send_signal(self.widget.Inputs.data, self.housing[:1])\n\nr2e_tests/test_1.py:236: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:446: in send_signal\n    widget=widget, wait=wait)\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:471: in send_signals\n    self._send_signal(widget, input, value, *args)\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:490: in _send_signal\n    notify_input_helper(input, widget, value, *args, **kwargs)\n../../../../.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/functools.py:840: in wrapper\n    return dispatch(args[0].__class__)(*args, **kw)\n.venv/lib/python3.7/site-packages/orangewidget/utils/signals.py:735: in set_input_helper\n    handler(*args)\nOrange/widgets/utils/sql.py:31: in new_f\n    return f(widget, data, *args, **kwargs)\nOrange/widgets/visualize/owlineplot.py:734: in set_data\n    self.setup_plot()\nOrange/widgets/visualize/owlineplot.py:798: in setup_plot\n    self.plot_groups()\nOrange/widgets/visualize/owlineplot.py:807: in plot_groups\n    self._plot_group(data, np.where(self.valid_data)[0])\nOrange/widgets/visualize/owlineplot.py:830: in _plot_group\n    group = ProfileGroup(data, indices, color, self.graph)\nOrange/widgets/visualize/owlineplot.py:445: in __init__\n    self.__create_curves()\nOrange/widgets/visualize/owlineplot.py:451: in __create_curves\n    self.range = self._get_range_curve()\nOrange/widgets/visualize/owlineplot.py:475: in _get_range_curve\n    bottom, top = nanmin(self.y_data, axis=0), nanmax(self.y_data, axis=0)\nOrange/statistics/util.py:413: in nanmin\n    return _nan_min_max(x, np.nanmin, axis)\nOrange/statistics/util.py:389: in _nan_min_max\n    return func(x, axis=axis)\n<__array_function__ internals>:6: in nanmin\n    ???\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\na = array([], shape=(0, 13), dtype=float64), axis = 0, out = None\nkeepdims = <no value>\n\n    @array_function_dispatch(_nanmin_dispatcher)\n    def nanmin(a, axis=None, out=None, keepdims=np._NoValue):\n        \"\"\"\n        Return minimum of an array or minimum along an axis, ignoring any NaNs.\n        When all-NaN slices are encountered a ``RuntimeWarning`` is raised and\n        Nan is returned for that slice.\n    \n        Parameters\n        ----------\n        a : array_like\n            Array containing numbers whose minimum is desired. If `a` is not an\n            array, a conversion is attempted.\n        axis : {int, tuple of int, None}, optional\n            Axis or axes along which the minimum is computed. The default is to compute\n            the minimum of the flattened array.\n        out : ndarray, optional\n            Alternate output array in which to place the result.  The default\n            is ``None``; if provided, it must have the same shape as the\n            expected output, but the type will be cast if necessary.  See\n            `doc.ufuncs` for details.\n    \n            .. versionadded:: 1.8.0\n        keepdims : bool, optional\n            If this is set to True, the axes which are reduced are left\n            in the result as dimensions with size one. With this option,\n            the result will broadcast correctly against the original `a`.\n    \n            If the value is anything but the default, then\n            `keepdims` will be passed through to the `min` method\n            of sub-classes of `ndarray`.  If the sub-classes methods\n            does not implement `keepdims` any exceptions will be raised.\n    \n            .. versionadded:: 1.8.0\n    \n        Returns\n        -------\n        nanmin : ndarray\n            An array with the same shape as `a`, with the specified axis\n            removed.  If `a` is a 0-d array, or if axis is None, an ndarray\n            scalar is returned.  The same dtype as `a` is returned.\n    \n        See Also\n        --------\n        nanmax :\n            The maximum value of an array along a given axis, ignoring any NaNs.\n        amin :\n            The minimum value of an array along a given axis, propagating any NaNs.\n        fmin :\n            Element-wise minimum of two arrays, ignoring any NaNs.\n        minimum :\n            Element-wise minimum of two arrays, propagating any NaNs.\n        isnan :\n            Shows which elements are Not a Number (NaN).\n        isfinite:\n            Shows which elements are neither NaN nor infinity.\n    \n        amax, fmax, maximum\n    \n        Notes\n        -----\n        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic\n        (IEEE 754). This means that Not a Number is not equivalent to infinity.\n        Positive infinity is treated as a very large number and negative\n        infinity is treated as a very small (i.e. negative) number.\n    \n        If the input has a integer type the function is equivalent to np.min.\n    \n        Examples\n        --------\n        >>> a = np.array([[1, 2], [3, np.nan]])\n        >>> np.nanmin(a)\n        1.0\n        >>> np.nanmin(a, axis=0)\n        array([1.,  2.])\n        >>> np.nanmin(a, axis=1)\n        array([1.,  3.])\n    \n        When positive infinity and negative infinity are present:\n    \n        >>> np.nanmin([1, 2, np.nan, np.inf])\n        1.0\n        >>> np.nanmin([1, 2, np.nan, np.NINF])\n        -inf\n    \n        \"\"\"\n        kwargs = {}\n        if keepdims is not np._NoValue:\n            kwargs['keepdims'] = keepdims\n        if type(a) is np.ndarray and a.dtype != np.object_:\n            # Fast, but not safe for subclasses of ndarray, or object arrays,\n            # which do not implement isnan (gh-9009), or fmin correctly (gh-8975)\n>           res = np.fmin.reduce(a, axis=axis, out=out, **kwargs)\nE           ValueError: zero-size array to reduction operation fmin which has no identity\n\n.venv/lib/python3.7/site-packages/numpy/lib/nanfunctions.py:320: ValueError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_data_with_missing_values\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_datasets\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_display_options\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_group_var_none\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_group_view\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_image_export\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_continuous_class\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_discrete_features\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_input_subset_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_max_features\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_none_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_outputs\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_plot_only_mean\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_plot_subset\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_select\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_select_lines_enabled\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_selection_line\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_send_report\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_summary\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_unconditional_commit_on_new_signal\nPASSED r2e_tests/test_1.py::TestOWLinePLot::test_visual_settings\nPASSED r2e_tests/test_1.py::TestSegmentsIntersection::test_ccw\nPASSED r2e_tests/test_1.py::TestSegmentsIntersection::test_intersects\nPASSED r2e_tests/test_1.py::TestSegmentsIntersection::test_lines_intersection\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWLinePLot::test_group_var_none_single_instance\n=================== 1 failed, 29 passed, 3 skipped in 5.77s ====================\nWidgets left: 0    Max widgets: 5976 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/visualize/owlineplot.py Orange/widgets/visualize/tests/test_owlineplot.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Line Plot crashes when processing single instance input data

**Description:**
When providing a single instance of data to the Line Plot widget, it fails to process the input correctly and raises an error. This issue occurs because the widget incorrectly indexes the data, resulting in an empty array during the plotting process.

**Example:**
```python
# Initialize the Line Plot widget and send a single instance of housing data
widget.send_signal(widget.Inputs.data, housing_data[:1])

# This action leads to the following error:
# ValueError: zero-size array to reduction operation fmin which has no identity
```

**Expected Behavior:**
The Line Plot widget should handle single instance inputs without crashing. It should correctly index the data and either display the plot appropriately or inform the user that there is insufficient data for plotting.

[/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/visualize/owlineplot.py
from typing import List
from xml.sax.saxutils import escape

import numpy as np
import scipy.sparse as sp

from AnyQt.QtCore import Qt, QSize, QLineF, pyqtSignal as Signal
from AnyQt.QtGui import QPainter, QPen, QColor
from AnyQt.QtWidgets import QApplication, QGraphicsLineItem, QSizePolicy

import pyqtgraph as pg
from pyqtgraph.functions import mkPen
from pyqtgraph.graphicsItems.ViewBox import ViewBox

from orangewidget.utils.listview import ListViewSearch
from orangewidget.utils.visual_settings_dlg import VisualSettingsDialog

from Orange.data import Table, DiscreteVariable
from Orange.data.sql.table import SqlTable
from Orange.statistics.util import countnans, nanmean, nanmin, nanmax, nanstd
from Orange.widgets import gui, report
from Orange.widgets.settings import (
    Setting, ContextSetting, DomainContextHandler
)
from Orange.widgets.utils.annotated_data import (
    create_annotated_table, ANNOTATED_DATA_SIGNAL_NAME
)
from Orange.widgets.utils.itemmodels import DomainModel
from Orange.widgets.utils.plot import OWPlotGUI, SELECT, PANNING, ZOOMING
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.utils.state_summary import format_summary_details
from Orange.widgets.visualize.owdistributions import LegendItem
from Orange.widgets.visualize.utils.customizableplot import Updater, \
    CommonParameterSetter
from Orange.widgets.visualize.utils.plotutils import AxisItem
from Orange.widgets.widget import OWWidget, Input, Output, Msg


def ccw(a, b, c):
    """
    Checks whether three points are listed in a counterclockwise order.
    """
    ax, ay = (a[:, 0], a[:, 1]) if a.ndim == 2 else (a[0], a[1])
    bx, by = (b[:, 0], b[:, 1]) if b.ndim == 2 else (b[0], b[1])
    cx, cy = (c[:, 0], c[:, 1]) if c.ndim == 2 else (c[0], c[1])
    return (cy - ay) * (bx - ax) > (by - ay) * (cx - ax)


def intersects(a, b, c, d):
    """
    Checks whether line segment a (given points a and b) intersects with line
    segment b (given points c and d).
    """
    return np.logical_and(ccw(a, c, d) != ccw(b, c, d),
                          ccw(a, b, c) != ccw(a, b, d))


def line_intersects_profiles(p1, p2, table):
    """
    Checks if a line intersects any line segments.

    Parameters
    ----------
    p1, p2 : ndarray
        Endpoints of the line, given x coordinate as p_[0]
        and y coordinate as p_[1].
    table : ndarray
        An array of shape m x n x p; where m is number of connected points
        for a individual profile (i. e. number of features), n is number
        of instances, p is number of coordinates (x and y).

    Returns
    -------
    result : ndarray
        Array of bools with shape of number of instances in the table.
    """
    res = np.zeros(len(table[0]), dtype=bool)
    for i in range(len(table) - 1):
        res = np.logical_or(res, intersects(p1, p2, table[i], table[i + 1]))
    return res


class LinePlotStyle:
    DEFAULT_COLOR = QColor(Qt.darkGray)
    SELECTION_LINE_COLOR = QColor(Qt.black)
    SELECTION_LINE_WIDTH = 2

    UNSELECTED_LINE_WIDTH = 1
    UNSELECTED_LINE_ALPHA = 100
    UNSELECTED_LINE_ALPHA_SEL = 50  # unselected lines, when selection exists

    SELECTED_LINE_WIDTH = 3
    SELECTED_LINE_ALPHA = 170

    RANGE_ALPHA = 25
    SELECTED_RANGE_ALPHA = 50

    MEAN_WIDTH = 6
    MEAN_DARK_FACTOR = 110


class BottomAxisItem(AxisItem):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._ticks = {}

    def set_ticks(self, ticks):
        self._ticks = dict(enumerate(ticks, 1)) if ticks else {}
        if not ticks:
            self.setTicks(None)

    def tickStrings(self, values, scale, _):
        return [self._ticks.get(v * scale, "") for v in values]


class LinePlotViewBox(ViewBox):
    selection_changed = Signal(np.ndarray)

    def __init__(self):
        super().__init__(enableMenu=False)
        self._profile_items = None
        self._can_select = True
        self._graph_state = SELECT

        self.setMouseMode(self.PanMode)

        pen = mkPen(LinePlotStyle.SELECTION_LINE_COLOR,
                    width=LinePlotStyle.SELECTION_LINE_WIDTH)
        self.selection_line = QGraphicsLineItem()
        self.selection_line.setPen(pen)
        self.selection_line.setZValue(1e9)
        self.addItem(self.selection_line, ignoreBounds=True)

    def update_selection_line(self, button_down_pos, current_pos):
        p1 = self.childGroup.mapFromParent(button_down_pos)
        p2 = self.childGroup.mapFromParent(current_pos)
        self.selection_line.setLine(QLineF(p1, p2))
        self.selection_line.resetTransform()
        self.selection_line.show()

    def set_graph_state(self, state):
        self._graph_state = state

    def enable_selection(self, enable):
        self._can_select = enable

    def get_selected(self, p1, p2):
        if self._profile_items is None:
            return np.array(False)
        return line_intersects_profiles(np.array([p1.x(), p1.y()]),
                                        np.array([p2.x(), p2.y()]),
                                        self._profile_items)

    def add_profiles(self, y):
        if sp.issparse(y):
            y = y.todense()
        self._profile_items = np.array(
            [np.vstack((np.full((1, y.shape[0]), i + 1), y[:, i].flatten())).T
             for i in range(y.shape[1])])

    def remove_profiles(self):
        self._profile_items = None

    def mouseDragEvent(self, ev, axis=None):
        if self._graph_state == SELECT and axis is None and self._can_select:
            ev.accept()
            if ev.button() == Qt.LeftButton:
                self.update_selection_line(ev.buttonDownPos(), ev.pos())
                if ev.isFinish():
                    self.selection_line.hide()
                    p1 = self.childGroup.mapFromParent(
                        ev.buttonDownPos(ev.button()))
                    p2 = self.childGroup.mapFromParent(ev.pos())
                    self.selection_changed.emit(self.get_selected(p1, p2))
        elif self._graph_state == ZOOMING or self._graph_state == PANNING:
            ev.ignore()
            super().mouseDragEvent(ev, axis=axis)
        else:
            ev.ignore()

    def mouseClickEvent(self, ev):
        if ev.button() == Qt.RightButton:
            self.autoRange()
            self.enableAutoRange()
        else:
            ev.accept()
            self.selection_changed.emit(np.array(False))

    def reset(self):
        self._profile_items = None
        self._can_select = True
        self._graph_state = SELECT


class ParameterSetter(CommonParameterSetter):
    MEAN_LABEL = "Mean"
    LINE_LABEL = "Lines"
    SEL_LINE_LABEL = "Selected lines"
    RANGE_LABEL = "Range"
    SEL_RANGE_LABEL = "Selected range"

    def __init__(self, master):
        super().__init__()
        self.master = master

    def update_setters(self):
        self.mean_settings = {
            Updater.WIDTH_LABEL: LinePlotStyle.MEAN_WIDTH,
            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,
        }
        self.line_settings = {
            Updater.WIDTH_LABEL: LinePlotStyle.UNSELECTED_LINE_WIDTH,
            Updater.ALPHA_LABEL: LinePlotStyle.UNSELECTED_LINE_ALPHA,
            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,
            Updater.ANTIALIAS_LABEL: True,
        }
        self.sel_line_settings = {
            Updater.WIDTH_LABEL: LinePlotStyle.SELECTED_LINE_WIDTH,
            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_LINE_ALPHA,
            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,
            Updater.ANTIALIAS_LABEL: False,
        }
        self.range_settings = {
            Updater.ALPHA_LABEL: LinePlotStyle.RANGE_ALPHA,
        }
        self.sel_range_settings = {
            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_RANGE_ALPHA,
        }

        self.initial_settings = {
            self.LABELS_BOX: {
                self.FONT_FAMILY_LABEL: self.FONT_FAMILY_SETTING,
                self.TITLE_LABEL: self.FONT_SETTING,
                self.AXIS_TITLE_LABEL: self.FONT_SETTING,
                self.AXIS_TICKS_LABEL: self.FONT_SETTING,
                self.LEGEND_LABEL: self.FONT_SETTING,
            },
            self.ANNOT_BOX: {
                self.TITLE_LABEL: {self.TITLE_LABEL: ("", "")},
                self.X_AXIS_LABEL: {self.TITLE_LABEL: ("", "")},
                self.Y_AXIS_LABEL: {self.TITLE_LABEL: ("", "")},
            },
            self.PLOT_BOX: {
                self.MEAN_LABEL: {
                    Updater.WIDTH_LABEL: (range(1, 15), LinePlotStyle.MEAN_WIDTH),
                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),
                                          Updater.DEFAULT_LINE_STYLE),
                },
                self.LINE_LABEL: {
                    Updater.WIDTH_LABEL: (range(1, 15),
                                          LinePlotStyle.UNSELECTED_LINE_WIDTH),
                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),
                                          Updater.DEFAULT_LINE_STYLE),
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.UNSELECTED_LINE_ALPHA),
                    Updater.ANTIALIAS_LABEL: (None, True),
                },
                self.SEL_LINE_LABEL: {
                    Updater.WIDTH_LABEL: (range(1, 15),
                                          LinePlotStyle.SELECTED_LINE_WIDTH),
                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),
                                          Updater.DEFAULT_LINE_STYLE),
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.SELECTED_LINE_ALPHA),
                    Updater.ANTIALIAS_LABEL: (None, False),
                },
                self.RANGE_LABEL: {
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.RANGE_ALPHA),
                },
                self.SEL_RANGE_LABEL: {
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.SELECTED_RANGE_ALPHA),
                },
            }
        }

        def update_mean(**settings):
            self.mean_settings.update(**settings)
            Updater.update_lines(self.mean_lines_items, **self.mean_settings)

        def update_lines(**settings):
            self.line_settings.update(**settings)
            Updater.update_lines(self.lines_items, **self.line_settings)

        def update_sel_lines(**settings):
            self.sel_line_settings.update(**settings)
            Updater.update_lines(self.sel_lines_items, **self.sel_line_settings)

        def _update_brush(items, **settings):
            for item in items:
                brush = item.brush()
                color = brush.color()
                color.setAlpha(settings[Updater.ALPHA_LABEL])
                brush.setColor(color)
                item.setBrush(brush)

        def update_range(**settings):
            self.range_settings.update(**settings)
            _update_brush(self.range_items, **settings)

        def update_sel_range(**settings):
            self.sel_range_settings.update(**settings)
            _update_brush(self.sel_range_items, **settings)

        self._setters[self.PLOT_BOX] = {
            self.MEAN_LABEL: update_mean,
            self.LINE_LABEL: update_lines,
            self.SEL_LINE_LABEL: update_sel_lines,
            self.RANGE_LABEL: update_range,
            self.SEL_RANGE_LABEL: update_sel_range,
        }

    @property
    def title_item(self):
        return self.master.getPlotItem().titleLabel

    @property
    def axis_items(self):
        return [value["item"] for value in self.master.getPlotItem().axes.values()]

    @property
    def legend_items(self):
        return self.master.legend.items

    @property
    def mean_lines_items(self):
        return [group.mean for group in self.master.groups]

    @property
    def lines_items(self):
        return [group.profiles for group in self.master.groups]

    @property
    def sel_lines_items(self):
        return [group.sel_profiles for group in self.master.groups] + \
               [group.sub_profiles for group in self.master.groups]

    @property
    def range_items(self):
        return [group.range for group in self.master.groups]

    @property
    def sel_range_items(self):
        return [group.sel_range for group in self.master.groups]

    @property
    def getAxis(self):
        return self.master.getAxis

# Customizable plot widget
class LinePlotGraph(pg.PlotWidget):
    def __init__(self, parent):
        self.groups: List[ProfileGroup] = []
        self.bottom_axis = BottomAxisItem(orientation="bottom")
        self.bottom_axis.setLabel("")
        left_axis = AxisItem(orientation="left")
        left_axis.setLabel("")
        super().__init__(parent, viewBox=LinePlotViewBox(),
                         background="w", enableMenu=False,
                         axisItems={"bottom": self.bottom_axis,
                                    "left": left_axis})
        self.view_box = self.getViewBox()
        self.selection = set()
        self.legend = self._create_legend(((1, 0), (1, 0)))
        self.getPlotItem().buttonsHidden = True
        self.setRenderHint(QPainter.Antialiasing, True)

        self.parameter_setter = ParameterSetter(self)

    def _create_legend(self, anchor):
        legend = LegendItem()
        legend.setParentItem(self.view_box)
        legend.restoreAnchor(anchor)
        legend.hide()
        return legend

    def update_legend(self, variable):
        self.legend.clear()
        self.legend.hide()
        if variable and variable.is_discrete:
            for name, color in zip(variable.values, variable.colors):
                c = QColor(*color)
                dots = pg.ScatterPlotItem(pen=c, brush=c, size=10, shape="s")
                self.legend.addItem(dots, escape(name))
            self.legend.show()
        Updater.update_legend_font(self.parameter_setter.legend_items,
                                   **self.parameter_setter.legend_settings)

    def select(self, indices):
        keys = QApplication.keyboardModifiers()
        indices = set(indices)
        if keys & Qt.ControlModifier:
            self.selection ^= indices
        elif keys & Qt.AltModifier:
            self.selection -= indices
        elif keys & Qt.ShiftModifier:
            self.selection |= indices
        else:
            self.selection = indices

    def reset(self):
        self.selection = set()
        self.view_box.reset()
        self.clear()
        self.getAxis('bottom').set_ticks(None)
        self.legend.hide()
        self.groups = []

    def select_button_clicked(self):
        self.view_box.set_graph_state(SELECT)
        self.view_box.setMouseMode(self.view_box.RectMode)

    def pan_button_clicked(self):
        self.view_box.set_graph_state(PANNING)
        self.view_box.setMouseMode(self.view_box.PanMode)

    def zoom_button_clicked(self):
        self.view_box.set_graph_state(ZOOMING)
        self.view_box.setMouseMode(self.view_box.RectMode)

    def reset_button_clicked(self):
        self.view_box.autoRange()
        self.view_box.enableAutoRange()


class ProfileGroup:
    def __init__(self, data, indices, color, graph):
        self.x_data = np.arange(1, data.X.shape[1] + 1)
        self.y_data = data.X
        self.indices = indices
        self.ids = data.ids
        self.color = color
        self.graph = graph

        self.profiles_added = False
        self.sub_profiles_added = False
        self.range_added = False
        self.mean_added = False
        self.error_bar_added = False

        self.graph_items = []
        self.__mean = nanmean(self.y_data, axis=0)
        self.__create_curves()

    def __create_curves(self):
        self.profiles = self._get_profiles_curve()
        self.sub_profiles = self._get_sel_profiles_curve()
        self.sel_profiles = self._get_sel_profiles_curve()
        self.range = self._get_range_curve()
        self.sel_range = self._get_sel_range_curve()
        self.mean = self._get_mean_curve()
        self.error_bar = self._get_error_bar()
        self.graph_items = [
            self.mean, self.range, self.sel_range, self.profiles,
            self.sub_profiles, self.sel_profiles, self.error_bar
        ]

    def _get_profiles_curve(self):
        x, y, con = self.__get_disconnected_curve_data(self.y_data)
        pen = self.make_pen(self.color)
        curve = pg.PlotCurveItem(x=x, y=y, connect=con, pen=pen)
        Updater.update_lines([curve], **self.graph.parameter_setter.line_settings)
        return curve

    def _get_sel_profiles_curve(self):
        curve = pg.PlotCurveItem(x=None, y=None, pen=self.make_pen(self.color))
        Updater.update_lines([curve], **self.graph.parameter_setter.sel_line_settings)
        return curve

    def _get_range_curve(self):
        color = QColor(self.color)
        color.setAlpha(self.graph.parameter_setter.range_settings[Updater.ALPHA_LABEL])
        bottom, top = nanmin(self.y_data, axis=0), nanmax(self.y_data, axis=0)
        return pg.FillBetweenItem(
            pg.PlotDataItem(x=self.x_data, y=bottom),
            pg.PlotDataItem(x=self.x_data, y=top), brush=color
        )

    def _get_sel_range_curve(self):
        color = QColor(self.color)
        color.setAlpha(self.graph.parameter_setter.sel_range_settings[Updater.ALPHA_LABEL])
        curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)
        return pg.FillBetweenItem(curve1, curve2, brush=color)

    def _get_mean_curve(self):
        pen = self.make_pen(self.color.darker(LinePlotStyle.MEAN_DARK_FACTOR))
        curve = pg.PlotCurveItem(x=self.x_data, y=self.__mean, pen=pen)
        Updater.update_lines([curve], **self.graph.parameter_setter.mean_settings)
        return curve

    def _get_error_bar(self):
        std = nanstd(self.y_data, axis=0)
        return pg.ErrorBarItem(x=self.x_data, y=self.__mean,
                               bottom=std, top=std, beam=0.01)

    def remove_items(self):
        for item in self.graph_items:
            self.graph.removeItem(item)
        self.graph_items = []

    def set_visible_profiles(self, show_profiles=True, show_range=True, **_):
        if not self.profiles_added and show_profiles:
            self.profiles_added = True
            self.graph.addItem(self.profiles)
            self.graph.addItem(self.sel_profiles)
        if not self.sub_profiles_added and (show_profiles or show_range):
            self.sub_profiles_added = True
            self.graph.addItem(self.sub_profiles)
        self.profiles.setVisible(show_profiles)
        self.sel_profiles.setVisible(show_profiles)
        self.sub_profiles.setVisible(show_profiles or show_range)

    def set_visible_range(self, show_profiles=True, show_range=True, **_):
        if not self.range_added and show_range:
            self.range_added = True
            self.graph.addItem(self.range)
            self.graph.addItem(self.sel_range)
        if not self.sub_profiles_added and (show_profiles or show_range):
            self.sub_profiles_added = True
            self.graph.addItem(self.sub_profiles)
        self.range.setVisible(show_range)
        self.sel_range.setVisible(show_range)
        self.sub_profiles.setVisible(show_profiles or show_range)

    def set_visible_mean(self, show_mean=True, **_):
        if not self.mean_added and show_mean:
            self.mean_added = True
            self.graph.addItem(self.mean)
        self.mean.setVisible(show_mean)

    def set_visible_error(self, show_error=True, **_):
        if not self.error_bar_added and show_error:
            self.error_bar_added = True
            self.graph.addItem(self.error_bar)
        self.error_bar.setVisible(show_error)

    def update_profiles_color(self, selection):
        color = QColor(self.color)
        alpha = self.graph.parameter_setter.line_settings[Updater.ALPHA_LABEL] \
            if not selection else LinePlotStyle.UNSELECTED_LINE_ALPHA_SEL
        color.setAlpha(alpha)
        pen = self.profiles.opts["pen"]
        pen.setColor(color)
        self.profiles.setPen(pen)

    def update_sel_profiles(self, y_data):
        x, y, connect = self.__get_disconnected_curve_data(y_data) \
            if y_data is not None else (None, None, None)
        self.sel_profiles.setData(x=x, y=y, connect=connect)

    def update_sel_profiles_color(self, subset):
        color = QColor(Qt.black) if subset else QColor(self.color)
        color.setAlpha(self.graph.parameter_setter.sel_line_settings[Updater.ALPHA_LABEL])
        pen = self.sel_profiles.opts["pen"]
        pen.setColor(color)
        self.sel_profiles.setPen(pen)

    def update_sub_profiles(self, y_data):
        x, y, connect = self.__get_disconnected_curve_data(y_data) \
            if y_data is not None else (None, None, None)
        self.sub_profiles.setData(x=x, y=y, connect=connect)

    def update_sel_range(self, y_data):
        if y_data is None:
            curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)
        else:
            curve1 = pg.PlotDataItem(x=self.x_data, y=nanmin(y_data, axis=0))
            curve2 = pg.PlotDataItem(x=self.x_data, y=nanmax(y_data, axis=0))
        self.sel_range.setCurves(curve1, curve2)

    @staticmethod
    def __get_disconnected_curve_data(y_data):
        m, n = y_data.shape
        x = np.arange(m * n) % n + 1
        y = y_data.A.flatten() if sp.issparse(y_data) else y_data.flatten()
        connect = np.ones_like(y, bool)
        connect[n - 1:: n] = False
        return x, y, connect

    @staticmethod
    def make_pen(color, width=1):
        pen = QPen(color, width)
        pen.setCosmetic(True)
        return pen


MAX_FEATURES = 200
SEL_MAX_INSTANCES = 10000


class OWLinePlot(OWWidget):
    name = "Line Plot"
    description = "Visualization of data profiles (e.g., time series)."
    icon = "icons/LinePlot.svg"
    priority = 180

    buttons_area_orientation = Qt.Vertical
    enable_selection = Signal(bool)

    class Inputs:
        data = Input("Data", Table, default=True)
        data_subset = Input("Data Subset", Table)

    class Outputs:
        selected_data = Output("Selected Data", Table, default=True)
        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)

    settingsHandler = DomainContextHandler()
    group_var = ContextSetting(None)
    show_profiles = Setting(False)
    show_range = Setting(True)
    show_mean = Setting(True)
    show_error = Setting(False)
    auto_commit = Setting(True)
    selection = Setting(None, schema_only=True)
    visual_settings = Setting({}, schema_only=True)

    graph_name = "graph.plotItem"

    class Error(OWWidget.Error):
        not_enough_attrs = Msg("Need at least one numeric feature.")
        no_valid_data = Msg("No plot due to no valid data.")

    class Warning(OWWidget.Warning):
        no_display_option = Msg("No display option is selected.")

    class Information(OWWidget.Information):
        hidden_instances = Msg("Instances with unknown values are not shown.")
        too_many_features = Msg("Data has too many features. Only first {}"
                                " are shown.".format(MAX_FEATURES))

    def __init__(self, parent=None):
        super().__init__(parent)
        self.__groups = []
        self.data = None
        self.valid_data = None
        self.subset_data = None
        self.subset_indices = None
        self.__pending_selection = self.selection
        self.graph_variables = []
        self.graph = None
        self.group_vars = None
        self.group_view = None
        self.setup_gui()

        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)
        self.graph.view_box.selection_changed.connect(self.selection_changed)
        self.enable_selection.connect(self.graph.view_box.enable_selection)

    def setup_gui(self):
        self._add_graph()
        self._add_controls()

    def _add_graph(self):
        box = gui.vBox(self.mainArea, True, margin=0)
        self.graph = LinePlotGraph(self)
        box.layout().addWidget(self.graph)

    def _add_controls(self):
        displaybox = gui.widgetBox(self.controlArea, "Display")
        gui.checkBox(displaybox, self, "show_profiles", "Lines",
                     callback=self.__show_profiles_changed,
                     tooltip="Plot lines")
        gui.checkBox(displaybox, self, "show_range", "Range",
                     callback=self.__show_range_changed,
                     tooltip="Plot range between 10th and 90th percentile")
        gui.checkBox(displaybox, self, "show_mean", "Mean",
                     callback=self.__show_mean_changed,
                     tooltip="Plot mean curve")
        gui.checkBox(displaybox, self, "show_error", "Error bars",
                     callback=self.__show_error_changed,
                     tooltip="Show standard deviation")

        self.group_vars = DomainModel(
            placeholder="None", separators=False, valid_types=DiscreteVariable)
        self.group_view = gui.listView(
            self.controlArea, self, "group_var", box="Group by",
            model=self.group_vars, callback=self.__group_var_changed,
            sizeHint=QSize(30, 100), viewType=ListViewSearch,
            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)
        )
        self.group_view.setEnabled(False)

        plot_gui = OWPlotGUI(self)
        plot_gui.box_zoom_select(self.buttonsArea)
        gui.auto_send(self.buttonsArea, self, "auto_commit")

        self.info.set_input_summary(self.info.NoInput)
        self.info.set_output_summary(self.info.NoOutput)

    def __show_profiles_changed(self):
        self.check_display_options()
        self._update_visibility("profiles")

    def __show_range_changed(self):
        self.check_display_options()
        self._update_visibility("range")

    def __show_mean_changed(self):
        self.check_display_options()
        self._update_visibility("mean")

    def __show_error_changed(self):
        self._update_visibility("error")

    def __group_var_changed(self):
        if self.data is None or not self.graph_variables:
            return
        self.plot_groups()
        self._update_profiles_color()
        self._update_sel_profiles_and_range()
        self._update_sel_profiles_color()
        self._update_sub_profiles()

    @Inputs.data
    @check_sql_input
    def set_data(self, data):
        self.closeContext()
        self.data = data
        self._set_input_summary()
        self.clear()
        self.check_data()
        self.check_display_options()

        if self.data is not None:
            self.group_vars.set_domain(self.data.domain)
            self.group_view.setEnabled(len(self.group_vars) > 1)
            self.group_var = self.data.domain.class_var \
                if self.data.domain.has_discrete_class else None

        self.openContext(data)
        self.setup_plot()
        self.unconditional_commit()

    def check_data(self):
        def error(err):
            err()
            self.data = None

        self.clear_messages()
        if self.data is not None:
            self.graph_variables = [var for var in self.data.domain.attributes
                                    if var.is_continuous]
            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)
            if len(self.graph_variables) < 1:
                error(self.Error.not_enough_attrs)
            elif not np.sum(self.valid_data):
                error(self.Error.no_valid_data)
            else:
                if not np.all(self.valid_data):
                    self.Information.hidden_instances()
                if len(self.graph_variables) > MAX_FEATURES:
                    self.Information.too_many_features()
                    self.graph_variables = self.graph_variables[:MAX_FEATURES]

    def check_display_options(self):
        self.Warning.no_display_option.clear()
        if self.data is not None:
            if not (self.show_profiles or self.show_range or self.show_mean):
                self.Warning.no_display_option()
            enable = (self.show_profiles or self.show_range) and \
                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES
            self.enable_selection.emit(enable)

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

    @Inputs.data_subset
    @check_sql_input
    def set_subset_data(self, subset):
        self.subset_data = subset

    def handleNewSignals(self):
        self.set_subset_ids()
        if self.data is not None:
            self._update_profiles_color()
            self._update_sel_profiles_color()
            self._update_sub_profiles()

    def set_subset_ids(self):
        sub_ids = {e.id for e in self.subset_data} \
            if self.subset_data is not None else {}
        self.subset_indices = None
        if self.data is not None and sub_ids:
            self.subset_indices = [x.id for x in self.data[self.valid_data]
                                   if x.id in sub_ids]

    def setup_plot(self):
        if self.data is None:
            return

        ticks = [a.name for a in self.graph_variables]
        self.graph.getAxis("bottom").set_ticks(ticks)
        self.plot_groups()
        self.apply_selection()
        self.graph.view_box.enableAutoRange()
        self.graph.view_box.updateAutoRange()

    def plot_groups(self):
        self._remove_groups()
        data = self.data[self.valid_data, self.graph_variables]
        if self.group_var is None:
            self._plot_group(data, np.where(self.valid_data)[0])
        else:
            class_col_data, _ = self.data.get_column_view(self.group_var)
            for index in range(len(self.group_var.values)):
                mask = np.logical_and(class_col_data == index, self.valid_data)
                indices = np.flatnonzero(mask)
                if not len(indices):
                    continue
                group_data = self.data[indices, self.graph_variables]
                self._plot_group(group_data, indices, index)
        self.graph.update_legend(self.group_var)
        self.graph.groups = self.__groups
        self.graph.view_box.add_profiles(data.X)

    def _remove_groups(self):
        for group in self.__groups:
            group.remove_items()
        self.graph.view_box.remove_profiles()
        self.graph.groups = []
        self.__groups = []

    def _plot_group(self, data, indices, index=None):
        color = self.__get_group_color(index)
        group = ProfileGroup(data, indices, color, self.graph)
        kwargs = self.__get_visibility_flags()
        group.set_visible_error(**kwargs)
        group.set_visible_mean(**kwargs)
        group.set_visible_range(**kwargs)
        group.set_visible_profiles(**kwargs)
        self.__groups.append(group)

    def __get_group_color(self, index):
        if self.group_var is not None:
            return QColor(*self.group_var.colors[index])
        return QColor(LinePlotStyle.DEFAULT_COLOR)

    def __get_visibility_flags(self):
        return {"show_profiles": self.show_profiles,
                "show_range": self.show_range,
                "show_mean": self.show_mean,
                "show_error": self.show_error}

    def _update_profiles_color(self):
        # color alpha depends on subset and selection; with selection or
        # subset profiles color has more opacity
        if not self.show_profiles:
            return
        for group in self.__groups:
            has_sel = bool(self.subset_indices) or bool(self.selection)
            group.update_profiles_color(has_sel)

    def _update_sel_profiles_and_range(self):
        # mark selected instances and selected range
        if not (self.show_profiles or self.show_range):
            return
        for group in self.__groups:
            inds = [i for i in group.indices if self.__in(i, self.selection)]
            table = self.data[inds, self.graph_variables].X if inds else None
            if self.show_profiles:
                group.update_sel_profiles(table)
            if self.show_range:
                group.update_sel_range(table)

    def _update_sel_profiles_color(self):
        # color depends on subset; when subset is present,
        # selected profiles are black
        if not self.selection or not self.show_profiles:
            return
        for group in self.__groups:
            group.update_sel_profiles_color(bool(self.subset_indices))

    def _update_sub_profiles(self):
        # mark subset instances
        if not (self.show_profiles or self.show_range):
            return
        for group in self.__groups:
            inds = [i for i, _id in zip(group.indices, group.ids)
                    if self.__in(_id, self.subset_indices)]
            table = self.data[inds, self.graph_variables].X if inds else None
            group.update_sub_profiles(table)

    def _update_visibility(self, obj_name):
        if not len(self.__groups):
            return
        self._update_profiles_color()
        self._update_sel_profiles_and_range()
        self._update_sel_profiles_color()
        kwargs = self.__get_visibility_flags()
        for group in self.__groups:
            getattr(group, "set_visible_{}".format(obj_name))(**kwargs)
        self.graph.view_box.updateAutoRange()

    def apply_selection(self):
        if self.data is not None and self.__pending_selection is not None:
            sel = [i for i in self.__pending_selection if i < len(self.data)]
            mask = np.zeros(len(self.data), dtype=bool)
            mask[sel] = True
            mask = mask[self.valid_data]
            self.selection_changed(mask)
            self.__pending_selection = None

    def selection_changed(self, mask):
        if self.data is None:
            return
        # need indices for self.data: mask refers to self.data[self.valid_data]
        indices = np.arange(len(self.data))[self.valid_data][mask]
        self.graph.select(indices)
        old = self.selection
        self.selection = None if self.data and isinstance(self.data, SqlTable)\
            else list(self.graph.selection)
        if not old and self.selection or old and not self.selection:
            self._update_profiles_color()
        self._update_sel_profiles_and_range()
        self._update_sel_profiles_color()
        self.commit()

    def commit(self):
        selected = self.data[self.selection] \
            if self.data is not None and bool(self.selection) else None
        annotated = create_annotated_table(self.data, self.selection)

        summary = len(selected) if selected else self.info.NoOutput
        details = format_summary_details(selected) if selected else ""
        self.info.set_output_summary(summary, details)
        self.Outputs.selected_data.send(selected)
        self.Outputs.annotated_data.send(annotated)

    def send_report(self):
        if self.data is None:
            return

        caption = report.render_items_vert((("Group by", self.group_var),))
        self.report_plot()
        if caption:
            self.report_caption(caption)

    def sizeHint(self):
        return QSize(1132, 708)

    def clear(self):
        self.valid_data = None
        self.selection = None
        self.__groups = []
        self.graph_variables = []
        self.graph.reset()
        self.group_vars.set_domain(None)
        self.group_view.setEnabled(False)

    @staticmethod
    def __in(obj, collection):
        return collection is not None and obj in collection

    def set_visual_settings(self, key, value):
        self.graph.parameter_setter.set_parameter(key, value)
        self.visual_settings[key] = value


if __name__ == "__main__":
    brown = Table("brown-selected")
    WidgetPreview(OWLinePlot).run(set_data=brown, set_subset_data=brown[:30])

```
--- 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:** Line Plot crashes when processing single instance input data

**Description:**
When providing a single instance of data to the Line Plot widget, it fails to process the input correctly and raises an error. This issue occurs because the widget incorrectly indexes the data, resulting in an empty array during the plotting process.

**Example:**
```python
# Initialize the Line Plot widget and send a single instance of housing data
widget.send_signal(widget.Inputs.data, housing_data[:1])

# This action leads to the following error:
# ValueError: zero-size array to reduction operation fmin which has no identity
```

**Expected Behavior:**
The Line Plot widget should handle single instance inputs without crashing. It should correctly index the data and either display the plot appropriately or inform the user that there is insufficient data for plotting.

[/ISSUE]
{
    "TestOWLinePLot.test_data_with_missing_values": "PASSED",
    "TestOWLinePLot.test_datasets": "PASSED",
    "TestOWLinePLot.test_display_options": "PASSED",
    "TestOWLinePLot.test_group_var_none": "PASSED",
    "TestOWLinePLot.test_group_var_none_single_instance": "PASSED",
    "TestOWLinePLot.test_group_view": "PASSED",
    "TestOWLinePLot.test_image_export": "PASSED",
    "TestOWLinePLot.test_input_continuous_class": "PASSED",
    "TestOWLinePLot.test_input_data": "PASSED",
    "TestOWLinePLot.test_input_discrete_features": "PASSED",
    "TestOWLinePLot.test_input_subset_data": "PASSED",
    "TestOWLinePLot.test_max_features": "PASSED",
    "TestOWLinePLot.test_minimum_size": "PASSED",
    "TestOWLinePLot.test_msg_base_class": "PASSED",
    "TestOWLinePLot.test_none_data": "PASSED",
    "TestOWLinePLot.test_outputs": "PASSED",
    "TestOWLinePLot.test_plot_only_mean": "PASSED",
    "TestOWLinePLot.test_plot_subset": "PASSED",
    "TestOWLinePLot.test_saved_selection": "PASSED",
    "TestOWLinePLot.test_select": "PASSED",
    "TestOWLinePLot.test_select_lines_enabled": "PASSED",
    "TestOWLinePLot.test_selection_line": "PASSED",
    "TestOWLinePLot.test_send_report": "PASSED",
    "TestOWLinePLot.test_sparse_data": "PASSED",
    "TestOWLinePLot.test_summary": "PASSED",
    "TestOWLinePLot.test_unconditional_commit_on_new_signal": "PASSED",
    "TestOWLinePLot.test_visual_settings": "PASSED",
    "TestSegmentsIntersection.test_ccw": "PASSED",
    "TestSegmentsIntersection.test_intersects": "PASSED",
    "TestSegmentsIntersection.test_lines_intersection": "PASSED"
}
diff --git a/Orange/widgets/visualize/owlineplot.py b/Orange/widgets/visualize/owlineplot.py
index bce51e2b4..0a013584c 100644
--- a/Orange/widgets/visualize/owlineplot.py
+++ b/Orange/widgets/visualize/owlineplot.py
@@ -802,7 +802,7 @@ class OWLinePlot(OWWidget):
 
     def plot_groups(self):
         self._remove_groups()
-        data = self.data[self.valid_data, self.graph_variables]
+        data = self.data[self.valid_data][:, self.graph_variables]
         if self.group_var is None:
             self._plot_group(data, np.where(self.valid_data)[0])
         else:

{"Orange/widgets/visualize/owlineplot.py": "from typing import List\nfrom xml.sax.saxutils import escape\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QSize, QLineF, pyqtSignal as Signal\nfrom AnyQt.QtGui import QPainter, QPen, QColor\nfrom AnyQt.QtWidgets import QApplication, QGraphicsLineItem, QSizePolicy\n\nimport pyqtgraph as pg\nfrom pyqtgraph.functions import mkPen\nfrom pyqtgraph.graphicsItems.ViewBox import ViewBox\n\nfrom orangewidget.utils.listview import ListViewSearch\nfrom orangewidget.utils.visual_settings_dlg import VisualSettingsDialog\n\nfrom Orange.data import Table, DiscreteVariable\nfrom Orange.data.sql.table import SqlTable\nfrom Orange.statistics.util import countnans, nanmean, nanmin, nanmax, nanstd\nfrom Orange.widgets import gui, report\nfrom Orange.widgets.settings import (\n    Setting, ContextSetting, DomainContextHandler\n)\nfrom Orange.widgets.utils.annotated_data import (\n    create_annotated_table, ANNOTATED_DATA_SIGNAL_NAME\n)\nfrom Orange.widgets.utils.itemmodels import DomainModel\nfrom Orange.widgets.utils.plot import OWPlotGUI, SELECT, PANNING, ZOOMING\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.visualize.owdistributions import LegendItem\nfrom Orange.widgets.visualize.utils.customizableplot import Updater, \\\n    CommonParameterSetter\nfrom Orange.widgets.visualize.utils.plotutils import AxisItem\nfrom Orange.widgets.widget import OWWidget, Input, Output, Msg\n\n\ndef ccw(a, b, c):\n    \"\"\"\n    Checks whether three points are listed in a counterclockwise order.\n    \"\"\"\n    ax, ay = (a[:, 0], a[:, 1]) if a.ndim == 2 else (a[0], a[1])\n    bx, by = (b[:, 0], b[:, 1]) if b.ndim == 2 else (b[0], b[1])\n    cx, cy = (c[:, 0], c[:, 1]) if c.ndim == 2 else (c[0], c[1])\n    return (cy - ay) * (bx - ax) > (by - ay) * (cx - ax)\n\n\ndef intersects(a, b, c, d):\n    \"\"\"\n    Checks whether line segment a (given points a and b) intersects with line\n    segment b (given points c and d).\n    \"\"\"\n    return np.logical_and(ccw(a, c, d) != ccw(b, c, d),\n                          ccw(a, b, c) != ccw(a, b, d))\n\n\ndef line_intersects_profiles(p1, p2, table):\n    \"\"\"\n    Checks if a line intersects any line segments.\n\n    Parameters\n    ----------\n    p1, p2 : ndarray\n        Endpoints of the line, given x coordinate as p_[0]\n        and y coordinate as p_[1].\n    table : ndarray\n        An array of shape m x n x p; where m is number of connected points\n        for a individual profile (i. e. number of features), n is number\n        of instances, p is number of coordinates (x and y).\n\n    Returns\n    -------\n    result : ndarray\n        Array of bools with shape of number of instances in the table.\n    \"\"\"\n    res = np.zeros(len(table[0]), dtype=bool)\n    for i in range(len(table) - 1):\n        res = np.logical_or(res, intersects(p1, p2, table[i], table[i + 1]))\n    return res\n\n\nclass LinePlotStyle:\n    DEFAULT_COLOR = QColor(Qt.darkGray)\n    SELECTION_LINE_COLOR = QColor(Qt.black)\n    SELECTION_LINE_WIDTH = 2\n\n    UNSELECTED_LINE_WIDTH = 1\n    UNSELECTED_LINE_ALPHA = 100\n    UNSELECTED_LINE_ALPHA_SEL = 50  # unselected lines, when selection exists\n\n    SELECTED_LINE_WIDTH = 3\n    SELECTED_LINE_ALPHA = 170\n\n    RANGE_ALPHA = 25\n    SELECTED_RANGE_ALPHA = 50\n\n    MEAN_WIDTH = 6\n    MEAN_DARK_FACTOR = 110\n\n\nclass BottomAxisItem(AxisItem):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self._ticks = {}\n\n    def set_ticks(self, ticks):\n        self._ticks = dict(enumerate(ticks, 1)) if ticks else {}\n        if not ticks:\n            self.setTicks(None)\n\n    def tickStrings(self, values, scale, _):\n        return [self._ticks.get(v * scale, \"\") for v in values]\n\n\nclass LinePlotViewBox(ViewBox):\n    selection_changed = Signal(np.ndarray)\n\n    def __init__(self):\n        super().__init__(enableMenu=False)\n        self._profile_items = None\n        self._can_select = True\n        self._graph_state = SELECT\n\n        self.setMouseMode(self.PanMode)\n\n        pen = mkPen(LinePlotStyle.SELECTION_LINE_COLOR,\n                    width=LinePlotStyle.SELECTION_LINE_WIDTH)\n        self.selection_line = QGraphicsLineItem()\n        self.selection_line.setPen(pen)\n        self.selection_line.setZValue(1e9)\n        self.addItem(self.selection_line, ignoreBounds=True)\n\n    def update_selection_line(self, button_down_pos, current_pos):\n        p1 = self.childGroup.mapFromParent(button_down_pos)\n        p2 = self.childGroup.mapFromParent(current_pos)\n        self.selection_line.setLine(QLineF(p1, p2))\n        self.selection_line.resetTransform()\n        self.selection_line.show()\n\n    def set_graph_state(self, state):\n        self._graph_state = state\n\n    def enable_selection(self, enable):\n        self._can_select = enable\n\n    def get_selected(self, p1, p2):\n        if self._profile_items is None:\n            return np.array(False)\n        return line_intersects_profiles(np.array([p1.x(), p1.y()]),\n                                        np.array([p2.x(), p2.y()]),\n                                        self._profile_items)\n\n    def add_profiles(self, y):\n        if sp.issparse(y):\n            y = y.todense()\n        self._profile_items = np.array(\n            [np.vstack((np.full((1, y.shape[0]), i + 1), y[:, i].flatten())).T\n             for i in range(y.shape[1])])\n\n    def remove_profiles(self):\n        self._profile_items = None\n\n    def mouseDragEvent(self, ev, axis=None):\n        if self._graph_state == SELECT and axis is None and self._can_select:\n            ev.accept()\n            if ev.button() == Qt.LeftButton:\n                self.update_selection_line(ev.buttonDownPos(), ev.pos())\n                if ev.isFinish():\n                    self.selection_line.hide()\n                    p1 = self.childGroup.mapFromParent(\n                        ev.buttonDownPos(ev.button()))\n                    p2 = self.childGroup.mapFromParent(ev.pos())\n                    self.selection_changed.emit(self.get_selected(p1, p2))\n        elif self._graph_state == ZOOMING or self._graph_state == PANNING:\n            ev.ignore()\n            super().mouseDragEvent(ev, axis=axis)\n        else:\n            ev.ignore()\n\n    def mouseClickEvent(self, ev):\n        if ev.button() == Qt.RightButton:\n            self.autoRange()\n            self.enableAutoRange()\n        else:\n            ev.accept()\n            self.selection_changed.emit(np.array(False))\n\n    def reset(self):\n        self._profile_items = None\n        self._can_select = True\n        self._graph_state = SELECT\n\n\nclass ParameterSetter(CommonParameterSetter):\n    MEAN_LABEL = \"Mean\"\n    LINE_LABEL = \"Lines\"\n    SEL_LINE_LABEL = \"Selected lines\"\n    RANGE_LABEL = \"Range\"\n    SEL_RANGE_LABEL = \"Selected range\"\n\n    def __init__(self, master):\n        super().__init__()\n        self.master = master\n\n    def update_setters(self):\n        self.mean_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.MEAN_WIDTH,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n        }\n        self.line_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.UNSELECTED_LINE_WIDTH,\n            Updater.ALPHA_LABEL: LinePlotStyle.UNSELECTED_LINE_ALPHA,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n            Updater.ANTIALIAS_LABEL: True,\n        }\n        self.sel_line_settings = {\n            Updater.WIDTH_LABEL: LinePlotStyle.SELECTED_LINE_WIDTH,\n            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_LINE_ALPHA,\n            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,\n            Updater.ANTIALIAS_LABEL: False,\n        }\n        self.range_settings = {\n            Updater.ALPHA_LABEL: LinePlotStyle.RANGE_ALPHA,\n        }\n        self.sel_range_settings = {\n            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_RANGE_ALPHA,\n        }\n\n        self.initial_settings = {\n            self.LABELS_BOX: {\n                self.FONT_FAMILY_LABEL: self.FONT_FAMILY_SETTING,\n                self.TITLE_LABEL: self.FONT_SETTING,\n                self.AXIS_TITLE_LABEL: self.FONT_SETTING,\n                self.AXIS_TICKS_LABEL: self.FONT_SETTING,\n                self.LEGEND_LABEL: self.FONT_SETTING,\n            },\n            self.ANNOT_BOX: {\n                self.TITLE_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n                self.X_AXIS_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n                self.Y_AXIS_LABEL: {self.TITLE_LABEL: (\"\", \"\")},\n            },\n            self.PLOT_BOX: {\n                self.MEAN_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15), LinePlotStyle.MEAN_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                },\n                self.LINE_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15),\n                                          LinePlotStyle.UNSELECTED_LINE_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.UNSELECTED_LINE_ALPHA),\n                    Updater.ANTIALIAS_LABEL: (None, True),\n                },\n                self.SEL_LINE_LABEL: {\n                    Updater.WIDTH_LABEL: (range(1, 15),\n                                          LinePlotStyle.SELECTED_LINE_WIDTH),\n                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),\n                                          Updater.DEFAULT_LINE_STYLE),\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.SELECTED_LINE_ALPHA),\n                    Updater.ANTIALIAS_LABEL: (None, False),\n                },\n                self.RANGE_LABEL: {\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.RANGE_ALPHA),\n                },\n                self.SEL_RANGE_LABEL: {\n                    Updater.ALPHA_LABEL: (range(0, 255, 5),\n                                          LinePlotStyle.SELECTED_RANGE_ALPHA),\n                },\n            }\n        }\n\n        def update_mean(**settings):\n            self.mean_settings.update(**settings)\n            Updater.update_lines(self.mean_lines_items, **self.mean_settings)\n\n        def update_lines(**settings):\n            self.line_settings.update(**settings)\n            Updater.update_lines(self.lines_items, **self.line_settings)\n\n        def update_sel_lines(**settings):\n            self.sel_line_settings.update(**settings)\n            Updater.update_lines(self.sel_lines_items, **self.sel_line_settings)\n\n        def _update_brush(items, **settings):\n            for item in items:\n                brush = item.brush()\n                color = brush.color()\n                color.setAlpha(settings[Updater.ALPHA_LABEL])\n                brush.setColor(color)\n                item.setBrush(brush)\n\n        def update_range(**settings):\n            self.range_settings.update(**settings)\n            _update_brush(self.range_items, **settings)\n\n        def update_sel_range(**settings):\n            self.sel_range_settings.update(**settings)\n            _update_brush(self.sel_range_items, **settings)\n\n        self._setters[self.PLOT_BOX] = {\n            self.MEAN_LABEL: update_mean,\n            self.LINE_LABEL: update_lines,\n            self.SEL_LINE_LABEL: update_sel_lines,\n            self.RANGE_LABEL: update_range,\n            self.SEL_RANGE_LABEL: update_sel_range,\n        }\n\n    @property\n    def title_item(self):\n        return self.master.getPlotItem().titleLabel\n\n    @property\n    def axis_items(self):\n        return [value[\"item\"] for value in self.master.getPlotItem().axes.values()]\n\n    @property\n    def legend_items(self):\n        return self.master.legend.items\n\n    @property\n    def mean_lines_items(self):\n        return [group.mean for group in self.master.groups]\n\n    @property\n    def lines_items(self):\n        return [group.profiles for group in self.master.groups]\n\n    @property\n    def sel_lines_items(self):\n        return [group.sel_profiles for group in self.master.groups] + \\\n               [group.sub_profiles for group in self.master.groups]\n\n    @property\n    def range_items(self):\n        return [group.range for group in self.master.groups]\n\n    @property\n    def sel_range_items(self):\n        return [group.sel_range for group in self.master.groups]\n\n    @property\n    def getAxis(self):\n        return self.master.getAxis\n\n# Customizable plot widget\nclass LinePlotGraph(pg.PlotWidget):\n    def __init__(self, parent):\n        self.groups: List[ProfileGroup] = []\n        self.bottom_axis = BottomAxisItem(orientation=\"bottom\")\n        self.bottom_axis.setLabel(\"\")\n        left_axis = AxisItem(orientation=\"left\")\n        left_axis.setLabel(\"\")\n        super().__init__(parent, viewBox=LinePlotViewBox(),\n                         background=\"w\", enableMenu=False,\n                         axisItems={\"bottom\": self.bottom_axis,\n                                    \"left\": left_axis})\n        self.view_box = self.getViewBox()\n        self.selection = set()\n        self.legend = self._create_legend(((1, 0), (1, 0)))\n        self.getPlotItem().buttonsHidden = True\n        self.setRenderHint(QPainter.Antialiasing, True)\n\n        self.parameter_setter = ParameterSetter(self)\n\n    def _create_legend(self, anchor):\n        legend = LegendItem()\n        legend.setParentItem(self.view_box)\n        legend.restoreAnchor(anchor)\n        legend.hide()\n        return legend\n\n    def update_legend(self, variable):\n        self.legend.clear()\n        self.legend.hide()\n        if variable and variable.is_discrete:\n            for name, color in zip(variable.values, variable.colors):\n                c = QColor(*color)\n                dots = pg.ScatterPlotItem(pen=c, brush=c, size=10, shape=\"s\")\n                self.legend.addItem(dots, escape(name))\n            self.legend.show()\n        Updater.update_legend_font(self.parameter_setter.legend_items,\n                                   **self.parameter_setter.legend_settings)\n\n    def select(self, indices):\n        keys = QApplication.keyboardModifiers()\n        indices = set(indices)\n        if keys & Qt.ControlModifier:\n            self.selection ^= indices\n        elif keys & Qt.AltModifier:\n            self.selection -= indices\n        elif keys & Qt.ShiftModifier:\n            self.selection |= indices\n        else:\n            self.selection = indices\n\n    def reset(self):\n        self.selection = set()\n        self.view_box.reset()\n        self.clear()\n        self.getAxis('bottom').set_ticks(None)\n        self.legend.hide()\n        self.groups = []\n\n    def select_button_clicked(self):\n        self.view_box.set_graph_state(SELECT)\n        self.view_box.setMouseMode(self.view_box.RectMode)\n\n    def pan_button_clicked(self):\n        self.view_box.set_graph_state(PANNING)\n        self.view_box.setMouseMode(self.view_box.PanMode)\n\n    def zoom_button_clicked(self):\n        self.view_box.set_graph_state(ZOOMING)\n        self.view_box.setMouseMode(self.view_box.RectMode)\n\n    def reset_button_clicked(self):\n        self.view_box.autoRange()\n        self.view_box.enableAutoRange()\n\n\nclass ProfileGroup:\n    def __init__(self, data, indices, color, graph):\n        self.x_data = np.arange(1, data.X.shape[1] + 1)\n        self.y_data = data.X\n        self.indices = indices\n        self.ids = data.ids\n        self.color = color\n        self.graph = graph\n\n        self.profiles_added = False\n        self.sub_profiles_added = False\n        self.range_added = False\n        self.mean_added = False\n        self.error_bar_added = False\n\n        self.graph_items = []\n        self.__mean = nanmean(self.y_data, axis=0)\n        self.__create_curves()\n\n    def __create_curves(self):\n        self.profiles = self._get_profiles_curve()\n        self.sub_profiles = self._get_sel_profiles_curve()\n        self.sel_profiles = self._get_sel_profiles_curve()\n        self.range = self._get_range_curve()\n        self.sel_range = self._get_sel_range_curve()\n        self.mean = self._get_mean_curve()\n        self.error_bar = self._get_error_bar()\n        self.graph_items = [\n            self.mean, self.range, self.sel_range, self.profiles,\n            self.sub_profiles, self.sel_profiles, self.error_bar\n        ]\n\n    def _get_profiles_curve(self):\n        x, y, con = self.__get_disconnected_curve_data(self.y_data)\n        pen = self.make_pen(self.color)\n        curve = pg.PlotCurveItem(x=x, y=y, connect=con, pen=pen)\n        Updater.update_lines([curve], **self.graph.parameter_setter.line_settings)\n        return curve\n\n    def _get_sel_profiles_curve(self):\n        curve = pg.PlotCurveItem(x=None, y=None, pen=self.make_pen(self.color))\n        Updater.update_lines([curve], **self.graph.parameter_setter.sel_line_settings)\n        return curve\n\n    def _get_range_curve(self):\n        color = QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.range_settings[Updater.ALPHA_LABEL])\n        bottom, top = nanmin(self.y_data, axis=0), nanmax(self.y_data, axis=0)\n        return pg.FillBetweenItem(\n            pg.PlotDataItem(x=self.x_data, y=bottom),\n            pg.PlotDataItem(x=self.x_data, y=top), brush=color\n        )\n\n    def _get_sel_range_curve(self):\n        color = QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.sel_range_settings[Updater.ALPHA_LABEL])\n        curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)\n        return pg.FillBetweenItem(curve1, curve2, brush=color)\n\n    def _get_mean_curve(self):\n        pen = self.make_pen(self.color.darker(LinePlotStyle.MEAN_DARK_FACTOR))\n        curve = pg.PlotCurveItem(x=self.x_data, y=self.__mean, pen=pen)\n        Updater.update_lines([curve], **self.graph.parameter_setter.mean_settings)\n        return curve\n\n    def _get_error_bar(self):\n        std = nanstd(self.y_data, axis=0)\n        return pg.ErrorBarItem(x=self.x_data, y=self.__mean,\n                               bottom=std, top=std, beam=0.01)\n\n    def remove_items(self):\n        for item in self.graph_items:\n            self.graph.removeItem(item)\n        self.graph_items = []\n\n    def set_visible_profiles(self, show_profiles=True, show_range=True, **_):\n        if not self.profiles_added and show_profiles:\n            self.profiles_added = True\n            self.graph.addItem(self.profiles)\n            self.graph.addItem(self.sel_profiles)\n        if not self.sub_profiles_added and (show_profiles or show_range):\n            self.sub_profiles_added = True\n            self.graph.addItem(self.sub_profiles)\n        self.profiles.setVisible(show_profiles)\n        self.sel_profiles.setVisible(show_profiles)\n        self.sub_profiles.setVisible(show_profiles or show_range)\n\n    def set_visible_range(self, show_profiles=True, show_range=True, **_):\n        if not self.range_added and show_range:\n            self.range_added = True\n            self.graph.addItem(self.range)\n            self.graph.addItem(self.sel_range)\n        if not self.sub_profiles_added and (show_profiles or show_range):\n            self.sub_profiles_added = True\n            self.graph.addItem(self.sub_profiles)\n        self.range.setVisible(show_range)\n        self.sel_range.setVisible(show_range)\n        self.sub_profiles.setVisible(show_profiles or show_range)\n\n    def set_visible_mean(self, show_mean=True, **_):\n        if not self.mean_added and show_mean:\n            self.mean_added = True\n            self.graph.addItem(self.mean)\n        self.mean.setVisible(show_mean)\n\n    def set_visible_error(self, show_error=True, **_):\n        if not self.error_bar_added and show_error:\n            self.error_bar_added = True\n            self.graph.addItem(self.error_bar)\n        self.error_bar.setVisible(show_error)\n\n    def update_profiles_color(self, selection):\n        color = QColor(self.color)\n        alpha = self.graph.parameter_setter.line_settings[Updater.ALPHA_LABEL] \\\n            if not selection else LinePlotStyle.UNSELECTED_LINE_ALPHA_SEL\n        color.setAlpha(alpha)\n        pen = self.profiles.opts[\"pen\"]\n        pen.setColor(color)\n        self.profiles.setPen(pen)\n\n    def update_sel_profiles(self, y_data):\n        x, y, connect = self.__get_disconnected_curve_data(y_data) \\\n            if y_data is not None else (None, None, None)\n        self.sel_profiles.setData(x=x, y=y, connect=connect)\n\n    def update_sel_profiles_color(self, subset):\n        color = QColor(Qt.black) if subset else QColor(self.color)\n        color.setAlpha(self.graph.parameter_setter.sel_line_settings[Updater.ALPHA_LABEL])\n        pen = self.sel_profiles.opts[\"pen\"]\n        pen.setColor(color)\n        self.sel_profiles.setPen(pen)\n\n    def update_sub_profiles(self, y_data):\n        x, y, connect = self.__get_disconnected_curve_data(y_data) \\\n            if y_data is not None else (None, None, None)\n        self.sub_profiles.setData(x=x, y=y, connect=connect)\n\n    def update_sel_range(self, y_data):\n        if y_data is None:\n            curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)\n        else:\n            curve1 = pg.PlotDataItem(x=self.x_data, y=nanmin(y_data, axis=0))\n            curve2 = pg.PlotDataItem(x=self.x_data, y=nanmax(y_data, axis=0))\n        self.sel_range.setCurves(curve1, curve2)\n\n    @staticmethod\n    def __get_disconnected_curve_data(y_data):\n        m, n = y_data.shape\n        x = np.arange(m * n) % n + 1\n        y = y_data.A.flatten() if sp.issparse(y_data) else y_data.flatten()\n        connect = np.ones_like(y, bool)\n        connect[n - 1:: n] = False\n        return x, y, connect\n\n    @staticmethod\n    def make_pen(color, width=1):\n        pen = QPen(color, width)\n        pen.setCosmetic(True)\n        return pen\n\n\nMAX_FEATURES = 200\nSEL_MAX_INSTANCES = 10000\n\n\nclass OWLinePlot(OWWidget):\n    name = \"Line Plot\"\n    description = \"Visualization of data profiles (e.g., time series).\"\n    icon = \"icons/LinePlot.svg\"\n    priority = 180\n\n    buttons_area_orientation = Qt.Vertical\n    enable_selection = Signal(bool)\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        data_subset = Input(\"Data Subset\", Table)\n\n    class Outputs:\n        selected_data = Output(\"Selected Data\", Table, default=True)\n        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)\n\n    settingsHandler = DomainContextHandler()\n    group_var = ContextSetting(None)\n    show_profiles = Setting(False)\n    show_range = Setting(True)\n    show_mean = Setting(True)\n    show_error = Setting(False)\n    auto_commit = Setting(True)\n    selection = Setting(None, schema_only=True)\n    visual_settings = Setting({}, schema_only=True)\n\n    graph_name = \"graph.plotItem\"\n\n    class Error(OWWidget.Error):\n        not_enough_attrs = Msg(\"Need at least one numeric feature.\")\n        no_valid_data = Msg(\"No plot due to no valid data.\")\n\n    class Warning(OWWidget.Warning):\n        no_display_option = Msg(\"No display option is selected.\")\n\n    class Information(OWWidget.Information):\n        hidden_instances = Msg(\"Instances with unknown values are not shown.\")\n        too_many_features = Msg(\"Data has too many features. Only first {}\"\n                                \" are shown.\".format(MAX_FEATURES))\n\n    def __init__(self, parent=None):\n        super().__init__(parent)\n        self.__groups = []\n        self.data = None\n        self.valid_data = None\n        self.subset_data = None\n        self.subset_indices = None\n        self.__pending_selection = self.selection\n        self.graph_variables = []\n        self.graph = None\n        self.group_vars = None\n        self.group_view = None\n        self.setup_gui()\n\n        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)\n        self.graph.view_box.selection_changed.connect(self.selection_changed)\n        self.enable_selection.connect(self.graph.view_box.enable_selection)\n\n    def setup_gui(self):\n        self._add_graph()\n        self._add_controls()\n\n    def _add_graph(self):\n        box = gui.vBox(self.mainArea, True, margin=0)\n        self.graph = LinePlotGraph(self)\n        box.layout().addWidget(self.graph)\n\n    def _add_controls(self):\n        displaybox = gui.widgetBox(self.controlArea, \"Display\")\n        gui.checkBox(displaybox, self, \"show_profiles\", \"Lines\",\n                     callback=self.__show_profiles_changed,\n                     tooltip=\"Plot lines\")\n        gui.checkBox(displaybox, self, \"show_range\", \"Range\",\n                     callback=self.__show_range_changed,\n                     tooltip=\"Plot range between 10th and 90th percentile\")\n        gui.checkBox(displaybox, self, \"show_mean\", \"Mean\",\n                     callback=self.__show_mean_changed,\n                     tooltip=\"Plot mean curve\")\n        gui.checkBox(displaybox, self, \"show_error\", \"Error bars\",\n                     callback=self.__show_error_changed,\n                     tooltip=\"Show standard deviation\")\n\n        self.group_vars = DomainModel(\n            placeholder=\"None\", separators=False, valid_types=DiscreteVariable)\n        self.group_view = gui.listView(\n            self.controlArea, self, \"group_var\", box=\"Group by\",\n            model=self.group_vars, callback=self.__group_var_changed,\n            sizeHint=QSize(30, 100), viewType=ListViewSearch,\n            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)\n        )\n        self.group_view.setEnabled(False)\n\n        plot_gui = OWPlotGUI(self)\n        plot_gui.box_zoom_select(self.buttonsArea)\n        gui.auto_send(self.buttonsArea, self, \"auto_commit\")\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n    def __show_profiles_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"profiles\")\n\n    def __show_range_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"range\")\n\n    def __show_mean_changed(self):\n        self.check_display_options()\n        self._update_visibility(\"mean\")\n\n    def __show_error_changed(self):\n        self._update_visibility(\"error\")\n\n    def __group_var_changed(self):\n        if self.data is None or not self.graph_variables:\n            return\n        self.plot_groups()\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self._update_sub_profiles()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        self._set_input_summary()\n        self.clear()\n        self.check_data()\n        self.check_display_options()\n\n        if self.data is not None:\n            self.group_vars.set_domain(self.data.domain)\n            self.group_view.setEnabled(len(self.group_vars) > 1)\n            self.group_var = self.data.domain.class_var \\\n                if self.data.domain.has_discrete_class else None\n\n        self.openContext(data)\n        self.setup_plot()\n        self.unconditional_commit()\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        self.clear_messages()\n        if self.data is not None:\n            self.graph_variables = [var for var in self.data.domain.attributes\n                                    if var.is_continuous]\n            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)\n            if len(self.graph_variables) < 1:\n                error(self.Error.not_enough_attrs)\n            elif not np.sum(self.valid_data):\n                error(self.Error.no_valid_data)\n            else:\n                if not np.all(self.valid_data):\n                    self.Information.hidden_instances()\n                if len(self.graph_variables) > MAX_FEATURES:\n                    self.Information.too_many_features()\n                    self.graph_variables = self.graph_variables[:MAX_FEATURES]\n\n    def check_display_options(self):\n        self.Warning.no_display_option.clear()\n        if self.data is not None:\n            if not (self.show_profiles or self.show_range or self.show_mean):\n                self.Warning.no_display_option()\n            enable = (self.show_profiles or self.show_range) and \\\n                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES\n            self.enable_selection.emit(enable)\n\n    def _set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    @Inputs.data_subset\n    @check_sql_input\n    def set_subset_data(self, subset):\n        self.subset_data = subset\n\n    def handleNewSignals(self):\n        self.set_subset_ids()\n        if self.data is not None:\n            self._update_profiles_color()\n            self._update_sel_profiles_color()\n            self._update_sub_profiles()\n\n    def set_subset_ids(self):\n        sub_ids = {e.id for e in self.subset_data} \\\n            if self.subset_data is not None else {}\n        self.subset_indices = None\n        if self.data is not None and sub_ids:\n            self.subset_indices = [x.id for x in self.data[self.valid_data]\n                                   if x.id in sub_ids]\n\n    def setup_plot(self):\n        if self.data is None:\n            return\n\n        ticks = [a.name for a in self.graph_variables]\n        self.graph.getAxis(\"bottom\").set_ticks(ticks)\n        self.plot_groups()\n        self.apply_selection()\n        self.graph.view_box.enableAutoRange()\n        self.graph.view_box.updateAutoRange()\n\n    def plot_groups(self):\n        self._remove_groups()\n        data = self.data[self.valid_data, self.graph_variables]\n        if self.group_var is None:\n            self._plot_group(data, np.where(self.valid_data)[0])\n        else:\n            class_col_data, _ = self.data.get_column_view(self.group_var)\n            for index in range(len(self.group_var.values)):\n                mask = np.logical_and(class_col_data == index, self.valid_data)\n                indices = np.flatnonzero(mask)\n                if not len(indices):\n                    continue\n                group_data = self.data[indices, self.graph_variables]\n                self._plot_group(group_data, indices, index)\n        self.graph.update_legend(self.group_var)\n        self.graph.groups = self.__groups\n        self.graph.view_box.add_profiles(data.X)\n\n    def _remove_groups(self):\n        for group in self.__groups:\n            group.remove_items()\n        self.graph.view_box.remove_profiles()\n        self.graph.groups = []\n        self.__groups = []\n\n    def _plot_group(self, data, indices, index=None):\n        color = self.__get_group_color(index)\n        group = ProfileGroup(data, indices, color, self.graph)\n        kwargs = self.__get_visibility_flags()\n        group.set_visible_error(**kwargs)\n        group.set_visible_mean(**kwargs)\n        group.set_visible_range(**kwargs)\n        group.set_visible_profiles(**kwargs)\n        self.__groups.append(group)\n\n    def __get_group_color(self, index):\n        if self.group_var is not None:\n            return QColor(*self.group_var.colors[index])\n        return QColor(LinePlotStyle.DEFAULT_COLOR)\n\n    def __get_visibility_flags(self):\n        return {\"show_profiles\": self.show_profiles,\n                \"show_range\": self.show_range,\n                \"show_mean\": self.show_mean,\n                \"show_error\": self.show_error}\n\n    def _update_profiles_color(self):\n        # color alpha depends on subset and selection; with selection or\n        # subset profiles color has more opacity\n        if not self.show_profiles:\n            return\n        for group in self.__groups:\n            has_sel = bool(self.subset_indices) or bool(self.selection)\n            group.update_profiles_color(has_sel)\n\n    def _update_sel_profiles_and_range(self):\n        # mark selected instances and selected range\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i in group.indices if self.__in(i, self.selection)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            if self.show_profiles:\n                group.update_sel_profiles(table)\n            if self.show_range:\n                group.update_sel_range(table)\n\n    def _update_sel_profiles_color(self):\n        # color depends on subset; when subset is present,\n        # selected profiles are black\n        if not self.selection or not self.show_profiles:\n            return\n        for group in self.__groups:\n            group.update_sel_profiles_color(bool(self.subset_indices))\n\n    def _update_sub_profiles(self):\n        # mark subset instances\n        if not (self.show_profiles or self.show_range):\n            return\n        for group in self.__groups:\n            inds = [i for i, _id in zip(group.indices, group.ids)\n                    if self.__in(_id, self.subset_indices)]\n            table = self.data[inds, self.graph_variables].X if inds else None\n            group.update_sub_profiles(table)\n\n    def _update_visibility(self, obj_name):\n        if not len(self.__groups):\n            return\n        self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        kwargs = self.__get_visibility_flags()\n        for group in self.__groups:\n            getattr(group, \"set_visible_{}\".format(obj_name))(**kwargs)\n        self.graph.view_box.updateAutoRange()\n\n    def apply_selection(self):\n        if self.data is not None and self.__pending_selection is not None:\n            sel = [i for i in self.__pending_selection if i < len(self.data)]\n            mask = np.zeros(len(self.data), dtype=bool)\n            mask[sel] = True\n            mask = mask[self.valid_data]\n            self.selection_changed(mask)\n            self.__pending_selection = None\n\n    def selection_changed(self, mask):\n        if self.data is None:\n            return\n        # need indices for self.data: mask refers to self.data[self.valid_data]\n        indices = np.arange(len(self.data))[self.valid_data][mask]\n        self.graph.select(indices)\n        old = self.selection\n        self.selection = None if self.data and isinstance(self.data, SqlTable)\\\n            else list(self.graph.selection)\n        if not old and self.selection or old and not self.selection:\n            self._update_profiles_color()\n        self._update_sel_profiles_and_range()\n        self._update_sel_profiles_color()\n        self.commit()\n\n    def commit(self):\n        selected = self.data[self.selection] \\\n            if self.data is not None and bool(self.selection) else None\n        annotated = create_annotated_table(self.data, self.selection)\n\n        summary = len(selected) if selected else self.info.NoOutput\n        details = format_summary_details(selected) if selected else \"\"\n        self.info.set_output_summary(summary, details)\n        self.Outputs.selected_data.send(selected)\n        self.Outputs.annotated_data.send(annotated)\n\n    def send_report(self):\n        if self.data is None:\n            return\n\n        caption = report.render_items_vert(((\"Group by\", self.group_var),))\n        self.report_plot()\n        if caption:\n            self.report_caption(caption)\n\n    def sizeHint(self):\n        return QSize(1132, 708)\n\n    def clear(self):\n        self.valid_data = None\n        self.selection = None\n        self.__groups = []\n        self.graph_variables = []\n        self.graph.reset()\n        self.group_vars.set_domain(None)\n        self.group_view.setEnabled(False)\n\n    @staticmethod\n    def __in(obj, collection):\n        return collection is not None and obj in collection\n\n    def set_visual_settings(self, key, value):\n        self.graph.parameter_setter.set_parameter(key, value)\n        self.visual_settings[key] = value\n\n\nif __name__ == \"__main__\":\n    brown = Table(\"brown-selected\")\n    WidgetPreview(OWLinePlot).run(set_data=brown, set_subset_data=brown[:30])\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:** Line Plot crashes when processing single instance input data

**Description:**
When providing a single instance of data to the Line Plot widget, it fails to process the input correctly and raises an error. This issue occurs because the widget incorrectly indexes the data, resulting in an empty array during the plotting process.

**Example:**
```python
# Initialize the Line Plot widget and send a single instance of housing data
widget.send_signal(widget.Inputs.data, housing_data[:1])

# This action leads to the following error:
# ValueError: zero-size array to reduction operation fmin which has no identity
```

**Expected Behavior:**
The Line Plot widget should handle single instance inputs without crashing. It should correctly index the data and either display the plot appropriately or inform the user that there is insufficient data for plotting.

[/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/visualize/owlineplot.py
from typing import List
from xml.sax.saxutils import escape

import numpy as np
import scipy.sparse as sp

from AnyQt.QtCore import Qt, QSize, QLineF, pyqtSignal as Signal
from AnyQt.QtGui import QPainter, QPen, QColor
from AnyQt.QtWidgets import QApplication, QGraphicsLineItem, QSizePolicy

import pyqtgraph as pg
from pyqtgraph.functions import mkPen
from pyqtgraph.graphicsItems.ViewBox import ViewBox

from orangewidget.utils.listview import ListViewSearch
from orangewidget.utils.visual_settings_dlg import VisualSettingsDialog

from Orange.data import Table, DiscreteVariable
from Orange.data.sql.table import SqlTable
from Orange.statistics.util import countnans, nanmean, nanmin, nanmax, nanstd
from Orange.widgets import gui, report
from Orange.widgets.settings import (
    Setting, ContextSetting, DomainContextHandler
)
from Orange.widgets.utils.annotated_data import (
    create_annotated_table, ANNOTATED_DATA_SIGNAL_NAME
)
from Orange.widgets.utils.itemmodels import DomainModel
from Orange.widgets.utils.plot import OWPlotGUI, SELECT, PANNING, ZOOMING
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.utils.state_summary import format_summary_details
from Orange.widgets.visualize.owdistributions import LegendItem
from Orange.widgets.visualize.utils.customizableplot import Updater, \
    CommonParameterSetter
from Orange.widgets.visualize.utils.plotutils import AxisItem
from Orange.widgets.widget import OWWidget, Input, Output, Msg


def ccw(a, b, c):
    """
    Checks whether three points are listed in a counterclockwise order.
    """
    ax, ay = (a[:, 0], a[:, 1]) if a.ndim == 2 else (a[0], a[1])
    bx, by = (b[:, 0], b[:, 1]) if b.ndim == 2 else (b[0], b[1])
    cx, cy = (c[:, 0], c[:, 1]) if c.ndim == 2 else (c[0], c[1])
    return (cy - ay) * (bx - ax) > (by - ay) * (cx - ax)


def intersects(a, b, c, d):
    """
    Checks whether line segment a (given points a and b) intersects with line
    segment b (given points c and d).
    """
    return np.logical_and(ccw(a, c, d) != ccw(b, c, d),
                          ccw(a, b, c) != ccw(a, b, d))


def line_intersects_profiles(p1, p2, table):
    """
    Checks if a line intersects any line segments.

    Parameters
    ----------
    p1, p2 : ndarray
        Endpoints of the line, given x coordinate as p_[0]
        and y coordinate as p_[1].
    table : ndarray
        An array of shape m x n x p; where m is number of connected points
        for a individual profile (i. e. number of features), n is number
        of instances, p is number of coordinates (x and y).

    Returns
    -------
    result : ndarray
        Array of bools with shape of number of instances in the table.
    """
    res = np.zeros(len(table[0]), dtype=bool)
    for i in range(len(table) - 1):
        res = np.logical_or(res, intersects(p1, p2, table[i], table[i + 1]))
    return res


class LinePlotStyle:
    DEFAULT_COLOR = QColor(Qt.darkGray)
    SELECTION_LINE_COLOR = QColor(Qt.black)
    SELECTION_LINE_WIDTH = 2

    UNSELECTED_LINE_WIDTH = 1
    UNSELECTED_LINE_ALPHA = 100
    UNSELECTED_LINE_ALPHA_SEL = 50  # unselected lines, when selection exists

    SELECTED_LINE_WIDTH = 3
    SELECTED_LINE_ALPHA = 170

    RANGE_ALPHA = 25
    SELECTED_RANGE_ALPHA = 50

    MEAN_WIDTH = 6
    MEAN_DARK_FACTOR = 110


class BottomAxisItem(AxisItem):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._ticks = {}

    def set_ticks(self, ticks):
        self._ticks = dict(enumerate(ticks, 1)) if ticks else {}
        if not ticks:
            self.setTicks(None)

    def tickStrings(self, values, scale, _):
        return [self._ticks.get(v * scale, "") for v in values]


class LinePlotViewBox(ViewBox):
    selection_changed = Signal(np.ndarray)

    def __init__(self):
        super().__init__(enableMenu=False)
        self._profile_items = None
        self._can_select = True
        self._graph_state = SELECT

        self.setMouseMode(self.PanMode)

        pen = mkPen(LinePlotStyle.SELECTION_LINE_COLOR,
                    width=LinePlotStyle.SELECTION_LINE_WIDTH)
        self.selection_line = QGraphicsLineItem()
        self.selection_line.setPen(pen)
        self.selection_line.setZValue(1e9)
        self.addItem(self.selection_line, ignoreBounds=True)

    def update_selection_line(self, button_down_pos, current_pos):
        p1 = self.childGroup.mapFromParent(button_down_pos)
        p2 = self.childGroup.mapFromParent(current_pos)
        self.selection_line.setLine(QLineF(p1, p2))
        self.selection_line.resetTransform()
        self.selection_line.show()

    def set_graph_state(self, state):
        self._graph_state = state

    def enable_selection(self, enable):
        self._can_select = enable

    def get_selected(self, p1, p2):
        if self._profile_items is None:
            return np.array(False)
        return line_intersects_profiles(np.array([p1.x(), p1.y()]),
                                        np.array([p2.x(), p2.y()]),
                                        self._profile_items)

    def add_profiles(self, y):
        if sp.issparse(y):
            y = y.todense()
        self._profile_items = np.array(
            [np.vstack((np.full((1, y.shape[0]), i + 1), y[:, i].flatten())).T
             for i in range(y.shape[1])])

    def remove_profiles(self):
        self._profile_items = None

    def mouseDragEvent(self, ev, axis=None):
        if self._graph_state == SELECT and axis is None and self._can_select:
            ev.accept()
            if ev.button() == Qt.LeftButton:
                self.update_selection_line(ev.buttonDownPos(), ev.pos())
                if ev.isFinish():
                    self.selection_line.hide()
                    p1 = self.childGroup.mapFromParent(
                        ev.buttonDownPos(ev.button()))
                    p2 = self.childGroup.mapFromParent(ev.pos())
                    self.selection_changed.emit(self.get_selected(p1, p2))
        elif self._graph_state == ZOOMING or self._graph_state == PANNING:
            ev.ignore()
            super().mouseDragEvent(ev, axis=axis)
        else:
            ev.ignore()

    def mouseClickEvent(self, ev):
        if ev.button() == Qt.RightButton:
            self.autoRange()
            self.enableAutoRange()
        else:
            ev.accept()
            self.selection_changed.emit(np.array(False))

    def reset(self):
        self._profile_items = None
        self._can_select = True
        self._graph_state = SELECT


class ParameterSetter(CommonParameterSetter):
    MEAN_LABEL = "Mean"
    LINE_LABEL = "Lines"
    SEL_LINE_LABEL = "Selected lines"
    RANGE_LABEL = "Range"
    SEL_RANGE_LABEL = "Selected range"

    def __init__(self, master):
        super().__init__()
        self.master = master

    def update_setters(self):
        self.mean_settings = {
            Updater.WIDTH_LABEL: LinePlotStyle.MEAN_WIDTH,
            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,
        }
        self.line_settings = {
            Updater.WIDTH_LABEL: LinePlotStyle.UNSELECTED_LINE_WIDTH,
            Updater.ALPHA_LABEL: LinePlotStyle.UNSELECTED_LINE_ALPHA,
            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,
            Updater.ANTIALIAS_LABEL: True,
        }
        self.sel_line_settings = {
            Updater.WIDTH_LABEL: LinePlotStyle.SELECTED_LINE_WIDTH,
            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_LINE_ALPHA,
            Updater.STYLE_LABEL: Updater.DEFAULT_LINE_STYLE,
            Updater.ANTIALIAS_LABEL: False,
        }
        self.range_settings = {
            Updater.ALPHA_LABEL: LinePlotStyle.RANGE_ALPHA,
        }
        self.sel_range_settings = {
            Updater.ALPHA_LABEL: LinePlotStyle.SELECTED_RANGE_ALPHA,
        }

        self.initial_settings = {
            self.LABELS_BOX: {
                self.FONT_FAMILY_LABEL: self.FONT_FAMILY_SETTING,
                self.TITLE_LABEL: self.FONT_SETTING,
                self.AXIS_TITLE_LABEL: self.FONT_SETTING,
                self.AXIS_TICKS_LABEL: self.FONT_SETTING,
                self.LEGEND_LABEL: self.FONT_SETTING,
            },
            self.ANNOT_BOX: {
                self.TITLE_LABEL: {self.TITLE_LABEL: ("", "")},
                self.X_AXIS_LABEL: {self.TITLE_LABEL: ("", "")},
                self.Y_AXIS_LABEL: {self.TITLE_LABEL: ("", "")},
            },
            self.PLOT_BOX: {
                self.MEAN_LABEL: {
                    Updater.WIDTH_LABEL: (range(1, 15), LinePlotStyle.MEAN_WIDTH),
                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),
                                          Updater.DEFAULT_LINE_STYLE),
                },
                self.LINE_LABEL: {
                    Updater.WIDTH_LABEL: (range(1, 15),
                                          LinePlotStyle.UNSELECTED_LINE_WIDTH),
                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),
                                          Updater.DEFAULT_LINE_STYLE),
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.UNSELECTED_LINE_ALPHA),
                    Updater.ANTIALIAS_LABEL: (None, True),
                },
                self.SEL_LINE_LABEL: {
                    Updater.WIDTH_LABEL: (range(1, 15),
                                          LinePlotStyle.SELECTED_LINE_WIDTH),
                    Updater.STYLE_LABEL: (list(Updater.LINE_STYLES),
                                          Updater.DEFAULT_LINE_STYLE),
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.SELECTED_LINE_ALPHA),
                    Updater.ANTIALIAS_LABEL: (None, False),
                },
                self.RANGE_LABEL: {
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.RANGE_ALPHA),
                },
                self.SEL_RANGE_LABEL: {
                    Updater.ALPHA_LABEL: (range(0, 255, 5),
                                          LinePlotStyle.SELECTED_RANGE_ALPHA),
                },
            }
        }

        def update_mean(**settings):
            self.mean_settings.update(**settings)
            Updater.update_lines(self.mean_lines_items, **self.mean_settings)

        def update_lines(**settings):
            self.line_settings.update(**settings)
            Updater.update_lines(self.lines_items, **self.line_settings)

        def update_sel_lines(**settings):
            self.sel_line_settings.update(**settings)
            Updater.update_lines(self.sel_lines_items, **self.sel_line_settings)

        def _update_brush(items, **settings):
            for item in items:
                brush = item.brush()
                color = brush.color()
                color.setAlpha(settings[Updater.ALPHA_LABEL])
                brush.setColor(color)
                item.setBrush(brush)

        def update_range(**settings):
            self.range_settings.update(**settings)
            _update_brush(self.range_items, **settings)

        def update_sel_range(**settings):
            self.sel_range_settings.update(**settings)
            _update_brush(self.sel_range_items, **settings)

        self._setters[self.PLOT_BOX] = {
            self.MEAN_LABEL: update_mean,
            self.LINE_LABEL: update_lines,
            self.SEL_LINE_LABEL: update_sel_lines,
            self.RANGE_LABEL: update_range,
            self.SEL_RANGE_LABEL: update_sel_range,
        }

    @property
    def title_item(self):
        return self.master.getPlotItem().titleLabel

    @property
    def axis_items(self):
        return [value["item"] for value in self.master.getPlotItem().axes.values()]

    @property
    def legend_items(self):
        return self.master.legend.items

    @property
    def mean_lines_items(self):
        return [group.mean for group in self.master.groups]

    @property
    def lines_items(self):
        return [group.profiles for group in self.master.groups]

    @property
    def sel_lines_items(self):
        return [group.sel_profiles for group in self.master.groups] + \
               [group.sub_profiles for group in self.master.groups]

    @property
    def range_items(self):
        return [group.range for group in self.master.groups]

    @property
    def sel_range_items(self):
        return [group.sel_range for group in self.master.groups]

    @property
    def getAxis(self):
        return self.master.getAxis

# Customizable plot widget
class LinePlotGraph(pg.PlotWidget):
    def __init__(self, parent):
        self.groups: List[ProfileGroup] = []
        self.bottom_axis = BottomAxisItem(orientation="bottom")
        self.bottom_axis.setLabel("")
        left_axis = AxisItem(orientation="left")
        left_axis.setLabel("")
        super().__init__(parent, viewBox=LinePlotViewBox(),
                         background="w", enableMenu=False,
                         axisItems={"bottom": self.bottom_axis,
                                    "left": left_axis})
        self.view_box = self.getViewBox()
        self.selection = set()
        self.legend = self._create_legend(((1, 0), (1, 0)))
        self.getPlotItem().buttonsHidden = True
        self.setRenderHint(QPainter.Antialiasing, True)

        self.parameter_setter = ParameterSetter(self)

    def _create_legend(self, anchor):
        legend = LegendItem()
        legend.setParentItem(self.view_box)
        legend.restoreAnchor(anchor)
        legend.hide()
        return legend

    def update_legend(self, variable):
        self.legend.clear()
        self.legend.hide()
        if variable and variable.is_discrete:
            for name, color in zip(variable.values, variable.colors):
                c = QColor(*color)
                dots = pg.ScatterPlotItem(pen=c, brush=c, size=10, shape="s")
                self.legend.addItem(dots, escape(name))
            self.legend.show()
        Updater.update_legend_font(self.parameter_setter.legend_items,
                                   **self.parameter_setter.legend_settings)

    def select(self, indices):
        keys = QApplication.keyboardModifiers()
        indices = set(indices)
        if keys & Qt.ControlModifier:
            self.selection ^= indices
        elif keys & Qt.AltModifier:
            self.selection -= indices
        elif keys & Qt.ShiftModifier:
            self.selection |= indices
        else:
            self.selection = indices

    def reset(self):
        self.selection = set()
        self.view_box.reset()
        self.clear()
        self.getAxis('bottom').set_ticks(None)
        self.legend.hide()
        self.groups = []

    def select_button_clicked(self):
        self.view_box.set_graph_state(SELECT)
        self.view_box.setMouseMode(self.view_box.RectMode)

    def pan_button_clicked(self):
        self.view_box.set_graph_state(PANNING)
        self.view_box.setMouseMode(self.view_box.PanMode)

    def zoom_button_clicked(self):
        self.view_box.set_graph_state(ZOOMING)
        self.view_box.setMouseMode(self.view_box.RectMode)

    def reset_button_clicked(self):
        self.view_box.autoRange()
        self.view_box.enableAutoRange()


class ProfileGroup:
    def __init__(self, data, indices, color, graph):
        self.x_data = np.arange(1, data.X.shape[1] + 1)
        self.y_data = data.X
        self.indices = indices
        self.ids = data.ids
        self.color = color
        self.graph = graph

        self.profiles_added = False
        self.sub_profiles_added = False
        self.range_added = False
        self.mean_added = False
        self.error_bar_added = False

        self.graph_items = []
        self.__mean = nanmean(self.y_data, axis=0)
        self.__create_curves()

    def __create_curves(self):
        self.profiles = self._get_profiles_curve()
        self.sub_profiles = self._get_sel_profiles_curve()
        self.sel_profiles = self._get_sel_profiles_curve()
        self.range = self._get_range_curve()
        self.sel_range = self._get_sel_range_curve()
        self.mean = self._get_mean_curve()
        self.error_bar = self._get_error_bar()
        self.graph_items = [
            self.mean, self.range, self.sel_range, self.profiles,
            self.sub_profiles, self.sel_profiles, self.error_bar
        ]

    def _get_profiles_curve(self):
        x, y, con = self.__get_disconnected_curve_data(self.y_data)
        pen = self.make_pen(self.color)
        curve = pg.PlotCurveItem(x=x, y=y, connect=con, pen=pen)
        Updater.update_lines([curve], **self.graph.parameter_setter.line_settings)
        return curve

    def _get_sel_profiles_curve(self):
        curve = pg.PlotCurveItem(x=None, y=None, pen=self.make_pen(self.color))
        Updater.update_lines([curve], **self.graph.parameter_setter.sel_line_settings)
        return curve

    def _get_range_curve(self):
        color = QColor(self.color)
        color.setAlpha(self.graph.parameter_setter.range_settings[Updater.ALPHA_LABEL])
        bottom, top = nanmin(self.y_data, axis=0), nanmax(self.y_data, axis=0)
        return pg.FillBetweenItem(
            pg.PlotDataItem(x=self.x_data, y=bottom),
            pg.PlotDataItem(x=self.x_data, y=top), brush=color
        )

    def _get_sel_range_curve(self):
        color = QColor(self.color)
        color.setAlpha(self.graph.parameter_setter.sel_range_settings[Updater.ALPHA_LABEL])
        curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)
        return pg.FillBetweenItem(curve1, curve2, brush=color)

    def _get_mean_curve(self):
        pen = self.make_pen(self.color.darker(LinePlotStyle.MEAN_DARK_FACTOR))
        curve = pg.PlotCurveItem(x=self.x_data, y=self.__mean, pen=pen)
        Updater.update_lines([curve], **self.graph.parameter_setter.mean_settings)
        return curve

    def _get_error_bar(self):
        std = nanstd(self.y_data, axis=0)
        return pg.ErrorBarItem(x=self.x_data, y=self.__mean,
                               bottom=std, top=std, beam=0.01)

    def remove_items(self):
        for item in self.graph_items:
            self.graph.removeItem(item)
        self.graph_items = []

    def set_visible_profiles(self, show_profiles=True, show_range=True, **_):
        if not self.profiles_added and show_profiles:
            self.profiles_added = True
            self.graph.addItem(self.profiles)
            self.graph.addItem(self.sel_profiles)
        if not self.sub_profiles_added and (show_profiles or show_range):
            self.sub_profiles_added = True
            self.graph.addItem(self.sub_profiles)
        self.profiles.setVisible(show_profiles)
        self.sel_profiles.setVisible(show_profiles)
        self.sub_profiles.setVisible(show_profiles or show_range)

    def set_visible_range(self, show_profiles=True, show_range=True, **_):
        if not self.range_added and show_range:
            self.range_added = True
            self.graph.addItem(self.range)
            self.graph.addItem(self.sel_range)
        if not self.sub_profiles_added and (show_profiles or show_range):
            self.sub_profiles_added = True
            self.graph.addItem(self.sub_profiles)
        self.range.setVisible(show_range)
        self.sel_range.setVisible(show_range)
        self.sub_profiles.setVisible(show_profiles or show_range)

    def set_visible_mean(self, show_mean=True, **_):
        if not self.mean_added and show_mean:
            self.mean_added = True
            self.graph.addItem(self.mean)
        self.mean.setVisible(show_mean)

    def set_visible_error(self, show_error=True, **_):
        if not self.error_bar_added and show_error:
            self.error_bar_added = True
            self.graph.addItem(self.error_bar)
        self.error_bar.setVisible(show_error)

    def update_profiles_color(self, selection):
        color = QColor(self.color)
        alpha = self.graph.parameter_setter.line_settings[Updater.ALPHA_LABEL] \
            if not selection else LinePlotStyle.UNSELECTED_LINE_ALPHA_SEL
        color.setAlpha(alpha)
        pen = self.profiles.opts["pen"]
        pen.setColor(color)
        self.profiles.setPen(pen)

    def update_sel_profiles(self, y_data):
        x, y, connect = self.__get_disconnected_curve_data(y_data) \
            if y_data is not None else (None, None, None)
        self.sel_profiles.setData(x=x, y=y, connect=connect)

    def update_sel_profiles_color(self, subset):
        color = QColor(Qt.black) if subset else QColor(self.color)
        color.setAlpha(self.graph.parameter_setter.sel_line_settings[Updater.ALPHA_LABEL])
        pen = self.sel_profiles.opts["pen"]
        pen.setColor(color)
        self.sel_profiles.setPen(pen)

    def update_sub_profiles(self, y_data):
        x, y, connect = self.__get_disconnected_curve_data(y_data) \
            if y_data is not None else (None, None, None)
        self.sub_profiles.setData(x=x, y=y, connect=connect)

    def update_sel_range(self, y_data):
        if y_data is None:
            curve1 = curve2 = pg.PlotDataItem(x=self.x_data, y=self.__mean)
        else:
            curve1 = pg.PlotDataItem(x=self.x_data, y=nanmin(y_data, axis=0))
            curve2 = pg.PlotDataItem(x=self.x_data, y=nanmax(y_data, axis=0))
        self.sel_range.setCurves(curve1, curve2)

    @staticmethod
    def __get_disconnected_curve_data(y_data):
        m, n = y_data.shape
        x = np.arange(m * n) % n + 1
        y = y_data.A.flatten() if sp.issparse(y_data) else y_data.flatten()
        connect = np.ones_like(y, bool)
        connect[n - 1:: n] = False
        return x, y, connect

    @staticmethod
    def make_pen(color, width=1):
        pen = QPen(color, width)
        pen.setCosmetic(True)
        return pen


MAX_FEATURES = 200
SEL_MAX_INSTANCES = 10000


class OWLinePlot(OWWidget):
    name = "Line Plot"
    description = "Visualization of data profiles (e.g., time series)."
    icon = "icons/LinePlot.svg"
    priority = 180

    buttons_area_orientation = Qt.Vertical
    enable_selection = Signal(bool)

    class Inputs:
        data = Input("Data", Table, default=True)
        data_subset = Input("Data Subset", Table)

    class Outputs:
        selected_data = Output("Selected Data", Table, default=True)
        annotated_data = Output(ANNOTATED_DATA_SIGNAL_NAME, Table)

    settingsHandler = DomainContextHandler()
    group_var = ContextSetting(None)
    show_profiles = Setting(False)
    show_range = Setting(True)
    show_mean = Setting(True)
    show_error = Setting(False)
    auto_commit = Setting(True)
    selection = Setting(None, schema_only=True)
    visual_settings = Setting({}, schema_only=True)

    graph_name = "graph.plotItem"

    class Error(OWWidget.Error):
        not_enough_attrs = Msg("Need at least one numeric feature.")
        no_valid_data = Msg("No plot due to no valid data.")

    class Warning(OWWidget.Warning):
        no_display_option = Msg("No display option is selected.")

    class Information(OWWidget.Information):
        hidden_instances = Msg("Instances with unknown values are not shown.")
        too_many_features = Msg("Data has too many features. Only first {}"
                                " are shown.".format(MAX_FEATURES))

    def __init__(self, parent=None):
        super().__init__(parent)
        self.__groups = []
        self.data = None
        self.valid_data = None
        self.subset_data = None
        self.subset_indices = None
        self.__pending_selection = self.selection
        self.graph_variables = []
        self.graph = None
        self.group_vars = None
        self.group_view = None
        self.setup_gui()

        VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)
        self.graph.view_box.selection_changed.connect(self.selection_changed)
        self.enable_selection.connect(self.graph.view_box.enable_selection)

    def setup_gui(self):
        self._add_graph()
        self._add_controls()

    def _add_graph(self):
        box = gui.vBox(self.mainArea, True, margin=0)
        self.graph = LinePlotGraph(self)
        box.layout().addWidget(self.graph)

    def _add_controls(self):
        displaybox = gui.widgetBox(self.controlArea, "Display")
        gui.checkBox(displaybox, self, "show_profiles", "Lines",
                     callback=self.__show_profiles_changed,
                     tooltip="Plot lines")
        gui.checkBox(displaybox, self, "show_range", "Range",
                     callback=self.__show_range_changed,
                     tooltip="Plot range between 10th and 90th percentile")
        gui.checkBox(displaybox, self, "show_mean", "Mean",
                     callback=self.__show_mean_changed,
                     tooltip="Plot mean curve")
        gui.checkBox(displaybox, self, "show_error", "Error bars",
                     callback=self.__show_error_changed,
                     tooltip="Show standard deviation")

        self.group_vars = DomainModel(
            placeholder="None", separators=False, valid_types=DiscreteVariable)
        self.group_view = gui.listView(
            self.controlArea, self, "group_var", box="Group by",
            model=self.group_vars, callback=self.__group_var_changed,
            sizeHint=QSize(30, 100), viewType=ListViewSearch,
            sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Expanding)
        )
        self.group_view.setEnabled(False)

        plot_gui = OWPlotGUI(self)
        plot_gui.box_zoom_select(self.buttonsArea)
        gui.auto_send(self.buttonsArea, self, "auto_commit")

        self.info.set_input_summary(self.info.NoInput)
        self.info.set_output_summary(self.info.NoOutput)

    def __show_profiles_changed(self):
        self.check_display_options()
        self._update_visibility("profiles")

    def __show_range_changed(self):
        self.check_display_options()
        self._update_visibility("range")

    def __show_mean_changed(self):
        self.check_display_options()
        self._update_visibility("mean")

    def __show_error_changed(self):
        self._update_visibility("error")

    def __group_var_changed(self):
        if self.data is None or not self.graph_variables:
            return
        self.plot_groups()
        self._update_profiles_color()
        self._update_sel_profiles_and_range()
        self._update_sel_profiles_color()
        self._update_sub_profiles()

    @Inputs.data
    @check_sql_input
    def set_data(self, data):
        self.closeContext()
        self.data = data
        self._set_input_summary()
        self.clear()
        self.check_data()
        self.check_display_options()

        if self.data is not None:
            self.group_vars.set_domain(self.data.domain)
            self.group_view.setEnabled(len(self.group_vars) > 1)
            self.group_var = self.data.domain.class_var \
                if self.data.domain.has_discrete_class else None

        self.openContext(data)
        self.setup_plot()
        self.unconditional_commit()

    def check_data(self):
        def error(err):
            err()
            self.data = None

        self.clear_messages()
        if self.data is not None:
            self.graph_variables = [var for var in self.data.domain.attributes
                                    if var.is_continuous]
            self.valid_data = ~countnans(self.data.X, axis=1).astype(bool)
            if len(self.graph_variables) < 1:
                error(self.Error.not_enough_attrs)
            elif not np.sum(self.valid_data):
                error(self.Error.no_valid_data)
            else:
                if not np.all(self.valid_data):
                    self.Information.hidden_instances()
                if len(self.graph_variables) > MAX_FEATURES:
                    self.Information.too_many_features()
                    self.graph_variables = self.graph_variables[:MAX_FEATURES]

    def check_display_options(self):
        self.Warning.no_display_option.clear()
        if self.data is not None:
            if not (self.show_profiles or self.show_range or self.show_mean):
                self.Warning.no_display_option()
            enable = (self.show_profiles or self.show_range) and \
                len(self.data[self.valid_data]) < SEL_MAX_INSTANCES
            self.enable_selection.emit(enable)

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

    @Inputs.data_subset
    @check_sql_input
    def set_subset_data(self, subset):
        self.subset_data = subset

    def handleNewSignals(self):
        self.set_subset_ids()
        if self.data is not None:
            self._update_profiles_color()
            self._update_sel_profiles_color()
            self._update_sub_profiles()

    def set_subset_ids(self):
        sub_ids = {e.id for e in self.subset_data} \
            if self.subset_data is not None else {}
        self.subset_indices = None
        if self.data is not None and sub_ids:
            self.subset_indices = [x.id for x in self.data[self.valid_data]
                                   if x.id in sub_ids]

    def setup_plot(self):
        if self.data is None:
            return

        ticks = [a.name for a in self.graph_variables]
        self.graph.getAxis("bottom").set_ticks(ticks)
        self.plot_groups()
        self.apply_selection()
        self.graph.view_box.enableAutoRange()
        self.graph.view_box.updateAutoRange()

    def plot_groups(self):
        self._remove_groups()
        data = self.data[self.valid_data, self.graph_variables]
        if self.group_var is None:
            self._plot_group(data, np.where(self.valid_data)[0])
        else:
            class_col_data, _ = self.data.get_column_view(self.group_var)
            for index in range(len(self.group_var.values)):
                mask = np.logical_and(class_col_data == index, self.valid_data)
                indices = np.flatnonzero(mask)
                if not len(indices):
                    continue
                group_data = self.data[indices, self.graph_variables]
                self._plot_group(group_data, indices, index)
        self.graph.update_legend(self.group_var)
        self.graph.groups = self.__groups
        self.graph.view_box.add_profiles(data.X)

    def _remove_groups(self):
        for group in self.__groups:
            group.remove_items()
        self.graph.view_box.remove_profiles()
        self.graph.groups = []
        self.__groups = []

    def _plot_group(self, data, indices, index=None):
        color = self.__get_group_color(index)
        group = ProfileGroup(data, indices, color, self.graph)
        kwargs = self.__get_visibility_flags()
        group.set_visible_error(**kwargs)
        group.set_visible_mean(**kwargs)
        group.set_visible_range(**kwargs)
        group.set_visible_profiles(**kwargs)
        self.__groups.append(group)

    def __get_group_color(self, index):
        if self.group_var is not None:
            return QColor(*self.group_var.colors[index])
        return QColor(LinePlotStyle.DEFAULT_COLOR)

    def __get_visibility_flags(self):
        return {"show_profiles": self.show_profiles,
                "show_range": self.show_range,
                "show_mean": self.show_mean,
                "show_error": self.show_error}

    def _update_profiles_color(self):
        # color alpha depends on subset and selection; with selection or
        # subset profiles color has more opacity
        if not self.show_profiles:
            return
        for group in self.__groups:
            has_sel = bool(self.subset_indices) or bool(self.selection)
            group.update_profiles_color(has_sel)

    def _update_sel_profiles_and_range(self):
        # mark selected instances and selected range
        if not (self.show_profiles or self.show_range):
            return
        for group in self.__groups:
            inds = [i for i in group.indices if self.__in(i, self.selection)]
            table = self.data[inds, self.graph_variables].X if inds else None
            if self.show_profiles:
                group.update_sel_profiles(table)
            if self.show_range:
                group.update_sel_range(table)

    def _update_sel_profiles_color(self):
        # color depends on subset; when subset is present,
        # selected profiles are black
        if not self.selection or not self.show_profiles:
            return
        for group in self.__groups:
            group.update_sel_profiles_color(bool(self.subset_indices))

    def _update_sub_profiles(self):
        # mark subset instances
        if not (self.show_profiles or self.show_range):
            return
        for group in self.__groups:
            inds = [i for i, _id in zip(group.indices, group.ids)
                    if self.__in(_id, self.subset_indices)]
            table = self.data[inds, self.graph_variables].X if inds else None
            group.update_sub_profiles(table)

    def _update_visibility(self, obj_name):
        if not len(self.__groups):
            return
        self._update_profiles_color()
        self._update_sel_profiles_and_range()
        self._update_sel_profiles_color()
        kwargs = self.__get_visibility_flags()
        for group in self.__groups:
            getattr(group, "set_visible_{}".format(obj_name))(**kwargs)
        self.graph.view_box.updateAutoRange()

    def apply_selection(self):
        if self.data is not None and self.__pending_selection is not None:
            sel = [i for i in self.__pending_selection if i < len(self.data)]
            mask = np.zeros(len(self.data), dtype=bool)
            mask[sel] = True
            mask = mask[self.valid_data]
            self.selection_changed(mask)
            self.__pending_selection = None

    def selection_changed(self, mask):
        if self.data is None:
            return
        # need indices for self.data: mask refers to self.data[self.valid_data]
        indices = np.arange(len(self.data))[self.valid_data][mask]
        self.graph.select(indices)
        old = self.selection
        self.selection = None if self.data and isinstance(self.data, SqlTable)\
            else list(self.graph.selection)
        if not old and self.selection or old and not self.selection:
            self._update_profiles_color()
        self._update_sel_profiles_and_range()
        self._update_sel_profiles_color()
        self.commit()

    def commit(self):
        selected = self.data[self.selection] \
            if self.data is not None and bool(self.selection) else None
        annotated = create_annotated_table(self.data, self.selection)

        summary = len(selected) if selected else self.info.NoOutput
        details = format_summary_details(selected) if selected else ""
        self.info.set_output_summary(summary, details)
        self.Outputs.selected_data.send(selected)
        self.Outputs.annotated_data.send(annotated)

    def send_report(self):
        if self.data is None:
            return

        caption = report.render_items_vert((("Group by", self.group_var),))
        self.report_plot()
        if caption:
            self.report_caption(caption)

    def sizeHint(self):
        return QSize(1132, 708)

    def clear(self):
        self.valid_data = None
        self.selection = None
        self.__groups = []
        self.graph_variables = []
        self.graph.reset()
        self.group_vars.set_domain(None)
        self.group_view.setEnabled(False)

    @staticmethod
    def __in(obj, collection):
        return collection is not None and obj in collection

    def set_visual_settings(self, key, value):
        self.graph.parameter_setter.set_parameter(key, value)
        self.visual_settings[key] = value


if __name__ == "__main__":
    brown = Table("brown-selected")
    WidgetPreview(OWLinePlot).run(set_data=brown, set_subset_data=brown[:30])

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