{
    "file_diffs": [
        {
            "old_file_content": "import logging\nimport numbers\nimport os\nimport traceback\n\nfrom xml.sax.saxutils import escape\nfrom concurrent.futures import ThreadPoolExecutor, Future\n\nfrom types import SimpleNamespace\nfrom typing import Optional, Dict, Tuple, List\nfrom collections import namedtuple\n\nfrom AnyQt.QtWidgets import (\n    QLabel, QLineEdit, QTextBrowser, QSplitter, QTreeView,\n    QStyleOptionViewItem, QStyledItemDelegate, QStyle, QApplication,\n    QHBoxLayout, QComboBox\n)\nfrom AnyQt.QtGui import QStandardItemModel, QStandardItem, QBrush, QColor\nfrom AnyQt.QtCore import (\n    Qt, QSize, QObject, QThread, QModelIndex, QSortFilterProxyModel,\n    QItemSelectionModel,\n    pyqtSlot as Slot, pyqtSignal as Signal\n)\n\nfrom serverfiles import LocalFiles, ServerFiles, sizeformat\n\nimport Orange.data\nfrom Orange.misc.environ import data_dir\nfrom Orange.widgets import settings, gui\nfrom Orange.widgets.utils.signals import Output\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import OWWidget, Msg\n\n\nlog = logging.getLogger(__name__)\n\n\ndef ensure_local(index_url, file_path, local_cache_path,\n                 force=False, progress_advance=None):\n    localfiles = LocalFiles(local_cache_path,\n                            serverfiles=ServerFiles(server=index_url))\n    if force:\n        localfiles.download(*file_path, callback=progress_advance)\n    return localfiles.localpath_download(*file_path, callback=progress_advance)\n\n\ndef list_remote(server: str) -> Dict[Tuple[str, ...], dict]:\n    client = ServerFiles(server)\n    return client.allinfo()\n\n\ndef list_local(path: str) -> Dict[Tuple[str, ...], dict]:\n    return LocalFiles(path).allinfo()\n\n\ndef format_exception(error):\n    # type: (BaseException) -> str\n    return \"\\n\".join(traceback.format_exception_only(type(error), error))\n\n\nclass UniformHeightDelegate(QStyledItemDelegate):\n    \"\"\"\n    Item delegate that always includes the icon size in the size hint.\n    \"\"\"\n    def sizeHint(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> QSize\n        opt = QStyleOptionViewItem(option)\n        self.initStyleOption(option, index)\n        opt.features |= QStyleOptionViewItem.HasDecoration\n        widget = option.widget\n        style = widget.style() if widget is not None else QApplication.style()\n        sh = style.sizeFromContents(\n            QStyle.CT_ItemViewItem, opt, QSize(), widget)\n        return sh\n\n\nclass SizeDelegate(UniformHeightDelegate):\n    def initStyleOption(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> None\n        super().initStyleOption(option, index)\n        value = index.data(Qt.DisplayRole)\n        if isinstance(value, numbers.Integral):\n            option.text = sizeformat(int(value))\n            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter\n\n\nclass NumericalDelegate(UniformHeightDelegate):\n    def initStyleOption(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> None\n        super().initStyleOption(option, index)\n        data = index.data(Qt.DisplayRole)\n        align = index.data(Qt.TextAlignmentRole)\n        if align is None and isinstance(data, numbers.Number):\n            # Right align if the model does not specify otherwise\n            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter\n\n\nclass UniformHeightIndicatorDelegate(\n        UniformHeightDelegate, gui.IndicatorItemDelegate):\n    pass\n\n\nclass Namespace(SimpleNamespace):\n    def __init__(self, **kwargs):\n        self.file_path = None\n        self.prefix = None\n        self.filename = None\n        self.islocal = None\n        self.outdated = None\n\n        # tags from JSON info file\n        self.title = None\n        self.description = None\n        self.instances = None\n        self.variables = None\n        self.target = None\n        self.size = None\n        self.source = None\n        self.year = None\n        self.references = []\n        self.seealso = []\n        self.tags = []\n        self.language = \"English\"\n\n        super(Namespace, self).__init__(**kwargs)\n\n        # if title missing, use filename\n        if not self.title and self.filename:\n            self.title = self.filename\n\n\nclass TreeViewWithReturn(QTreeView):\n    returnPressed = Signal()\n\n    def keyPressEvent(self, e):\n        if e.key() == Qt.Key_Return:\n            self.returnPressed.emit()\n        else:\n            super().keyPressEvent(e)\n\n\nclass SortFilterProxyWithLanguage(QSortFilterProxyModel):\n    def __init__(self):\n        super().__init__()\n        self.__language = None\n\n    def setLanguage(self, language):\n        self.__language = language\n        self.invalidateFilter()\n\n    def language(self):\n        return self.__language\n\n    def filterAcceptsRow(self, row, parent):\n        source = self.sourceModel()\n        return super().filterAcceptsRow(row, parent) and (\n            self.__language is None\n            or source.index(row, 0).data(Qt.UserRole).language == self.__language\n        )\n\n\nclass OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)\n\n\nclass FutureWatcher(QObject):\n    done = Signal(object)\n    _p_done_notify = Signal(object)\n\n    def __init__(self, future, parent=None, **kwargs):\n        super().__init__(parent, **kwargs)\n        self.__future = future\n        self._p_done_notify.connect(self.__on_done, Qt.QueuedConnection)\n        future.add_done_callback(self._p_done_notify.emit)\n\n    @Slot(object)\n    def __on_done(self, f):\n        assert f is self.__future\n        self.done.emit(self.__future)\n\n\nclass progress(QObject):\n    advance = Signal()\n\n\nclass _FetchState:\n    def __init__(self, future, watcher, pb):\n        self.future = future\n        self.watcher = watcher\n        self.pb = pb\n\n\ndef variable_icon(name):\n    if name == \"categorical\":\n        return gui.attributeIconDict[Orange.data.DiscreteVariable(\"x\")]\n    elif name == \"numeric\":  # ??\n        return gui.attributeIconDict[Orange.data.ContinuousVariable(\"x\")]\n    else:\n        return gui.attributeIconDict[-1]\n\n\ndef make_html_list(items):\n    if items is None:\n        return ''\n    style = '\"margin: 5px; text-indent: -40px; margin-left: 40px;\"'\n\n    def format_item(i):\n        return '<p style={}><small>{}</small></p>'.format(style, i)\n\n    return '\\n'.join([format_item(i) for i in items])\n\n\ndef description_html(datainfo):\n    # type: (Namespace) -> str\n    \"\"\"\n    Summarize a data info as a html fragment.\n    \"\"\"\n    html = []\n    year = \" ({})\".format(str(datainfo.year)) if datainfo.year else \"\"\n    source = \", from {}\".format(datainfo.source) if datainfo.source else \"\"\n\n    html.append(\"<b>{}</b>{}{}\".format(escape(datainfo.title), year, source))\n    html.append(\"<p>{}</p>\".format(datainfo.description))\n    seealso = make_html_list(datainfo.seealso)\n    if seealso:\n        html.append(\"<small><b>See Also</b>\\n\" + seealso + \"</small>\")\n    refs = make_html_list(datainfo.references)\n    if refs:\n        html.append(\"<small><b>References</b>\\n\" + refs + \"</small>\")\n    return \"\\n\".join(html)\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWDataSets).run()\n",
            "new_file_content": "import logging\nimport numbers\nimport os\nimport traceback\n\nfrom xml.sax.saxutils import escape\nfrom concurrent.futures import ThreadPoolExecutor, Future\n\nfrom types import SimpleNamespace\nfrom typing import Optional, Dict, Tuple, List\nfrom collections import namedtuple\n\nfrom AnyQt.QtWidgets import (\n    QLabel, QLineEdit, QTextBrowser, QSplitter, QTreeView,\n    QStyleOptionViewItem, QStyledItemDelegate, QStyle, QApplication,\n    QHBoxLayout, QComboBox\n)\nfrom AnyQt.QtGui import QStandardItemModel, QStandardItem, QBrush, QColor\nfrom AnyQt.QtCore import (\n    Qt, QSize, QObject, QThread, QModelIndex, QSortFilterProxyModel,\n    QItemSelectionModel,\n    pyqtSlot as Slot, pyqtSignal as Signal\n)\n\nfrom serverfiles import LocalFiles, ServerFiles, sizeformat\n\nimport Orange.data\nfrom Orange.misc.environ import data_dir\nfrom Orange.widgets import  gui\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils.signals import Output\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import OWWidget, Msg\n\n\nlog = logging.getLogger(__name__)\n\n\ndef ensure_local(index_url, file_path, local_cache_path,\n                 force=False, progress_advance=None):\n    localfiles = LocalFiles(local_cache_path,\n                            serverfiles=ServerFiles(server=index_url))\n    if force:\n        localfiles.download(*file_path, callback=progress_advance)\n    return localfiles.localpath_download(*file_path, callback=progress_advance)\n\n\ndef list_remote(server: str) -> Dict[Tuple[str, ...], dict]:\n    client = ServerFiles(server)\n    return client.allinfo()\n\n\ndef list_local(path: str) -> Dict[Tuple[str, ...], dict]:\n    return LocalFiles(path).allinfo()\n\n\ndef format_exception(error):\n    # type: (BaseException) -> str\n    return \"\\n\".join(traceback.format_exception_only(type(error), error))\n\n\nclass UniformHeightDelegate(QStyledItemDelegate):\n    \"\"\"\n    Item delegate that always includes the icon size in the size hint.\n    \"\"\"\n    def sizeHint(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> QSize\n        opt = QStyleOptionViewItem(option)\n        self.initStyleOption(option, index)\n        opt.features |= QStyleOptionViewItem.HasDecoration\n        widget = option.widget\n        style = widget.style() if widget is not None else QApplication.style()\n        sh = style.sizeFromContents(\n            QStyle.CT_ItemViewItem, opt, QSize(), widget)\n        return sh\n\n\nclass SizeDelegate(UniformHeightDelegate):\n    def initStyleOption(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> None\n        super().initStyleOption(option, index)\n        value = index.data(Qt.DisplayRole)\n        if isinstance(value, numbers.Integral):\n            option.text = sizeformat(int(value))\n            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter\n\n\nclass NumericalDelegate(UniformHeightDelegate):\n    def initStyleOption(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> None\n        super().initStyleOption(option, index)\n        data = index.data(Qt.DisplayRole)\n        align = index.data(Qt.TextAlignmentRole)\n        if align is None and isinstance(data, numbers.Number):\n            # Right align if the model does not specify otherwise\n            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter\n\n\nclass UniformHeightIndicatorDelegate(\n        UniformHeightDelegate, gui.IndicatorItemDelegate):\n    pass\n\n\nclass Namespace(SimpleNamespace):\n    def __init__(self, **kwargs):\n        self.file_path = None\n        self.prefix = None\n        self.filename = None\n        self.islocal = None\n        self.outdated = None\n\n        # tags from JSON info file\n        self.title = None\n        self.description = None\n        self.instances = None\n        self.variables = None\n        self.target = None\n        self.size = None\n        self.source = None\n        self.year = None\n        self.references = []\n        self.seealso = []\n        self.tags = []\n        self.language = \"English\"\n\n        super(Namespace, self).__init__(**kwargs)\n\n        # if title missing, use filename\n        if not self.title and self.filename:\n            self.title = self.filename\n\n\nclass TreeViewWithReturn(QTreeView):\n    returnPressed = Signal()\n\n    def keyPressEvent(self, e):\n        if e.key() == Qt.Key_Return:\n            self.returnPressed.emit()\n        else:\n            super().keyPressEvent(e)\n\n\nclass SortFilterProxyWithLanguage(QSortFilterProxyModel):\n    def __init__(self):\n        super().__init__()\n        self.__language = None\n\n    def setLanguage(self, language):\n        self.__language = language\n        self.invalidateFilter()\n\n    def language(self):\n        return self.__language\n\n    def filterAcceptsRow(self, row, parent):\n        source = self.sourceModel()\n        return super().filterAcceptsRow(row, parent) and (\n            self.__language is None\n            or source.index(row, 0).data(Qt.UserRole).language == self.__language\n        )\n\n\nclass OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = Setting(None)   # type: Optional[str]\n    language = Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = Setting(b'')  # type: bytes\n    header_state = Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            # for settings do not use os.path.join (Windows separator is different)\n            if \"/\".join(file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            # for settings do not use os.path.join (Windows separator is different)\n            self.selected_id = \"/\".join(di.file_path)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)\n\n    @classmethod\n    def migrate_settings(cls, settings, _):\n        # until including 3.36.0 selected dataset was saved with \\ on Windows\n        if \"selected_id\" in settings and isinstance(settings[\"selected_id\"], str):\n            settings[\"selected_id\"] = settings[\"selected_id\"].replace(\"\\\\\", \"/\")\n\n\nclass FutureWatcher(QObject):\n    done = Signal(object)\n    _p_done_notify = Signal(object)\n\n    def __init__(self, future, parent=None, **kwargs):\n        super().__init__(parent, **kwargs)\n        self.__future = future\n        self._p_done_notify.connect(self.__on_done, Qt.QueuedConnection)\n        future.add_done_callback(self._p_done_notify.emit)\n\n    @Slot(object)\n    def __on_done(self, f):\n        assert f is self.__future\n        self.done.emit(self.__future)\n\n\nclass progress(QObject):\n    advance = Signal()\n\n\nclass _FetchState:\n    def __init__(self, future, watcher, pb):\n        self.future = future\n        self.watcher = watcher\n        self.pb = pb\n\n\ndef variable_icon(name):\n    if name == \"categorical\":\n        return gui.attributeIconDict[Orange.data.DiscreteVariable(\"x\")]\n    elif name == \"numeric\":  # ??\n        return gui.attributeIconDict[Orange.data.ContinuousVariable(\"x\")]\n    else:\n        return gui.attributeIconDict[-1]\n\n\ndef make_html_list(items):\n    if items is None:\n        return ''\n    style = '\"margin: 5px; text-indent: -40px; margin-left: 40px;\"'\n\n    def format_item(i):\n        return '<p style={}><small>{}</small></p>'.format(style, i)\n\n    return '\\n'.join([format_item(i) for i in items])\n\n\ndef description_html(datainfo):\n    # type: (Namespace) -> str\n    \"\"\"\n    Summarize a data info as a html fragment.\n    \"\"\"\n    html = []\n    year = \" ({})\".format(str(datainfo.year)) if datainfo.year else \"\"\n    source = \", from {}\".format(datainfo.source) if datainfo.source else \"\"\n\n    html.append(\"<b>{}</b>{}{}\".format(escape(datainfo.title), year, source))\n    html.append(\"<p>{}</p>\".format(datainfo.description))\n    seealso = make_html_list(datainfo.seealso)\n    if seealso:\n        html.append(\"<small><b>See Also</b>\\n\" + seealso + \"</small>\")\n    refs = make_html_list(datainfo.references)\n    if refs:\n        html.append(\"<small><b>References</b>\\n\" + refs + \"</small>\")\n    return \"\\n\".join(html)\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWDataSets).run()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/owdatasets.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "d46a37b12",
                "new_commit_hash": "7c4d15f59",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/owdatasets.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/owdatasets.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 26,
                            "length": 7
                        },
                        "new_range": {
                            "start": 26,
                            "length": 8
                        },
                        "section": "from serverfiles import LocalFiles, ServerFiles, sizeformat"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import Orange.data",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.misc.environ import data_dir",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets import settings, gui",
                                "type": "deleted"
                            },
                            {
                                "content": "from Orange.widgets import  gui",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.widgets.settings import Setting",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.widgets.utils.signals import Output",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.widgetpreview import WidgetPreview",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.widget import OWWidget, Msg",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets import  gui",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 29,
                            "end_lineno": 29,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.settings import Setting",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 30,
                            "end_lineno": 30,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets import settings, gui",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 29,
                            "end_lineno": 29,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 203,
                            "length": 12
                        },
                        "new_range": {
                            "start": 204,
                            "length": 12
                        },
                        "section": "class OWDataSets(OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        data = Output(\"Data\", Orange.data.Table)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    #: Selected dataset id",
                                "type": "context"
                            },
                            {
                                "content": "    selected_id = settings.Setting(None)   # type: Optional[str]",
                                "type": "deleted"
                            },
                            {
                                "content": "    language = settings.Setting(DEFAULT_LANG)",
                                "type": "deleted"
                            },
                            {
                                "content": "    selected_id = Setting(None)   # type: Optional[str]",
                                "type": "added"
                            },
                            {
                                "content": "    language = Setting(DEFAULT_LANG)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    #: main area splitter state",
                                "type": "context"
                            },
                            {
                                "content": "    splitter_state = settings.Setting(b'')  # type: bytes",
                                "type": "deleted"
                            },
                            {
                                "content": "    header_state = settings.Setting(b'')    # type: bytes",
                                "type": "deleted"
                            },
                            {
                                "content": "    splitter_state = Setting(b'')  # type: bytes",
                                "type": "added"
                            },
                            {
                                "content": "    header_state = Setting(b'')    # type: bytes",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def __init__(self):",
                                "type": "context"
                            },
                            {
                                "content": "        super().__init__()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "class",
                            "name": "OWDataSets",
                            "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 162,
                            "end_lineno": 641,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 408,
                            "length": 7
                        },
                        "new_range": {
                            "start": 409,
                            "length": 8
                        },
                        "section": "class OWDataSets(OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            row = [item1, item2, item3, item4, item5, item6, item7]",
                                "type": "context"
                            },
                            {
                                "content": "            model.appendRow(row)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "            if os.path.join(*file_path) == self.selected_id:",
                                "type": "deleted"
                            },
                            {
                                "content": "            # for settings do not use os.path.join (Windows separator is different)",
                                "type": "added"
                            },
                            {
                                "content": "            if \"/\".join(file_path) == self.selected_id:",
                                "type": "added"
                            },
                            {
                                "content": "                current_index = i",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        return model, current_index",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "method",
                            "name": "OWDataSets.update_model",
                            "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 376,
                            "end_lineno": 414,
                            "parent": {
                                "file_name": "Orange/widgets/data/owdatasets.py",
                                "type": "class",
                                "name": "OWDataSets",
                                "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 162,
                                "end_lineno": 641,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "class",
                            "name": "OWDataSets",
                            "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 162,
                            "end_lineno": 641,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 524,
                            "length": 7
                        },
                        "new_range": {
                            "start": 526,
                            "length": 8
                        },
                        "section": "class OWDataSets(OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            di = current.data(Qt.UserRole)",
                                "type": "context"
                            },
                            {
                                "content": "            text = description_html(di)",
                                "type": "context"
                            },
                            {
                                "content": "            self.descriptionlabel.setText(text)",
                                "type": "context"
                            },
                            {
                                "content": "            self.selected_id = os.path.join(di.prefix, di.filename)",
                                "type": "deleted"
                            },
                            {
                                "content": "            # for settings do not use os.path.join (Windows separator is different)",
                                "type": "added"
                            },
                            {
                                "content": "            self.selected_id = \"/\".join(di.file_path)",
                                "type": "added"
                            },
                            {
                                "content": "        else:",
                                "type": "context"
                            },
                            {
                                "content": "            self.descriptionlabel.setText(\"\")",
                                "type": "context"
                            },
                            {
                                "content": "            self.selected_id = None",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "method",
                            "name": "OWDataSets.__on_selection",
                            "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 517,
                            "end_lineno": 530,
                            "parent": {
                                "file_name": "Orange/widgets/data/owdatasets.py",
                                "type": "class",
                                "name": "OWDataSets",
                                "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 162,
                                "end_lineno": 641,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "class",
                            "name": "OWDataSets",
                            "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 162,
                            "end_lineno": 641,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 640,
                            "length": 6
                        },
                        "new_range": {
                            "start": 643,
                            "length": 12
                        },
                        "section": "class OWDataSets(OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    def load_data(path):",
                                "type": "context"
                            },
                            {
                                "content": "        return Orange.data.Table(path)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    @classmethod",
                                "type": "added"
                            },
                            {
                                "content": "    def migrate_settings(cls, settings, _):",
                                "type": "added"
                            },
                            {
                                "content": "        # until including 3.36.0 selected dataset was saved with \\ on Windows",
                                "type": "added"
                            },
                            {
                                "content": "        if \"selected_id\" in settings and isinstance(settings[\"selected_id\"], str):",
                                "type": "added"
                            },
                            {
                                "content": "            settings[\"selected_id\"] = settings[\"selected_id\"].replace(\"\\\\\", \"/\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class FutureWatcher(QObject):",
                                "type": "context"
                            },
                            {
                                "content": "    done = Signal(object)",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "class",
                            "name": "OWDataSets",
                            "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = Setting(None)   # type: Optional[str]\n    language = Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = Setting(b'')  # type: bytes\n    header_state = Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            # for settings do not use os.path.join (Windows separator is different)\n            if \"/\".join(file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            # for settings do not use os.path.join (Windows separator is different)\n            self.selected_id = \"/\".join(di.file_path)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)\n\n    @classmethod\n    def migrate_settings(cls, settings, _):\n        # until including 3.36.0 selected dataset was saved with \\ on Windows\n        if \"selected_id\" in settings and isinstance(settings[\"selected_id\"], str):\n            settings[\"selected_id\"] = settings[\"selected_id\"].replace(\"\\\\\", \"/\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 163,
                            "end_lineno": 650,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdatasets.py",
                            "type": "method",
                            "name": "OWDataSets.migrate_settings",
                            "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = Setting(None)   # type: Optional[str]\n    language = Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = Setting(b'')  # type: bytes\n    header_state = Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            # for settings do not use os.path.join (Windows separator is different)\n            if \"/\".join(file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            # for settings do not use os.path.join (Windows separator is different)\n            self.selected_id = \"/\".join(di.file_path)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)\n\n    @classmethod\n    def migrate_settings(cls, settings, _):\n        # until including 3.36.0 selected dataset was saved with \\ on Windows\n        if \"selected_id\" in settings and isinstance(settings[\"selected_id\"], str):\n            settings[\"selected_id\"] = settings[\"selected_id\"].replace(\"\\\\\", \"/\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 647,
                            "end_lineno": 650,
                            "parent": {
                                "file_name": "Orange/widgets/data/owdatasets.py",
                                "type": "class",
                                "name": "OWDataSets",
                                "content": "class OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = Setting(None)   # type: Optional[str]\n    language = Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = Setting(b'')  # type: bytes\n    header_state = Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            # for settings do not use os.path.join (Windows separator is different)\n            if \"/\".join(file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            # for settings do not use os.path.join (Windows separator is different)\n            self.selected_id = \"/\".join(di.file_path)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)\n\n    @classmethod\n    def migrate_settings(cls, settings, _):\n        # until including 3.36.0 selected dataset was saved with \\ on Windows\n        if \"selected_id\" in settings and isinstance(settings[\"selected_id\"], str):\n            settings[\"selected_id\"] = settings[\"selected_id\"].replace(\"\\\\\", \"/\")",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 163,
                                "end_lineno": 650,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import unittest\nfrom unittest.mock import patch, Mock\n\nimport requests\n\nfrom AnyQt.QtCore import QItemSelectionModel, Qt\n\nfrom Orange.widgets.data.owdatasets import OWDataSets\nfrom Orange.widgets.tests.base import WidgetTest\n\n\nclass TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "import unittest\nfrom unittest.mock import patch, Mock\n\nimport requests\n\nfrom AnyQt.QtCore import QItemSelectionModel, Qt\n\nfrom Orange.widgets.data.owdatasets import OWDataSets\nfrom Orange.widgets.tests.base import WidgetTest\n\n\nclass TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/tests/test_owdatasets.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "90cb78ec3",
                "new_commit_hash": "fb4fab763",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/tests/test_owdatasets.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/tests/test_owdatasets.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 96,
                            "length": 6
                        },
                        "new_range": {
                            "start": 96,
                            "length": 25
                        },
                        "section": "class TestOWDataSets(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        # select the only dataset",
                                "type": "context"
                            },
                            {
                                "content": "        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows",
                                "type": "context"
                            },
                            {
                                "content": "        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(w.selected_id, \"core/iris.tab\")",
                                "type": "added"
                            },
                            {
                                "content": "        w.commit()",
                                "type": "added"
                            },
                            {
                                "content": "        iris = self.get_output(w.Outputs.data, w)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(len(iris), 150)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    @patch(\"Orange.widgets.data.owdatasets.list_remote\",",
                                "type": "added"
                            },
                            {
                                "content": "           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))",
                                "type": "added"
                            },
                            {
                                "content": "    @patch(\"Orange.widgets.data.owdatasets.list_local\",",
                                "type": "added"
                            },
                            {
                                "content": "           Mock(return_value={}))",
                                "type": "added"
                            },
                            {
                                "content": "    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",",
                                "type": "added"
                            },
                            {
                                "content": "           Mock(return_value=\"iris.tab\"))",
                                "type": "added"
                            },
                            {
                                "content": "    @WidgetTest.skipNonEnglish",
                                "type": "added"
                            },
                            {
                                "content": "    def test_download_multidir(self):",
                                "type": "added"
                            },
                            {
                                "content": "        w = self.create_widget(OWDataSets)  # type: OWDataSets",
                                "type": "added"
                            },
                            {
                                "content": "        self.wait_until_stop_blocking(w)",
                                "type": "added"
                            },
                            {
                                "content": "        # select the only dataset",
                                "type": "added"
                            },
                            {
                                "content": "        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows",
                                "type": "added"
                            },
                            {
                                "content": "        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")",
                                "type": "added"
                            },
                            {
                                "content": "        w.commit()",
                                "type": "context"
                            },
                            {
                                "content": "        iris = self.get_output(w.Outputs.data, w)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(len(iris), 150)",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                            "type": "class",
                            "name": "TestOWDataSets",
                            "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 12,
                            "end_lineno": 149,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                            "type": "method",
                            "name": "TestOWDataSets.test_download_iris",
                            "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 93,
                            "end_lineno": 102,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                                "type": "class",
                                "name": "TestOWDataSets",
                                "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 12,
                                "end_lineno": 149,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                            "type": "method",
                            "name": "TestOWDataSets.test_download_multidir",
                            "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 111,
                            "end_lineno": 120,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                                "type": "class",
                                "name": "TestOWDataSets",
                                "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 12,
                                "end_lineno": 149,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 112,
                            "length": 6
                        },
                        "new_range": {
                            "start": 131,
                            "length": 23
                        },
                        "section": "class TestOWDataSets(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.wait_until_stop_blocking(w)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(w.view.model().rowCount(), 2)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_migrate_selected_id(self):",
                                "type": "added"
                            },
                            {
                                "content": "        settings = {}",
                                "type": "added"
                            },
                            {
                                "content": "        OWDataSets.migrate_settings(settings, 0)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertNotIn(\"selected_id\", settings)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        settings = {\"selected_id\": None}",
                                "type": "added"
                            },
                            {
                                "content": "        OWDataSets.migrate_settings(settings, 0)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(settings[\"selected_id\"], None)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        settings = {\"selected_id\": \"dir1\\\\bar\"}",
                                "type": "added"
                            },
                            {
                                "content": "        OWDataSets.migrate_settings(settings, 0)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        settings = {\"selected_id\": \"dir1/bar\"}",
                                "type": "added"
                            },
                            {
                                "content": "        OWDataSets.migrate_settings(settings, 0)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "if __name__ == \"__main__\":",
                                "type": "context"
                            },
                            {
                                "content": "    unittest.main()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                            "type": "class",
                            "name": "TestOWDataSets",
                            "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 12,
                            "end_lineno": 149,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                            "type": "method",
                            "name": "TestOWDataSets.test_migrate_selected_id",
                            "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 134,
                            "end_lineno": 149,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owdatasets.py",
                                "type": "class",
                                "name": "TestOWDataSets",
                                "content": "class TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 12,
                                "end_lineno": 149,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "f5026689551be7f0a43ad5f0d129e5bcfff7999c^",
    "new_commit_hash": "f5026689551be7f0a43ad5f0d129e5bcfff7999c",
    "commit_message": "Merge pull request #6575 from markotoplak/datasets-fix-platform\n\n[FIX] Datasets: save selected dataset platform independently",
    "commit_date": "2023-09-15T22:26:42+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "f5026689551be7f0a43ad5f0d129e5bcfff7999c",
    "test_file_codes": [
        "import unittest\nfrom unittest.mock import patch, Mock\n\nimport requests\n\nfrom AnyQt.QtCore import QItemSelectionModel, Qt\n\nfrom Orange.widgets.data.owdatasets import OWDataSets\nfrom Orange.widgets.tests.base import WidgetTest\n\n\nclass TestOWDataSets(WidgetTest):\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_no_internet_connection(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Error.no_remote_datasets.is_shown())\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_only_local(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertTrue(w.Warning.only_local_datasets.is_shown())\n        self.assertEqual(w.view.model().rowCount(), 1)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    def test_filtering(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        model = w.view.model()\n        model.setLanguage(None)\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(model.rowCount(), 2)\n        w.filterLineEdit.setText(\"foo\")\n        self.assertEqual(model.rowCount(), 1)\n        w.filterLineEdit.setText(\"baz\")\n        self.assertEqual(model.rowCount(), 0)\n        w.filterLineEdit.setText(\"\")\n        self.assertEqual(model.rowCount(), 2)\n\n        model.setLanguage(\"Slovenščina\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"bar.tab\")\n\n        model.setLanguage(\"English\")\n        self.assertEqual(model.rowCount(), 1)\n        self.assertEqual(model.index(0, 0).data(Qt.UserRole).title, \"foo.tab\")\n\n        model.setLanguage(None)\n        self.assertEqual(model.rowCount(), 2)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'foo.tab'): {\"language\": \"English\"},\n                              ('core', 'bar.tab'): {\"language\": \"Slovenščina\"}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    def test_remember_language(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        w.language_combo.setCurrentText(\"Slovenščina\")\n        w.language_combo.activated.emit(w.language_combo.currentIndex())\n        settings = w.settingsHandler.pack_data(w)\n\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Slovenščina\")\n\n        settings[\"language\"] = \"Klingon\"\n        w2 = self.create_widget(OWDataSets, stored_settings=settings)\n        self.wait_until_stop_blocking(w2)\n        self.assertEqual(w2.language_combo.currentText(), \"Klingon\")\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('core', 'iris.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_iris(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"core/iris.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={}))\n    @patch(\"Orange.widgets.data.owdatasets.ensure_local\",\n           Mock(return_value=\"iris.tab\"))\n    @WidgetTest.skipNonEnglish\n    def test_download_multidir(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        # select the only dataset\n        sel_type = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows\n        w.view.selectionModel().select(w.view.model().index(0, 0), sel_type)\n        self.assertEqual(w.selected_id, \"dir1/dir2/foo.tab\")\n        w.commit()\n        iris = self.get_output(w.Outputs.data, w)\n        self.assertEqual(len(iris), 150)\n\n    @patch(\"Orange.widgets.data.owdatasets.list_remote\",\n           Mock(side_effect=requests.exceptions.ConnectionError))\n    @patch(\"Orange.widgets.data.owdatasets.list_local\",\n           Mock(return_value={('dir1', 'dir2', 'foo.tab'): {},\n                              ('bar.tab',): {}}))\n    @patch(\"Orange.widgets.data.owdatasets.log\", Mock())\n    @WidgetTest.skipNonEnglish\n    def test_dir_depth(self):\n        w = self.create_widget(OWDataSets)  # type: OWDataSets\n        self.wait_until_stop_blocking(w)\n        self.assertEqual(w.view.model().rowCount(), 2)\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n\n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n\n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n        settings = {\"selected_id\": \"dir1/bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+f502668 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c\nProcessing dependencies for Orange3==3.37.0.dev0+f502668\nSearching for xlsxwriter\nReading https://pypi.org/simple/xlsxwriter/\nDownloading https://files.pythonhosted.org/packages/a7/ea/53d1fe468e63e092cf16e2c18d16f50c29851242f9dd12d6a66e0d7f0d02/XlsxWriter-3.2.0-py3-none-any.whl#sha256=ecfd5405b3e0e228219bcaf24c2ca0915e012ca9464a14048021d21a995d490e\nBest match: XlsxWriter 3.2.0\nProcessing XlsxWriter-3.2.0-py3-none-any.whl\nInstalling XlsxWriter-3.2.0-py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages\nAdding XlsxWriter 3.2.0 to easy-install.pth file\nInstalling vba_extract.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/XlsxWriter-3.2.0-py3.7.egg\nSearching for xlrd>=1.2.0\nReading https://pypi.org/simple/xlrd/\nDownloading https://files.pythonhosted.org/packages/a6/0c/c2a72d51fe56e08a08acc85d13013558a2d793028ae7385448a6ccdfae64/xlrd-2.0.1-py2.py3-none-any.whl#sha256=6a33ee89877bd9abc1158129f6e94be74e2679636b8a205b43b85206c3f0bbdd\nBest match: xlrd 2.0.1\nProcessing xlrd-2.0.1-py2.py3-none-any.whl\nInstalling xlrd-2.0.1-py2.py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages\nAdding xlrd 2.0.1 to easy-install.pth file\nInstalling runxlrd.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/xlrd-2.0.1-py3.7.egg\nSearching for xgboost>=1.7.4\nReading https://pypi.org/simple/xgboost/\nDownloading https://files.pythonhosted.org/packages/48/bc/05d7db90d421c5e3d681a12fd1eb087e37bf2e9bbe2b105422d6319ecc92/xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl#sha256=32a43526208fe676527c698cb852e0e9515e6d7294143780e476d335290a131b\nBest match: xgboost 2.1.3\nProcessing xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl\nInstalling xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages\nAdding xgboost 2.1.3 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/xgboost-2.1.3-py3.7-linux-x86_64.egg\nSearching for serverfiles\nReading https://pypi.org/simple/serverfiles/\nDownloading https://files.pythonhosted.org/packages/33/36/794fe1c4ed29b0f56a26d72e956baf0285d8fe9e29faf36797a28a8ad45b/serverfiles-0.3.1.tar.gz#sha256=5e10fc32e758791e3735bc08bce2ed4702a83b1e45ab96c5d59cc8aeecfbebe1\nBest match: serverfiles 0.3.1\nProcessing serverfiles-0.3.1.tar.gz\nWriting /tmp/easy_install-unaci027/serverfiles-0.3.1/setup.cfg\nRunning serverfiles-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-unaci027/serverfiles-0.3.1/egg-dist-tmp-7ddpfcej\ncreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nExtracting serverfiles-0.3.1-py3.7.egg to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nSearching for scipy>=1.9\nReading https://pypi.org/simple/scipy/\nDownloading https://files.pythonhosted.org/packages/d9/7b/2b8ac283cf32465ed08bc20a83d559fe7b174a484781702ba8accea001d6/scipy-1.15.0.tar.gz#sha256=300742e2cc94e36a2880ebe464a1c8b4352a7b0f3e36ec3d2ac006cdbe0219ac\nBest match: scipy 1.15.0\nProcessing scipy-1.15.0.tar.gz\nVerifying Orange installation...\n❌ Orange verification failed\nPython 3.7 installation failed, trying Python 3.8...\nAttempting installation with Python 3.8...\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_contingency.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/data\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_io.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_io.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_variable.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/distance/_distance.c -o build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/projection/_som.c -o build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+f502668 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c\nProcessing dependencies for Orange3==3.37.0.dev0+f502668\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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for xgboost==2.1.3\nBest match: xgboost 2.1.3\nAdding xgboost 2.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for setuptools==75.3.0\nBest match: setuptools 75.3.0\nAdding setuptools 75.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for scipy==1.10.1\nBest match: scipy 1.10.1\nAdding scipy 1.10.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for scikit-learn==1.1.3\nBest match: scikit-learn 1.1.3\nAdding scikit-learn 1.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for requests==2.32.3\nBest match: requests 2.32.3\nAdding requests 2.32.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for qtconsole==5.6.1\nBest match: qtconsole 5.6.1\nAdding qtconsole 5.6.1 to easy-install.pth file\nInstalling jupyter-qtconsole script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for PyYAML==6.0.2\nBest match: PyYAML 6.0.2\nAdding PyYAML 6.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pyqtgraph==0.13.3\nBest match: pyqtgraph 0.13.3\nAdding pyqtgraph 0.13.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pygments==2.19.1\nBest match: pygments 2.19.1\nAdding pygments 2.19.1 to easy-install.pth file\nInstalling pygmentize script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pip==24.3.1\nBest match: pip 24.3.1\nAdding pip 24.3.1 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pandas==2.0.3\nBest match: pandas 2.0.3\nAdding pandas 2.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for openpyxl==3.1.5\nBest match: openpyxl 3.1.5\nAdding openpyxl 3.1.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for numpy==1.24.4\nBest match: numpy 1.24.4\nAdding numpy 1.24.4 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling f2py3.8 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for networkx==3.1\nBest match: networkx 3.1\nAdding networkx 3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for matplotlib==3.7.5\nBest match: matplotlib 3.7.5\nAdding matplotlib 3.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for keyrings.alt==5.0.2\nBest match: keyrings.alt 5.0.2\nAdding keyrings.alt 5.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for keyring==25.5.0\nBest match: keyring 25.5.0\nAdding keyring 25.5.0 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for joblib==1.4.2\nBest match: joblib 1.4.2\nAdding joblib 1.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for httpx==0.28.1\nBest match: httpx 0.28.1\nAdding httpx 0.28.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for catboost==1.2.7\nBest match: catboost 1.2.7\nAdding catboost 1.2.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for nvidia-nccl-cu12==2.24.3\nBest match: nvidia-nccl-cu12 2.24.3\nAdding nvidia-nccl-cu12 2.24.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for threadpoolctl==3.5.0\nBest match: threadpoolctl 3.5.0\nAdding threadpoolctl 3.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for urllib3==2.2.3\nBest match: urllib3 2.2.3\nAdding urllib3 2.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for packaging==24.2\nBest match: packaging 24.2\nAdding packaging 24.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for QtPy==2.4.2\nBest match: QtPy 2.4.2\nAdding QtPy 2.4.2 to easy-install.pth file\nInstalling qtpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for ipykernel==6.29.5\nBest match: ipykernel 6.29.5\nAdding ipykernel 6.29.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for jupyter-client==8.6.3\nBest match: jupyter-client 8.6.3\nAdding jupyter-client 8.6.3 to easy-install.pth file\nInstalling jupyter-kernel script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for jupyter-core==5.7.2\nBest match: jupyter-core 5.7.2\nAdding jupyter-core 5.7.2 to easy-install.pth file\nInstalling jupyter script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for traitlets==5.14.3\nBest match: traitlets 5.14.3\nAdding traitlets 5.14.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for tzdata==2024.2\nBest match: tzdata 2024.2\nAdding tzdata 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for typing-extensions==4.12.2\nBest match: typing-extensions 4.12.2\nAdding typing-extensions 4.12.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for qasync==0.27.1\nBest match: qasync 0.27.1\nAdding qasync 0.27.1 to easy-install.pth file\ndetected new path './setuptools/_vendor'\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for requests-cache==1.2.1\nBest match: requests-cache 1.2.1\nAdding requests-cache 1.2.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for et-xmlfile==2.0.0\nBest match: et-xmlfile 2.0.0\nAdding et-xmlfile 2.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for importlib-resources==6.4.5\nBest match: importlib-resources 6.4.5\nAdding importlib-resources 6.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pillow==10.4.0\nBest match: pillow 10.4.0\nAdding pillow 10.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for kiwisolver==1.4.7\nBest match: kiwisolver 1.4.7\nAdding kiwisolver 1.4.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for fonttools==4.55.3\nBest match: fonttools 4.55.3\nAdding fonttools 4.55.3 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for cycler==0.12.1\nBest match: cycler 0.12.1\nAdding cycler 0.12.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for contourpy==1.1.1\nBest match: contourpy 1.1.1\nAdding contourpy 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for jaraco.context==6.0.1\nBest match: jaraco.context 6.0.1\nAdding jaraco.context 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for jaraco.classes==3.4.0\nBest match: jaraco.classes 3.4.0\nAdding jaraco.classes 3.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for importlib-metadata==8.5.0\nBest match: importlib-metadata 8.5.0\nAdding importlib-metadata 8.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for jaraco.functools==4.1.0\nBest match: jaraco.functools 4.1.0\nAdding jaraco.functools 4.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for httpcore==1.0.7\nBest match: httpcore 1.0.7\nAdding httpcore 1.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for anyio==4.5.2\nBest match: anyio 4.5.2\nAdding anyio 4.5.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for plotly==5.24.1\nBest match: plotly 5.24.1\nAdding plotly 5.24.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for graphviz==0.20.3\nBest match: graphviz 0.20.3\nAdding graphviz 0.20.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for tornado==6.4.2\nBest match: tornado 6.4.2\nAdding tornado 6.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pyzmq==26.2.0\nBest match: pyzmq 26.2.0\nAdding pyzmq 26.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for psutil==6.1.1\nBest match: psutil 6.1.1\nAdding psutil 6.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for nest-asyncio==1.6.0\nBest match: nest-asyncio 1.6.0\nAdding nest-asyncio 1.6.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for matplotlib-inline==0.1.7\nBest match: matplotlib-inline 0.1.7\nAdding matplotlib-inline 0.1.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for ipython==8.12.3\nBest match: ipython 8.12.3\nAdding ipython 8.12.3 to easy-install.pth file\nInstalling ipython script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for debugpy==1.8.11\nBest match: debugpy 1.8.11\nAdding debugpy 1.8.11 to easy-install.pth file\nInstalling debugpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for comm==0.2.2\nBest match: comm 0.2.2\nAdding comm 0.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for platformdirs==4.3.6\nBest match: platformdirs 4.3.6\nAdding platformdirs 4.3.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for cattrs==24.1.2\nBest match: cattrs 24.1.2\nAdding cattrs 24.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for attrs==24.3.0\nBest match: attrs 24.3.0\nAdding attrs 24.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for zipp==3.20.2\nBest match: zipp 3.20.2\nAdding zipp 3.20.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for backports.tarfile==1.2.0\nBest match: backports.tarfile 1.2.0\nbackports.tarfile 1.2.0 is already the active version in easy-install.pth\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for more-itertools==10.5.0\nBest match: more-itertools 10.5.0\nAdding more-itertools 10.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for tenacity==9.0.0\nBest match: tenacity 9.0.0\nAdding tenacity 9.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pexpect==4.9.0\nBest match: pexpect 4.9.0\nAdding pexpect 4.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for stack-data==0.6.3\nBest match: stack-data 0.6.3\nAdding stack-data 0.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for prompt-toolkit==3.0.48\nBest match: prompt-toolkit 3.0.48\nAdding prompt-toolkit 3.0.48 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pickleshare==0.7.5\nBest match: pickleshare 0.7.5\nAdding pickleshare 0.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for jedi==0.19.2\nBest match: jedi 0.19.2\nAdding jedi 0.19.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for decorator==5.1.1\nBest match: decorator 5.1.1\nAdding decorator 5.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for backcall==0.2.0\nBest match: backcall 0.2.0\nAdding backcall 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for cffi==1.17.1\nBest match: cffi 1.17.1\nAdding cffi 1.17.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for ptyprocess==0.7.0\nBest match: ptyprocess 0.7.0\nAdding ptyprocess 0.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pure-eval==0.2.3\nBest match: pure-eval 0.2.3\nAdding pure-eval 0.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for asttokens==3.0.0\nBest match: asttokens 3.0.0\nAdding asttokens 3.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for executing==2.1.0\nBest match: executing 2.1.0\nAdding executing 2.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for wcwidth==0.2.13\nBest match: wcwidth 0.2.13\nAdding wcwidth 0.2.13 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for parso==0.8.4\nBest match: parso 0.8.4\nAdding parso 0.8.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nSearching for pycparser==2.22\nBest match: pycparser 2.22\nAdding pycparser 2.22 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages\nFinished processing dependencies for Orange3==3.37.0.dev0+f502668\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.8\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 196ms\nPrepared 18 packages in 2ms\nInstalled 18 packages in 103ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and all of:\n          scipy>=1.9.0,<=1.9.1\n          scipy>=1.10.0,<=1.10.1\n      depend on Python>=3.8,<3.12, we can conclude that all of:\n          scipy>=1.9.0,<=1.9.1\n          scipy>=1.10.0,<=1.10.1\n       cannot be used.\n      And because only the following versions of scipy are available:\n          scipy<=1.9.0\n          scipy==1.9.1\n          scipy==1.9.2\n          scipy==1.9.3\n          scipy==1.10.0\n          scipy==1.10.1\n          scipy==1.11.0\n          scipy==1.11.1\n          scipy==1.11.2\n          scipy==1.11.3\n          scipy==1.11.4\n          scipy==1.12.0\n          scipy==1.13.0\n          scipy==1.13.1\n          scipy==1.14.0\n          scipy==1.14.1\n          scipy==1.15.0\n      we can conclude that all of:\n          scipy>=1.9.0,<1.9.2\n          scipy>1.9.3,<1.11.0\n       cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.9.2,<=1.9.3 depends on Python>=3.8,\n      we can conclude that scipy>=1.9.2,<=1.9.3 cannot be used.\n      And because we know from (1) that all of:\n          scipy>=1.9.0,<1.9.2\n          scipy>1.9.3,<1.11.0\n       cannot be used, we can conclude that scipy>=1.9.0,<1.11.0 cannot be used.\n      And because scipy==1.11.0 was yanked (reason: License Violation), we can conclude that scipy>=1.9.0,<1.11.1 cannot be\n      used. (2)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.11.1,<=1.11.3 depends on\n      Python>=3.9,<3.13, we can conclude that scipy>=1.11.1,<=1.11.3 cannot be used.\n      And because we know from (2) that scipy>=1.9.0,<1.11.1 cannot be used, we can conclude that scipy>=1.9.0,<1.11.4 cannot\n      be used. (3)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.11.4,<=1.13.1 depends on\n      Python>=3.9, we can conclude that scipy>=1.11.4,<=1.13.1 cannot be used.\n      And because we know from (3) that scipy>=1.9.0,<1.11.4 cannot be used, we can conclude that scipy>=1.9.0,<1.14.0 cannot\n      be used. (4)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.14.0 depends on Python>=3.10, we can\n      conclude that scipy>=1.14.0 cannot be used.\n      And because we know from (4) that scipy>=1.9.0,<1.14.0 cannot be used, we can conclude that scipy>=1.9.0 cannot be used.\n      And because you require scipy>=1.9, we can conclude that your requirements are unsatisfiable.\n\n      hint: Pre-releases are available for `scipy` in the requested range (e.g., 1.15.0rc2), but pre-releases weren't enabled\n      (try: `--prerelease=allow`)\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and pyqtgraph>=0.13.1,<=0.13.3 depends on\n      Python>=3.8, we can conclude that pyqtgraph>=0.13.1,<=0.13.3 cannot be used.\n      And because only the following versions of pyqtgraph are available:\n          pyqtgraph<=0.13.1\n          pyqtgraph==0.13.2\n          pyqtgraph==0.13.3\n          pyqtgraph==0.13.4\n          pyqtgraph==0.13.5\n          pyqtgraph==0.13.6\n          pyqtgraph==0.13.7\n      we can conclude that pyqtgraph>=0.13.1,<0.13.4 cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pyqtgraph>=0.13.4 depends on Python>=3.9, we\n      can conclude that pyqtgraph>=0.13.4 cannot be used.\n      And because we know from (1) that pyqtgraph>=0.13.1,<0.13.4 cannot be used, we can conclude that pyqtgraph>=0.13.1 cannot\n      be used.\n      And because you require pyqtgraph>=0.13.1, we can conclude that your requirements are unsatisfiable.\nResolved 2 packages in 53ms\nInstalled 2 packages in 44ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 5 packages in 30ms\nInstalled 4 packages in 725ms\n + joblib==1.3.2\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + threadpoolctl==3.1.0\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.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_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\nerror: Couldn't find a setup script in /tmp/easy_install-l5q9i0rn/scipy-1.15.0.tar.gz\nUsing CPython 3.8.20\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 15 packages in 111ms\nPrepared 15 packages in 1ms\nInstalled 15 packages in 47ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + iniconfig==2.0.0\n + numpy==1.24.4\n + packaging==24.2\n + pluggy==1.5.0\n + pyqt5==5.15.11\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.15.0\n + pyqtwebengine==5.15.7\n + pyqtwebengine-qt5==5.15.16\n + pytest==8.3.4\n + setuptools==75.3.0\n + tomli==2.2.1\n + wheel==0.45.1\nResolved 65 packages in 129ms\nInstalled 61 packages in 778ms\n + anyio==4.5.2\n + backports-tarfile==1.2.0\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + catboost==1.2.7\n + certifi==2024.12.14\n + cffi==1.17.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + contourpy==1.1.1\n + cryptography==44.0.0\n + cycler==0.12.1\n + et-xmlfile==2.0.0\n + fonttools==4.55.3\n + graphviz==0.20.3\n + h11==0.14.0\n + httpcore==1.0.7\n + httpx==0.28.1\n + idna==3.10\n + importlib-metadata==8.5.0\n + importlib-resources==6.4.5\n + jaraco-classes==3.4.0\n + jaraco-context==6.0.1\n + jaraco-functools==4.1.0\n + jeepney==0.8.0\n + joblib==1.4.2\n + keyring==25.5.0\n + keyrings-alt==5.0.2\n + kiwisolver==1.4.7\n + matplotlib==3.7.5\n + more-itertools==10.5.0\n + networkx==3.1\n + nvidia-nccl-cu12==2.24.3\n + openpyxl==3.1.5\n + opentsne==1.0.1\n + pandas==2.0.3\n + pillow==10.4.0\n + pip==24.3.1\n + plotly==5.24.1\n + pycparser==2.22\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.2\n + requests==2.32.3\n + scikit-learn==1.1.3\n + scipy==1.10.1\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + tenacity==9.0.0\n + threadpoolctl==3.5.0\n + typing-extensions==4.12.2\n + tzdata==2024.2\n + urllib3==2.2.3\n + xgboost==2.1.3\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\n + zipp==3.20.2\nResolved 64 packages in 54ms\nInstalled 41 packages in 133ms\n + anyqt==0.2.0\n + asttokens==3.0.0\n + attrs==24.3.0\n + backcall==0.2.0\n + cattrs==24.1.2\n + comm==0.2.2\n + commonmark==0.9.1\n + debugpy==1.8.11\n + decorator==5.1.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + executing==2.1.0\n + ipykernel==6.29.5\n + ipython==8.12.3\n + jedi==0.19.2\n + jupyter-client==8.6.3\n + jupyter-core==5.7.2\n + matplotlib-inline==0.1.7\n + nest-asyncio==1.6.0\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + parso==0.8.4\n + pexpect==4.9.0\n + pickleshare==0.7.5\n + platformdirs==4.3.6\n + prompt-toolkit==3.0.48\n + psutil==6.1.1\n + ptyprocess==0.7.0\n + pure-eval==0.2.3\n + pygments==2.19.1\n + pyqtgraph==0.13.3\n + pyzmq==26.2.0\n + qasync==0.27.1\n + qtconsole==5.6.1\n + qtpy==2.4.2\n + requests-cache==1.2.1\n + stack-data==0.6.3\n + tornado==6.4.2\n + traitlets==5.14.3\n + url-normalize==1.4.3\n + wcwidth==0.2.13\nResolved 2 packages in 2ms\nInstalled 2 packages in 5ms\n + psycopg2==2.9.10\n + pymssql==2.3.2\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` and ``easy_install``.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://github.com/pypa/setuptools/issues/917 for details.\n        ********************************************************************************\n\n!!\n  easy_install.initialize_options(self)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c/.venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` directly.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.\n        ********************************************************************************\n\n!!\n  self.initialize_options()\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 0,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 14 items\n\nr2e_tests/test_1.py sss....s.ss...                                       [100%]\n\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_dir_depth\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_download_iris\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_download_multidir\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_filtering\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_migrate_selected_id\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_no_internet_connection\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_only_local\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_remember_language\nSKIPPED [2] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\n========================= 8 passed, 6 skipped in 4.09s =========================\nWidgets left: 0    Max widgets: 522 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_f5026689551be7f0a43ad5f0d129e5bcfff7999c\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 14 items\n\nr2e_tests/test_1.py sss....sFss...                                       [100%]\n\n=================================== FAILURES ===================================\n___________________ TestOWDataSets.test_migrate_selected_id ____________________\n\nself = <r2e_tests.test_1.TestOWDataSets testMethod=test_migrate_selected_id>\n\n    def test_migrate_selected_id(self):\n        settings = {}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertNotIn(\"selected_id\", settings)\n    \n        settings = {\"selected_id\": None}\n        OWDataSets.migrate_settings(settings, 0)\n        self.assertEqual(settings[\"selected_id\"], None)\n    \n        settings = {\"selected_id\": \"dir1\\\\bar\"}\n        OWDataSets.migrate_settings(settings, 0)\n>       self.assertEqual(settings[\"selected_id\"], \"dir1/bar\")\nE       AssertionError: 'dir1\\\\bar' != 'dir1/bar'\nE       - dir1\\bar\nE       ?     ^\nE       + dir1/bar\nE       ?     ^\n\nr2e_tests/test_1.py:145: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_dir_depth\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_download_iris\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_download_multidir\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_filtering\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_no_internet_connection\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_only_local\nPASSED r2e_tests/test_1.py::TestOWDataSets::test_remember_language\nSKIPPED [2] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWDataSets::test_migrate_selected_id - Assert...\n==================== 1 failed, 7 passed, 6 skipped in 2.39s ====================\nWidgets left: 0    Max widgets: 522 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/data/owdatasets.py Orange/widgets/data/tests/test_owdatasets.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Incorrect Handling of Dataset Paths on Windows Causes Migration Failures

**Description:**
On Windows platforms, the selected dataset ID is saved using backslashes (`\`) as path separators. This causes issues during settings migration, where the backslashes are not converted to forward slashes (`/`). As a result, the application fails to correctly recognize and load the selected dataset after migration.

**Example Buggy Code:**
```python
# Initial settings with backslashes in the dataset ID
settings = {"selected_id": "dir1\\bar"}
OWDataSets.migrate_settings(settings, 0)
# Expected selected_id after migration: "dir1/bar"
# Actual selected_id: "dir1\\bar"
```

**Expected Behavior:**
The `migrate_settings` method should convert backslashes to forward slashes in the `selected_id` to ensure consistent path formatting across different operating systems. After migration, the `selected_id` should use forward slashes, such as `"dir1/bar"`.

**Actual Behavior:**
The `selected_id` retains backslashes (e.g., `"dir1\\bar"`), leading to mismatches and potential errors when the application attempts to load the selected dataset with the incorrect path format.

[/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/data/owdatasets.py
import logging
import numbers
import os
import traceback

from xml.sax.saxutils import escape
from concurrent.futures import ThreadPoolExecutor, Future

from types import SimpleNamespace
from typing import Optional, Dict, Tuple, List
from collections import namedtuple

from AnyQt.QtWidgets import (
    QLabel, QLineEdit, QTextBrowser, QSplitter, QTreeView,
    QStyleOptionViewItem, QStyledItemDelegate, QStyle, QApplication,
    QHBoxLayout, QComboBox
)
from AnyQt.QtGui import QStandardItemModel, QStandardItem, QBrush, QColor
from AnyQt.QtCore import (
    Qt, QSize, QObject, QThread, QModelIndex, QSortFilterProxyModel,
    QItemSelectionModel,
    pyqtSlot as Slot, pyqtSignal as Signal
)

from serverfiles import LocalFiles, ServerFiles, sizeformat

import Orange.data
from Orange.misc.environ import data_dir
from Orange.widgets import settings, gui
from Orange.widgets.utils.signals import Output
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import OWWidget, Msg


log = logging.getLogger(__name__)


def ensure_local(index_url, file_path, local_cache_path,
                 force=False, progress_advance=None):
    localfiles = LocalFiles(local_cache_path,
                            serverfiles=ServerFiles(server=index_url))
    if force:
        localfiles.download(*file_path, callback=progress_advance)
    return localfiles.localpath_download(*file_path, callback=progress_advance)


def list_remote(server: str) -> Dict[Tuple[str, ...], dict]:
    client = ServerFiles(server)
    return client.allinfo()


def list_local(path: str) -> Dict[Tuple[str, ...], dict]:
    return LocalFiles(path).allinfo()


def format_exception(error):
    # type: (BaseException) -> str
    return "\n".join(traceback.format_exception_only(type(error), error))


class UniformHeightDelegate(QStyledItemDelegate):
    """
    Item delegate that always includes the icon size in the size hint.
    """
    def sizeHint(self, option, index):
        # type: (QStyleOptionViewItem, QModelIndex) -> QSize
        opt = QStyleOptionViewItem(option)
        self.initStyleOption(option, index)
        opt.features |= QStyleOptionViewItem.HasDecoration
        widget = option.widget
        style = widget.style() if widget is not None else QApplication.style()
        sh = style.sizeFromContents(
            QStyle.CT_ItemViewItem, opt, QSize(), widget)
        return sh


class SizeDelegate(UniformHeightDelegate):
    def initStyleOption(self, option, index):
        # type: (QStyleOptionViewItem, QModelIndex) -> None
        super().initStyleOption(option, index)
        value = index.data(Qt.DisplayRole)
        if isinstance(value, numbers.Integral):
            option.text = sizeformat(int(value))
            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter


class NumericalDelegate(UniformHeightDelegate):
    def initStyleOption(self, option, index):
        # type: (QStyleOptionViewItem, QModelIndex) -> None
        super().initStyleOption(option, index)
        data = index.data(Qt.DisplayRole)
        align = index.data(Qt.TextAlignmentRole)
        if align is None and isinstance(data, numbers.Number):
            # Right align if the model does not specify otherwise
            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter


class UniformHeightIndicatorDelegate(
        UniformHeightDelegate, gui.IndicatorItemDelegate):
    pass


class Namespace(SimpleNamespace):
    def __init__(self, **kwargs):
        self.file_path = None
        self.prefix = None
        self.filename = None
        self.islocal = None
        self.outdated = None

        # tags from JSON info file
        self.title = None
        self.description = None
        self.instances = None
        self.variables = None
        self.target = None
        self.size = None
        self.source = None
        self.year = None
        self.references = []
        self.seealso = []
        self.tags = []
        self.language = "English"

        super(Namespace, self).__init__(**kwargs)

        # if title missing, use filename
        if not self.title and self.filename:
            self.title = self.filename


class TreeViewWithReturn(QTreeView):
    returnPressed = Signal()

    def keyPressEvent(self, e):
        if e.key() == Qt.Key_Return:
            self.returnPressed.emit()
        else:
            super().keyPressEvent(e)


class SortFilterProxyWithLanguage(QSortFilterProxyModel):
    def __init__(self):
        super().__init__()
        self.__language = None

    def setLanguage(self, language):
        self.__language = language
        self.invalidateFilter()

    def language(self):
        return self.__language

    def filterAcceptsRow(self, row, parent):
        source = self.sourceModel()
        return super().filterAcceptsRow(row, parent) and (
            self.__language is None
            or source.index(row, 0).data(Qt.UserRole).language == self.__language
        )


class OWDataSets(OWWidget):
    name = "Datasets"
    description = "Load a dataset from an online repository"
    icon = "icons/DataSets.svg"
    priority = 20
    replaces = ["orangecontrib.prototypes.widgets.owdatasets.OWDataSets"]
    keywords = "datasets, online, data, sets"

    want_control_area = False

    # The following constants can be overridden in a subclass
    # to reuse this widget for a different repository
    # Take care when refactoring! (used in e.g. single-cell)
    INDEX_URL = "https://datasets.biolab.si/"
    DATASET_DIR = "datasets"
    DEFAULT_LANG = "English"
    ALL_LANGUAGES = "All Languages"

    # override HEADER_SCHEMA to define new columns
    # if schema is changed override methods: self.assign_delegates and
    # self.create_model
    HEADER_SCHEMA = [
        ['islocal', {'label': ''}],
        ['title', {'label': 'Title'}],
        ['size', {'label': 'Size'}],
        ['instances', {'label': 'Instances'}],
        ['variables', {'label': 'Variables'}],
        ['target', {'label': 'Target'}],
        ['tags', {'label': 'Tags'}]
    ]  # type: List[str, dict]

    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))

    class Error(OWWidget.Error):
        no_remote_datasets = Msg("Could not fetch dataset list")

    class Warning(OWWidget.Warning):
        only_local_datasets = Msg("Could not fetch datasets list, only local "
                                  "cached datasets are shown")

    class Outputs:
        data = Output("Data", Orange.data.Table)

    #: Selected dataset id
    selected_id = settings.Setting(None)   # type: Optional[str]
    language = settings.Setting(DEFAULT_LANG)

    #: main area splitter state
    splitter_state = settings.Setting(b'')  # type: bytes
    header_state = settings.Setting(b'')    # type: bytes

    def __init__(self):
        super().__init__()
        self.allinfo_local = {}
        self.allinfo_remote = {}

        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)
        # current_output does not equal selected_id when, for instance, the
        # data is still downloading
        self.current_output = None

        self._header_labels = [
            header['label'] for _, header in self.HEADER_SCHEMA]
        self._header_index = namedtuple(
            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])
        self.Header = self._header_index(
            *[index for index, _ in enumerate(self._header_labels)])

        self.__awaiting_state = None  # type: Optional[_FetchState]

        layout = QHBoxLayout()
        self.filterLineEdit = QLineEdit(
            textChanged=self.filter, placeholderText="Search for data set ..."
        )
        layout.addWidget(self.filterLineEdit)
        layout.addSpacing(20)
        layout.addWidget(QLabel("Show data sets in "))
        lang_combo = self.language_combo = QComboBox()
        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]
        if self.language is not None and self.language not in languages:
            languages.insert(1, self.language)
        lang_combo.addItems(languages)
        lang_combo.setCurrentText(self.language)
        lang_combo.activated.connect(self._on_language_changed)
        layout.addWidget(lang_combo)
        self.mainArea.layout().addLayout(layout)

        self.splitter = QSplitter(orientation=Qt.Vertical)

        self.view = TreeViewWithReturn(
            sortingEnabled=True,
            selectionMode=QTreeView.SingleSelection,
            alternatingRowColors=True,
            rootIsDecorated=False,
            editTriggers=QTreeView.NoEditTriggers,
            uniformRowHeights=True,
            toolTip="Press Return or double-click to send"
        )
        # the method doesn't exists yet, pylint: disable=unnecessary-lambda
        self.view.doubleClicked.connect(self.commit)
        self.view.returnPressed.connect(self.commit)
        box = gui.widgetBox(self.splitter, "Description", addToLayout=False)
        self.descriptionlabel = QLabel(
            wordWrap=True,
            textFormat=Qt.RichText,
        )
        self.descriptionlabel = QTextBrowser(
            openExternalLinks=True,
            textInteractionFlags=(Qt.TextSelectableByMouse |
                                  Qt.LinksAccessibleByMouse)
        )
        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)
        # no (white) text background
        self.descriptionlabel.viewport().setAutoFillBackground(False)

        box.layout().addWidget(self.descriptionlabel)
        self.splitter.addWidget(self.view)
        self.splitter.addWidget(box)

        self.splitter.setSizes([300, 200])
        self.splitter.splitterMoved.connect(
            lambda:
            setattr(self, "splitter_state", bytes(self.splitter.saveState()))
        )
        self.mainArea.layout().addWidget(self.splitter)

        proxy = SortFilterProxyWithLanguage()
        proxy.setFilterKeyColumn(-1)
        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)
        self.view.setModel(proxy)

        if self.splitter_state:
            self.splitter.restoreState(self.splitter_state)

        self.assign_delegates()

        self.setBlocking(True)
        self.setStatusMessage("Initializing")

        self._executor = ThreadPoolExecutor(max_workers=1)
        f = self._executor.submit(list_remote, self.INDEX_URL)
        w = FutureWatcher(f, parent=self)
        w.done.connect(self.__set_index)

        self._on_language_changed()

    def assign_delegates(self):
        # NOTE: All columns must have size hinting delegates.
        # QTreeView queries only the columns displayed in the viewport so
        # the layout would be different depending in the horizontal scroll
        # position
        self.view.setItemDelegate(UniformHeightDelegate(self))
        self.view.setItemDelegateForColumn(
            self.Header.islocal,
            UniformHeightIndicatorDelegate(self, indicatorSize=4)
        )
        self.view.setItemDelegateForColumn(
            self.Header.size,
            SizeDelegate(self)
        )
        self.view.setItemDelegateForColumn(
            self.Header.instances,
            NumericalDelegate(self)
        )
        self.view.setItemDelegateForColumn(
            self.Header.variables,
            NumericalDelegate(self)
        )
        self.view.resizeColumnToContents(self.Header.islocal)

    def _parse_info(self, file_path):
        if file_path in self.allinfo_remote:
            info = self.allinfo_remote[file_path]
        else:
            info = self.allinfo_local[file_path]

        islocal = file_path in self.allinfo_local
        isremote = file_path in self.allinfo_remote

        outdated = islocal and isremote and (
            self.allinfo_remote[file_path].get('version', '')
            != self.allinfo_local[file_path].get('version', '')
        )
        islocal &= not outdated

        prefix = os.path.join('', *file_path[:-1])
        filename = file_path[-1]

        return Namespace(file_path=file_path, prefix=prefix, filename=filename,
                         islocal=islocal, outdated=outdated, **info)

    def create_model(self):
        self.update_language_combo()
        return self.update_model()

    def update_language_combo(self):
        combo = self.language_combo
        current_language = combo.currentText()
        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)
        languages = {self._parse_info(key).language for key in allkeys}
        if self.language is not None:
            languages.add(self.language)
        languages = sorted(languages)
        combo.clear()
        if self.DEFAULT_LANG not in languages:
            combo.addItem(self.DEFAULT_LANG)
        combo.addItems(languages + [self.ALL_LANGUAGES])
        if current_language in languages:
            combo.setCurrentText(current_language)
        elif self.DEFAULT_LANG in languages:
            combo.setCurrentText(self.DEFAULT_LANG)
        else:
            combo.setCurrentText(self.ALL_LANGUAGES)

    def update_model(self):
        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)
        allkeys = sorted(allkeys)

        model = QStandardItemModel(self)
        model.setHorizontalHeaderLabels(self._header_labels)

        current_index = -1
        localinfo = list_local(self.local_cache_path)
        for i, file_path in enumerate(allkeys):
            datainfo = self._parse_info(file_path)
            item1 = QStandardItem()
            # this elegant and spotless trick is used for sorting
            state = self.indicator_state_for_info(datainfo, localinfo)
            item1.setData({None: "", False: " ", True: "  "}[state], Qt.DisplayRole)
            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)
            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)
            item1.setData(datainfo, Qt.UserRole)
            item2 = QStandardItem(datainfo.title)
            item3 = QStandardItem()
            item3.setData(datainfo.size, Qt.DisplayRole)
            item4 = QStandardItem()
            item4.setData(datainfo.instances, Qt.DisplayRole)
            item5 = QStandardItem()
            item5.setData(datainfo.variables, Qt.DisplayRole)
            item6 = QStandardItem()
            item6.setData(datainfo.target, Qt.DisplayRole)
            if datainfo.target:
                item6.setIcon(variable_icon(datainfo.target))
            item7 = QStandardItem()
            item7.setData(", ".join(datainfo.tags) if datainfo.tags else "",
                          Qt.DisplayRole)
            row = [item1, item2, item3, item4, item5, item6, item7]
            model.appendRow(row)

            if os.path.join(*file_path) == self.selected_id:
                current_index = i

        return model, current_index

    def _on_language_changed(self):
        combo = self.language_combo
        if combo.currentIndex() == combo.count() - 1:
            self.language = None
        else:
            self.language = combo.currentText()
        self.view.model().setLanguage(self.language)

    @Slot(object)
    def __set_index(self, f):
        # type: (Future) -> None
        # set results from `list_remote` query.
        assert QThread.currentThread() is self.thread()
        assert f.done()
        self.setBlocking(False)
        self.setStatusMessage("")
        self.allinfo_local = list_local(self.local_cache_path)

        try:
            self.allinfo_remote = f.result()
        except Exception:  # anytying can happen, pylint: disable=broad-except
            log.exception("Error while fetching updated index")
            if not self.allinfo_local:
                self.Error.no_remote_datasets()
            else:
                self.Warning.only_local_datasets()
            self.allinfo_remote = {}

        model, current_index = self.create_model()
        self.set_model(model, current_index)

    def set_model(self, model, current_index):
        self.view.model().setSourceModel(model)
        self.view.selectionModel().selectionChanged.connect(
            self.__on_selection
        )

        scw = self.view.setColumnWidth
        width = self.view.fontMetrics().horizontalAdvance
        self.view.resizeColumnToContents(0)
        scw(self.Header.title, width("X" * 37))
        scw(self.Header.size, 20 + max(width("888 bytes "), width("9999.9 MB ")))
        scw(self.Header.instances, 20 + width("100000000"))
        scw(self.Header.variables, 20 + width("1000000"))

        header = self.view.header()
        header.restoreState(self.header_state)

        if current_index != -1:
            selmodel = self.view.selectionModel()
            selmodel.select(
                self.view.model().mapFromSource(model.index(current_index, 0)),
                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)
            self.commit()

    def indicator_state_for_info(self, info, localinfo):
        if not info.file_path in localinfo:
            return None
        return (
            os.path.join(self.local_cache_path, *info.file_path)
            == self.current_output)

    def __update_cached_state(self):
        model = self.view.model().sourceModel()
        assert isinstance(model, QStandardItemModel)
        allinfo = []
        localinfo = list_local(self.local_cache_path)
        for i in range(model.rowCount()):
            item = model.item(i, 0)
            info = item.data(Qt.UserRole)
            state = self.indicator_state_for_info(info, localinfo)
            # this elegant and spotless trick is used for sorting
            item.setData({None: "", False: " ", True: "  "}[state], Qt.DisplayRole)
            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)
            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)
            allinfo.append(info)

    def selected_dataset(self):
        """
        Return the current selected dataset info or None if not selected

        Returns
        -------
        info : Optional[Namespace]
        """
        rows = self.view.selectionModel().selectedRows(0)
        assert 0 <= len(rows) <= 1
        current = rows[0] if rows else None  # type: Optional[QModelIndex]
        if current is not None:
            info = current.data(Qt.UserRole)
            assert isinstance(info, Namespace)
        else:
            info = None
        return info

    def filter(self):
        filter_string = self.filterLineEdit.text().strip()
        proxyModel = self.view.model()
        if proxyModel:
            proxyModel.setFilterFixedString(filter_string)

    def __on_selection(self):
        # Main datasets view selection has changed
        rows = self.view.selectionModel().selectedRows(0)
        assert 0 <= len(rows) <= 1
        current = rows[0] if rows else None  # type: Optional[QModelIndex]
        if current is not None:
            current = self.view.model().mapToSource(current)
            di = current.data(Qt.UserRole)
            text = description_html(di)
            self.descriptionlabel.setText(text)
            self.selected_id = os.path.join(di.prefix, di.filename)
        else:
            self.descriptionlabel.setText("")
            self.selected_id = None

    def commit(self):
        """
        Commit a dataset to the output immediately (if available locally) or
        schedule download background and an eventual send.

        During the download the widget is in blocking state
        (OWWidget.isBlocking)
        """
        di = self.selected_dataset()
        if di is not None:
            self.Error.clear()

            if self.__awaiting_state is not None:
                # disconnect from the __commit_complete
                self.__awaiting_state.watcher.done.disconnect(
                    self.__commit_complete)
                # .. and connect to update_cached_state
                # self.__awaiting_state.watcher.done.connect(
                #     self.__update_cached_state)
                # TODO: There are possible pending __progress_advance queued
                self.__awaiting_state.pb.advance.disconnect(
                    self.__progress_advance)
                self.progressBarFinished()
                self.__awaiting_state = None

            if not di.islocal:
                pr = progress()
                callback = lambda pr=pr: pr.advance.emit()
                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)

                self.progressBarInit()
                self.setStatusMessage("Fetching...")
                self.setBlocking(True)

                f = self._executor.submit(
                    ensure_local, self.INDEX_URL, di.file_path,
                    self.local_cache_path, force=di.outdated,
                    progress_advance=callback)
                w = FutureWatcher(f, parent=self)
                w.done.connect(self.__commit_complete)
                self.__awaiting_state = _FetchState(f, w, pr)
            else:
                self.setStatusMessage("")
                self.setBlocking(False)
                self.commit_cached(di.file_path)
        else:
            self.load_and_output(None)

    @Slot(object)
    def __commit_complete(self, f):
        # complete the commit operation after the required file has been
        # downloaded
        assert QThread.currentThread() is self.thread()
        assert self.__awaiting_state is not None
        assert self.__awaiting_state.future is f

        if self.isBlocking():
            self.progressBarFinished()
            self.setBlocking(False)
            self.setStatusMessage("")

        self.__awaiting_state = None

        try:
            path = f.result()
        # anything can happen here, pylint: disable=broad-except
        except Exception as ex:
            log.exception("Error:")
            self.error(format_exception(ex))
            path = None
        self.load_and_output(path)

    def commit_cached(self, file_path):
        path = LocalFiles(self.local_cache_path).localpath(*file_path)
        self.load_and_output(path)

    @Slot()
    def __progress_advance(self):
        assert QThread.currentThread() is self.thread()
        self.progressBarAdvance(1)

    def onDeleteWidget(self):
        super().onDeleteWidget()
        if self.__awaiting_state is not None:
            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)
            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)
            self.__awaiting_state = None

    @staticmethod
    def sizeHint():
        return QSize(1100, 500)

    def closeEvent(self, event):
        self.splitter_state = bytes(self.splitter.saveState())
        self.header_state = bytes(self.view.header().saveState())
        super().closeEvent(event)

    def load_and_output(self, path):
        if path is None:
            self.Outputs.data.send(None)
        else:
            data = self.load_data(path)
            self.Outputs.data.send(data)

        self.current_output = path
        self.__update_cached_state()

    @staticmethod
    def load_data(path):
        return Orange.data.Table(path)


class FutureWatcher(QObject):
    done = Signal(object)
    _p_done_notify = Signal(object)

    def __init__(self, future, parent=None, **kwargs):
        super().__init__(parent, **kwargs)
        self.__future = future
        self._p_done_notify.connect(self.__on_done, Qt.QueuedConnection)
        future.add_done_callback(self._p_done_notify.emit)

    @Slot(object)
    def __on_done(self, f):
        assert f is self.__future
        self.done.emit(self.__future)


class progress(QObject):
    advance = Signal()


class _FetchState:
    def __init__(self, future, watcher, pb):
        self.future = future
        self.watcher = watcher
        self.pb = pb


def variable_icon(name):
    if name == "categorical":
        return gui.attributeIconDict[Orange.data.DiscreteVariable("x")]
    elif name == "numeric":  # ??
        return gui.attributeIconDict[Orange.data.ContinuousVariable("x")]
    else:
        return gui.attributeIconDict[-1]


def make_html_list(items):
    if items is None:
        return ''
    style = '"margin: 5px; text-indent: -40px; margin-left: 40px;"'

    def format_item(i):
        return '<p style={}><small>{}</small></p>'.format(style, i)

    return '\n'.join([format_item(i) for i in items])


def description_html(datainfo):
    # type: (Namespace) -> str
    """
    Summarize a data info as a html fragment.
    """
    html = []
    year = " ({})".format(str(datainfo.year)) if datainfo.year else ""
    source = ", from {}".format(datainfo.source) if datainfo.source else ""

    html.append("<b>{}</b>{}{}".format(escape(datainfo.title), year, source))
    html.append("<p>{}</p>".format(datainfo.description))
    seealso = make_html_list(datainfo.seealso)
    if seealso:
        html.append("<small><b>See Also</b>\n" + seealso + "</small>")
    refs = make_html_list(datainfo.references)
    if refs:
        html.append("<small><b>References</b>\n" + refs + "</small>")
    return "\n".join(html)


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWDataSets).run()

```
--- END FILE ---

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

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

Here is an example:

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

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

**Description:**
On Windows platforms, the selected dataset ID is saved using backslashes (`\`) as path separators. This causes issues during settings migration, where the backslashes are not converted to forward slashes (`/`). As a result, the application fails to correctly recognize and load the selected dataset after migration.

**Example Buggy Code:**
```python
# Initial settings with backslashes in the dataset ID
settings = {"selected_id": "dir1\\bar"}
OWDataSets.migrate_settings(settings, 0)
# Expected selected_id after migration: "dir1/bar"
# Actual selected_id: "dir1\\bar"
```

**Expected Behavior:**
The `migrate_settings` method should convert backslashes to forward slashes in the `selected_id` to ensure consistent path formatting across different operating systems. After migration, the `selected_id` should use forward slashes, such as `"dir1/bar"`.

**Actual Behavior:**
The `selected_id` retains backslashes (e.g., `"dir1\\bar"`), leading to mismatches and potential errors when the application attempts to load the selected dataset with the incorrect path format.

[/ISSUE]
{
    "TestOWDataSets.test_dir_depth": "PASSED",
    "TestOWDataSets.test_download_iris": "PASSED",
    "TestOWDataSets.test_download_multidir": "PASSED",
    "TestOWDataSets.test_filtering": "PASSED",
    "TestOWDataSets.test_migrate_selected_id": "PASSED",
    "TestOWDataSets.test_no_internet_connection": "PASSED",
    "TestOWDataSets.test_only_local": "PASSED",
    "TestOWDataSets.test_remember_language": "PASSED"
}
diff --git a/Orange/widgets/data/owdatasets.py b/Orange/widgets/data/owdatasets.py
index d46a37b12..7c4d15f59 100644
--- a/Orange/widgets/data/owdatasets.py
+++ b/Orange/widgets/data/owdatasets.py
@@ -26,7 +26,8 @@ from serverfiles import LocalFiles, ServerFiles, sizeformat
 
 import Orange.data
 from Orange.misc.environ import data_dir
-from Orange.widgets import settings, gui
+from Orange.widgets import  gui
+from Orange.widgets.settings import Setting
 from Orange.widgets.utils.signals import Output
 from Orange.widgets.utils.widgetpreview import WidgetPreview
 from Orange.widgets.widget import OWWidget, Msg
@@ -203,12 +204,12 @@ class OWDataSets(OWWidget):
         data = Output("Data", Orange.data.Table)
 
     #: Selected dataset id
-    selected_id = settings.Setting(None)   # type: Optional[str]
-    language = settings.Setting(DEFAULT_LANG)
+    selected_id = Setting(None)   # type: Optional[str]
+    language = Setting(DEFAULT_LANG)
 
     #: main area splitter state
-    splitter_state = settings.Setting(b'')  # type: bytes
-    header_state = settings.Setting(b'')    # type: bytes
+    splitter_state = Setting(b'')  # type: bytes
+    header_state = Setting(b'')    # type: bytes
 
     def __init__(self):
         super().__init__()
@@ -408,7 +409,8 @@ class OWDataSets(OWWidget):
             row = [item1, item2, item3, item4, item5, item6, item7]
             model.appendRow(row)
 
-            if os.path.join(*file_path) == self.selected_id:
+            # for settings do not use os.path.join (Windows separator is different)
+            if "/".join(file_path) == self.selected_id:
                 current_index = i
 
         return model, current_index
@@ -524,7 +526,8 @@ class OWDataSets(OWWidget):
             di = current.data(Qt.UserRole)
             text = description_html(di)
             self.descriptionlabel.setText(text)
-            self.selected_id = os.path.join(di.prefix, di.filename)
+            # for settings do not use os.path.join (Windows separator is different)
+            self.selected_id = "/".join(di.file_path)
         else:
             self.descriptionlabel.setText("")
             self.selected_id = None
@@ -640,6 +643,12 @@ class OWDataSets(OWWidget):
     def load_data(path):
         return Orange.data.Table(path)
 
+    @classmethod
+    def migrate_settings(cls, settings, _):
+        # until including 3.36.0 selected dataset was saved with \ on Windows
+        if "selected_id" in settings and isinstance(settings["selected_id"], str):
+            settings["selected_id"] = settings["selected_id"].replace("\\", "/")
+
 
 class FutureWatcher(QObject):
     done = Signal(object)

{"Orange/widgets/data/owdatasets.py": "import logging\nimport numbers\nimport os\nimport traceback\n\nfrom xml.sax.saxutils import escape\nfrom concurrent.futures import ThreadPoolExecutor, Future\n\nfrom types import SimpleNamespace\nfrom typing import Optional, Dict, Tuple, List\nfrom collections import namedtuple\n\nfrom AnyQt.QtWidgets import (\n    QLabel, QLineEdit, QTextBrowser, QSplitter, QTreeView,\n    QStyleOptionViewItem, QStyledItemDelegate, QStyle, QApplication,\n    QHBoxLayout, QComboBox\n)\nfrom AnyQt.QtGui import QStandardItemModel, QStandardItem, QBrush, QColor\nfrom AnyQt.QtCore import (\n    Qt, QSize, QObject, QThread, QModelIndex, QSortFilterProxyModel,\n    QItemSelectionModel,\n    pyqtSlot as Slot, pyqtSignal as Signal\n)\n\nfrom serverfiles import LocalFiles, ServerFiles, sizeformat\n\nimport Orange.data\nfrom Orange.misc.environ import data_dir\nfrom Orange.widgets import settings, gui\nfrom Orange.widgets.utils.signals import Output\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import OWWidget, Msg\n\n\nlog = logging.getLogger(__name__)\n\n\ndef ensure_local(index_url, file_path, local_cache_path,\n                 force=False, progress_advance=None):\n    localfiles = LocalFiles(local_cache_path,\n                            serverfiles=ServerFiles(server=index_url))\n    if force:\n        localfiles.download(*file_path, callback=progress_advance)\n    return localfiles.localpath_download(*file_path, callback=progress_advance)\n\n\ndef list_remote(server: str) -> Dict[Tuple[str, ...], dict]:\n    client = ServerFiles(server)\n    return client.allinfo()\n\n\ndef list_local(path: str) -> Dict[Tuple[str, ...], dict]:\n    return LocalFiles(path).allinfo()\n\n\ndef format_exception(error):\n    # type: (BaseException) -> str\n    return \"\\n\".join(traceback.format_exception_only(type(error), error))\n\n\nclass UniformHeightDelegate(QStyledItemDelegate):\n    \"\"\"\n    Item delegate that always includes the icon size in the size hint.\n    \"\"\"\n    def sizeHint(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> QSize\n        opt = QStyleOptionViewItem(option)\n        self.initStyleOption(option, index)\n        opt.features |= QStyleOptionViewItem.HasDecoration\n        widget = option.widget\n        style = widget.style() if widget is not None else QApplication.style()\n        sh = style.sizeFromContents(\n            QStyle.CT_ItemViewItem, opt, QSize(), widget)\n        return sh\n\n\nclass SizeDelegate(UniformHeightDelegate):\n    def initStyleOption(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> None\n        super().initStyleOption(option, index)\n        value = index.data(Qt.DisplayRole)\n        if isinstance(value, numbers.Integral):\n            option.text = sizeformat(int(value))\n            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter\n\n\nclass NumericalDelegate(UniformHeightDelegate):\n    def initStyleOption(self, option, index):\n        # type: (QStyleOptionViewItem, QModelIndex) -> None\n        super().initStyleOption(option, index)\n        data = index.data(Qt.DisplayRole)\n        align = index.data(Qt.TextAlignmentRole)\n        if align is None and isinstance(data, numbers.Number):\n            # Right align if the model does not specify otherwise\n            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter\n\n\nclass UniformHeightIndicatorDelegate(\n        UniformHeightDelegate, gui.IndicatorItemDelegate):\n    pass\n\n\nclass Namespace(SimpleNamespace):\n    def __init__(self, **kwargs):\n        self.file_path = None\n        self.prefix = None\n        self.filename = None\n        self.islocal = None\n        self.outdated = None\n\n        # tags from JSON info file\n        self.title = None\n        self.description = None\n        self.instances = None\n        self.variables = None\n        self.target = None\n        self.size = None\n        self.source = None\n        self.year = None\n        self.references = []\n        self.seealso = []\n        self.tags = []\n        self.language = \"English\"\n\n        super(Namespace, self).__init__(**kwargs)\n\n        # if title missing, use filename\n        if not self.title and self.filename:\n            self.title = self.filename\n\n\nclass TreeViewWithReturn(QTreeView):\n    returnPressed = Signal()\n\n    def keyPressEvent(self, e):\n        if e.key() == Qt.Key_Return:\n            self.returnPressed.emit()\n        else:\n            super().keyPressEvent(e)\n\n\nclass SortFilterProxyWithLanguage(QSortFilterProxyModel):\n    def __init__(self):\n        super().__init__()\n        self.__language = None\n\n    def setLanguage(self, language):\n        self.__language = language\n        self.invalidateFilter()\n\n    def language(self):\n        return self.__language\n\n    def filterAcceptsRow(self, row, parent):\n        source = self.sourceModel()\n        return super().filterAcceptsRow(row, parent) and (\n            self.__language is None\n            or source.index(row, 0).data(Qt.UserRole).language == self.__language\n        )\n\n\nclass OWDataSets(OWWidget):\n    name = \"Datasets\"\n    description = \"Load a dataset from an online repository\"\n    icon = \"icons/DataSets.svg\"\n    priority = 20\n    replaces = [\"orangecontrib.prototypes.widgets.owdatasets.OWDataSets\"]\n    keywords = \"datasets, online, data, sets\"\n\n    want_control_area = False\n\n    # The following constants can be overridden in a subclass\n    # to reuse this widget for a different repository\n    # Take care when refactoring! (used in e.g. single-cell)\n    INDEX_URL = \"https://datasets.biolab.si/\"\n    DATASET_DIR = \"datasets\"\n    DEFAULT_LANG = \"English\"\n    ALL_LANGUAGES = \"All Languages\"\n\n    # override HEADER_SCHEMA to define new columns\n    # if schema is changed override methods: self.assign_delegates and\n    # self.create_model\n    HEADER_SCHEMA = [\n        ['islocal', {'label': ''}],\n        ['title', {'label': 'Title'}],\n        ['size', {'label': 'Size'}],\n        ['instances', {'label': 'Instances'}],\n        ['variables', {'label': 'Variables'}],\n        ['target', {'label': 'Target'}],\n        ['tags', {'label': 'Tags'}]\n    ]  # type: List[str, dict]\n\n    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))\n\n    class Error(OWWidget.Error):\n        no_remote_datasets = Msg(\"Could not fetch dataset list\")\n\n    class Warning(OWWidget.Warning):\n        only_local_datasets = Msg(\"Could not fetch datasets list, only local \"\n                                  \"cached datasets are shown\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table)\n\n    #: Selected dataset id\n    selected_id = settings.Setting(None)   # type: Optional[str]\n    language = settings.Setting(DEFAULT_LANG)\n\n    #: main area splitter state\n    splitter_state = settings.Setting(b'')  # type: bytes\n    header_state = settings.Setting(b'')    # type: bytes\n\n    def __init__(self):\n        super().__init__()\n        self.allinfo_local = {}\n        self.allinfo_remote = {}\n\n        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)\n        # current_output does not equal selected_id when, for instance, the\n        # data is still downloading\n        self.current_output = None\n\n        self._header_labels = [\n            header['label'] for _, header in self.HEADER_SCHEMA]\n        self._header_index = namedtuple(\n            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])\n        self.Header = self._header_index(\n            *[index for index, _ in enumerate(self._header_labels)])\n\n        self.__awaiting_state = None  # type: Optional[_FetchState]\n\n        layout = QHBoxLayout()\n        self.filterLineEdit = QLineEdit(\n            textChanged=self.filter, placeholderText=\"Search for data set ...\"\n        )\n        layout.addWidget(self.filterLineEdit)\n        layout.addSpacing(20)\n        layout.addWidget(QLabel(\"Show data sets in \"))\n        lang_combo = self.language_combo = QComboBox()\n        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]\n        if self.language is not None and self.language not in languages:\n            languages.insert(1, self.language)\n        lang_combo.addItems(languages)\n        lang_combo.setCurrentText(self.language)\n        lang_combo.activated.connect(self._on_language_changed)\n        layout.addWidget(lang_combo)\n        self.mainArea.layout().addLayout(layout)\n\n        self.splitter = QSplitter(orientation=Qt.Vertical)\n\n        self.view = TreeViewWithReturn(\n            sortingEnabled=True,\n            selectionMode=QTreeView.SingleSelection,\n            alternatingRowColors=True,\n            rootIsDecorated=False,\n            editTriggers=QTreeView.NoEditTriggers,\n            uniformRowHeights=True,\n            toolTip=\"Press Return or double-click to send\"\n        )\n        # the method doesn't exists yet, pylint: disable=unnecessary-lambda\n        self.view.doubleClicked.connect(self.commit)\n        self.view.returnPressed.connect(self.commit)\n        box = gui.widgetBox(self.splitter, \"Description\", addToLayout=False)\n        self.descriptionlabel = QLabel(\n            wordWrap=True,\n            textFormat=Qt.RichText,\n        )\n        self.descriptionlabel = QTextBrowser(\n            openExternalLinks=True,\n            textInteractionFlags=(Qt.TextSelectableByMouse |\n                                  Qt.LinksAccessibleByMouse)\n        )\n        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)\n        # no (white) text background\n        self.descriptionlabel.viewport().setAutoFillBackground(False)\n\n        box.layout().addWidget(self.descriptionlabel)\n        self.splitter.addWidget(self.view)\n        self.splitter.addWidget(box)\n\n        self.splitter.setSizes([300, 200])\n        self.splitter.splitterMoved.connect(\n            lambda:\n            setattr(self, \"splitter_state\", bytes(self.splitter.saveState()))\n        )\n        self.mainArea.layout().addWidget(self.splitter)\n\n        proxy = SortFilterProxyWithLanguage()\n        proxy.setFilterKeyColumn(-1)\n        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)\n        self.view.setModel(proxy)\n\n        if self.splitter_state:\n            self.splitter.restoreState(self.splitter_state)\n\n        self.assign_delegates()\n\n        self.setBlocking(True)\n        self.setStatusMessage(\"Initializing\")\n\n        self._executor = ThreadPoolExecutor(max_workers=1)\n        f = self._executor.submit(list_remote, self.INDEX_URL)\n        w = FutureWatcher(f, parent=self)\n        w.done.connect(self.__set_index)\n\n        self._on_language_changed()\n\n    def assign_delegates(self):\n        # NOTE: All columns must have size hinting delegates.\n        # QTreeView queries only the columns displayed in the viewport so\n        # the layout would be different depending in the horizontal scroll\n        # position\n        self.view.setItemDelegate(UniformHeightDelegate(self))\n        self.view.setItemDelegateForColumn(\n            self.Header.islocal,\n            UniformHeightIndicatorDelegate(self, indicatorSize=4)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.size,\n            SizeDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.instances,\n            NumericalDelegate(self)\n        )\n        self.view.setItemDelegateForColumn(\n            self.Header.variables,\n            NumericalDelegate(self)\n        )\n        self.view.resizeColumnToContents(self.Header.islocal)\n\n    def _parse_info(self, file_path):\n        if file_path in self.allinfo_remote:\n            info = self.allinfo_remote[file_path]\n        else:\n            info = self.allinfo_local[file_path]\n\n        islocal = file_path in self.allinfo_local\n        isremote = file_path in self.allinfo_remote\n\n        outdated = islocal and isremote and (\n            self.allinfo_remote[file_path].get('version', '')\n            != self.allinfo_local[file_path].get('version', '')\n        )\n        islocal &= not outdated\n\n        prefix = os.path.join('', *file_path[:-1])\n        filename = file_path[-1]\n\n        return Namespace(file_path=file_path, prefix=prefix, filename=filename,\n                         islocal=islocal, outdated=outdated, **info)\n\n    def create_model(self):\n        self.update_language_combo()\n        return self.update_model()\n\n    def update_language_combo(self):\n        combo = self.language_combo\n        current_language = combo.currentText()\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        languages = {self._parse_info(key).language for key in allkeys}\n        if self.language is not None:\n            languages.add(self.language)\n        languages = sorted(languages)\n        combo.clear()\n        if self.DEFAULT_LANG not in languages:\n            combo.addItem(self.DEFAULT_LANG)\n        combo.addItems(languages + [self.ALL_LANGUAGES])\n        if current_language in languages:\n            combo.setCurrentText(current_language)\n        elif self.DEFAULT_LANG in languages:\n            combo.setCurrentText(self.DEFAULT_LANG)\n        else:\n            combo.setCurrentText(self.ALL_LANGUAGES)\n\n    def update_model(self):\n        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)\n        allkeys = sorted(allkeys)\n\n        model = QStandardItemModel(self)\n        model.setHorizontalHeaderLabels(self._header_labels)\n\n        current_index = -1\n        localinfo = list_local(self.local_cache_path)\n        for i, file_path in enumerate(allkeys):\n            datainfo = self._parse_info(file_path)\n            item1 = QStandardItem()\n            # this elegant and spotless trick is used for sorting\n            state = self.indicator_state_for_info(datainfo, localinfo)\n            item1.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)\n            item1.setData(datainfo, Qt.UserRole)\n            item2 = QStandardItem(datainfo.title)\n            item3 = QStandardItem()\n            item3.setData(datainfo.size, Qt.DisplayRole)\n            item4 = QStandardItem()\n            item4.setData(datainfo.instances, Qt.DisplayRole)\n            item5 = QStandardItem()\n            item5.setData(datainfo.variables, Qt.DisplayRole)\n            item6 = QStandardItem()\n            item6.setData(datainfo.target, Qt.DisplayRole)\n            if datainfo.target:\n                item6.setIcon(variable_icon(datainfo.target))\n            item7 = QStandardItem()\n            item7.setData(\", \".join(datainfo.tags) if datainfo.tags else \"\",\n                          Qt.DisplayRole)\n            row = [item1, item2, item3, item4, item5, item6, item7]\n            model.appendRow(row)\n\n            if os.path.join(*file_path) == self.selected_id:\n                current_index = i\n\n        return model, current_index\n\n    def _on_language_changed(self):\n        combo = self.language_combo\n        if combo.currentIndex() == combo.count() - 1:\n            self.language = None\n        else:\n            self.language = combo.currentText()\n        self.view.model().setLanguage(self.language)\n\n    @Slot(object)\n    def __set_index(self, f):\n        # type: (Future) -> None\n        # set results from `list_remote` query.\n        assert QThread.currentThread() is self.thread()\n        assert f.done()\n        self.setBlocking(False)\n        self.setStatusMessage(\"\")\n        self.allinfo_local = list_local(self.local_cache_path)\n\n        try:\n            self.allinfo_remote = f.result()\n        except Exception:  # anytying can happen, pylint: disable=broad-except\n            log.exception(\"Error while fetching updated index\")\n            if not self.allinfo_local:\n                self.Error.no_remote_datasets()\n            else:\n                self.Warning.only_local_datasets()\n            self.allinfo_remote = {}\n\n        model, current_index = self.create_model()\n        self.set_model(model, current_index)\n\n    def set_model(self, model, current_index):\n        self.view.model().setSourceModel(model)\n        self.view.selectionModel().selectionChanged.connect(\n            self.__on_selection\n        )\n\n        scw = self.view.setColumnWidth\n        width = self.view.fontMetrics().horizontalAdvance\n        self.view.resizeColumnToContents(0)\n        scw(self.Header.title, width(\"X\" * 37))\n        scw(self.Header.size, 20 + max(width(\"888 bytes \"), width(\"9999.9 MB \")))\n        scw(self.Header.instances, 20 + width(\"100000000\"))\n        scw(self.Header.variables, 20 + width(\"1000000\"))\n\n        header = self.view.header()\n        header.restoreState(self.header_state)\n\n        if current_index != -1:\n            selmodel = self.view.selectionModel()\n            selmodel.select(\n                self.view.model().mapFromSource(model.index(current_index, 0)),\n                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)\n            self.commit()\n\n    def indicator_state_for_info(self, info, localinfo):\n        if not info.file_path in localinfo:\n            return None\n        return (\n            os.path.join(self.local_cache_path, *info.file_path)\n            == self.current_output)\n\n    def __update_cached_state(self):\n        model = self.view.model().sourceModel()\n        assert isinstance(model, QStandardItemModel)\n        allinfo = []\n        localinfo = list_local(self.local_cache_path)\n        for i in range(model.rowCount()):\n            item = model.item(i, 0)\n            info = item.data(Qt.UserRole)\n            state = self.indicator_state_for_info(info, localinfo)\n            # this elegant and spotless trick is used for sorting\n            item.setData({None: \"\", False: \" \", True: \"  \"}[state], Qt.DisplayRole)\n            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)\n            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)\n            allinfo.append(info)\n\n    def selected_dataset(self):\n        \"\"\"\n        Return the current selected dataset info or None if not selected\n\n        Returns\n        -------\n        info : Optional[Namespace]\n        \"\"\"\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            info = current.data(Qt.UserRole)\n            assert isinstance(info, Namespace)\n        else:\n            info = None\n        return info\n\n    def filter(self):\n        filter_string = self.filterLineEdit.text().strip()\n        proxyModel = self.view.model()\n        if proxyModel:\n            proxyModel.setFilterFixedString(filter_string)\n\n    def __on_selection(self):\n        # Main datasets view selection has changed\n        rows = self.view.selectionModel().selectedRows(0)\n        assert 0 <= len(rows) <= 1\n        current = rows[0] if rows else None  # type: Optional[QModelIndex]\n        if current is not None:\n            current = self.view.model().mapToSource(current)\n            di = current.data(Qt.UserRole)\n            text = description_html(di)\n            self.descriptionlabel.setText(text)\n            self.selected_id = os.path.join(di.prefix, di.filename)\n        else:\n            self.descriptionlabel.setText(\"\")\n            self.selected_id = None\n\n    def commit(self):\n        \"\"\"\n        Commit a dataset to the output immediately (if available locally) or\n        schedule download background and an eventual send.\n\n        During the download the widget is in blocking state\n        (OWWidget.isBlocking)\n        \"\"\"\n        di = self.selected_dataset()\n        if di is not None:\n            self.Error.clear()\n\n            if self.__awaiting_state is not None:\n                # disconnect from the __commit_complete\n                self.__awaiting_state.watcher.done.disconnect(\n                    self.__commit_complete)\n                # .. and connect to update_cached_state\n                # self.__awaiting_state.watcher.done.connect(\n                #     self.__update_cached_state)\n                # TODO: There are possible pending __progress_advance queued\n                self.__awaiting_state.pb.advance.disconnect(\n                    self.__progress_advance)\n                self.progressBarFinished()\n                self.__awaiting_state = None\n\n            if not di.islocal:\n                pr = progress()\n                callback = lambda pr=pr: pr.advance.emit()\n                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)\n\n                self.progressBarInit()\n                self.setStatusMessage(\"Fetching...\")\n                self.setBlocking(True)\n\n                f = self._executor.submit(\n                    ensure_local, self.INDEX_URL, di.file_path,\n                    self.local_cache_path, force=di.outdated,\n                    progress_advance=callback)\n                w = FutureWatcher(f, parent=self)\n                w.done.connect(self.__commit_complete)\n                self.__awaiting_state = _FetchState(f, w, pr)\n            else:\n                self.setStatusMessage(\"\")\n                self.setBlocking(False)\n                self.commit_cached(di.file_path)\n        else:\n            self.load_and_output(None)\n\n    @Slot(object)\n    def __commit_complete(self, f):\n        # complete the commit operation after the required file has been\n        # downloaded\n        assert QThread.currentThread() is self.thread()\n        assert self.__awaiting_state is not None\n        assert self.__awaiting_state.future is f\n\n        if self.isBlocking():\n            self.progressBarFinished()\n            self.setBlocking(False)\n            self.setStatusMessage(\"\")\n\n        self.__awaiting_state = None\n\n        try:\n            path = f.result()\n        # anything can happen here, pylint: disable=broad-except\n        except Exception as ex:\n            log.exception(\"Error:\")\n            self.error(format_exception(ex))\n            path = None\n        self.load_and_output(path)\n\n    def commit_cached(self, file_path):\n        path = LocalFiles(self.local_cache_path).localpath(*file_path)\n        self.load_and_output(path)\n\n    @Slot()\n    def __progress_advance(self):\n        assert QThread.currentThread() is self.thread()\n        self.progressBarAdvance(1)\n\n    def onDeleteWidget(self):\n        super().onDeleteWidget()\n        if self.__awaiting_state is not None:\n            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)\n            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)\n            self.__awaiting_state = None\n\n    @staticmethod\n    def sizeHint():\n        return QSize(1100, 500)\n\n    def closeEvent(self, event):\n        self.splitter_state = bytes(self.splitter.saveState())\n        self.header_state = bytes(self.view.header().saveState())\n        super().closeEvent(event)\n\n    def load_and_output(self, path):\n        if path is None:\n            self.Outputs.data.send(None)\n        else:\n            data = self.load_data(path)\n            self.Outputs.data.send(data)\n\n        self.current_output = path\n        self.__update_cached_state()\n\n    @staticmethod\n    def load_data(path):\n        return Orange.data.Table(path)\n\n\nclass FutureWatcher(QObject):\n    done = Signal(object)\n    _p_done_notify = Signal(object)\n\n    def __init__(self, future, parent=None, **kwargs):\n        super().__init__(parent, **kwargs)\n        self.__future = future\n        self._p_done_notify.connect(self.__on_done, Qt.QueuedConnection)\n        future.add_done_callback(self._p_done_notify.emit)\n\n    @Slot(object)\n    def __on_done(self, f):\n        assert f is self.__future\n        self.done.emit(self.__future)\n\n\nclass progress(QObject):\n    advance = Signal()\n\n\nclass _FetchState:\n    def __init__(self, future, watcher, pb):\n        self.future = future\n        self.watcher = watcher\n        self.pb = pb\n\n\ndef variable_icon(name):\n    if name == \"categorical\":\n        return gui.attributeIconDict[Orange.data.DiscreteVariable(\"x\")]\n    elif name == \"numeric\":  # ??\n        return gui.attributeIconDict[Orange.data.ContinuousVariable(\"x\")]\n    else:\n        return gui.attributeIconDict[-1]\n\n\ndef make_html_list(items):\n    if items is None:\n        return ''\n    style = '\"margin: 5px; text-indent: -40px; margin-left: 40px;\"'\n\n    def format_item(i):\n        return '<p style={}><small>{}</small></p>'.format(style, i)\n\n    return '\\n'.join([format_item(i) for i in items])\n\n\ndef description_html(datainfo):\n    # type: (Namespace) -> str\n    \"\"\"\n    Summarize a data info as a html fragment.\n    \"\"\"\n    html = []\n    year = \" ({})\".format(str(datainfo.year)) if datainfo.year else \"\"\n    source = \", from {}\".format(datainfo.source) if datainfo.source else \"\"\n\n    html.append(\"<b>{}</b>{}{}\".format(escape(datainfo.title), year, source))\n    html.append(\"<p>{}</p>\".format(datainfo.description))\n    seealso = make_html_list(datainfo.seealso)\n    if seealso:\n        html.append(\"<small><b>See Also</b>\\n\" + seealso + \"</small>\")\n    refs = make_html_list(datainfo.references)\n    if refs:\n        html.append(\"<small><b>References</b>\\n\" + refs + \"</small>\")\n    return \"\\n\".join(html)\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWDataSets).run()\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

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

**Description:**
On Windows platforms, the selected dataset ID is saved using backslashes (`\`) as path separators. This causes issues during settings migration, where the backslashes are not converted to forward slashes (`/`). As a result, the application fails to correctly recognize and load the selected dataset after migration.

**Example Buggy Code:**
```python
# Initial settings with backslashes in the dataset ID
settings = {"selected_id": "dir1\\bar"}
OWDataSets.migrate_settings(settings, 0)
# Expected selected_id after migration: "dir1/bar"
# Actual selected_id: "dir1\\bar"
```

**Expected Behavior:**
The `migrate_settings` method should convert backslashes to forward slashes in the `selected_id` to ensure consistent path formatting across different operating systems. After migration, the `selected_id` should use forward slashes, such as `"dir1/bar"`.

**Actual Behavior:**
The `selected_id` retains backslashes (e.g., `"dir1\\bar"`), leading to mismatches and potential errors when the application attempts to load the selected dataset with the incorrect path format.

[/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/data/owdatasets.py
import logging
import numbers
import os
import traceback

from xml.sax.saxutils import escape
from concurrent.futures import ThreadPoolExecutor, Future

from types import SimpleNamespace
from typing import Optional, Dict, Tuple, List
from collections import namedtuple

from AnyQt.QtWidgets import (
    QLabel, QLineEdit, QTextBrowser, QSplitter, QTreeView,
    QStyleOptionViewItem, QStyledItemDelegate, QStyle, QApplication,
    QHBoxLayout, QComboBox
)
from AnyQt.QtGui import QStandardItemModel, QStandardItem, QBrush, QColor
from AnyQt.QtCore import (
    Qt, QSize, QObject, QThread, QModelIndex, QSortFilterProxyModel,
    QItemSelectionModel,
    pyqtSlot as Slot, pyqtSignal as Signal
)

from serverfiles import LocalFiles, ServerFiles, sizeformat

import Orange.data
from Orange.misc.environ import data_dir
from Orange.widgets import settings, gui
from Orange.widgets.utils.signals import Output
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import OWWidget, Msg


log = logging.getLogger(__name__)


def ensure_local(index_url, file_path, local_cache_path,
                 force=False, progress_advance=None):
    localfiles = LocalFiles(local_cache_path,
                            serverfiles=ServerFiles(server=index_url))
    if force:
        localfiles.download(*file_path, callback=progress_advance)
    return localfiles.localpath_download(*file_path, callback=progress_advance)


def list_remote(server: str) -> Dict[Tuple[str, ...], dict]:
    client = ServerFiles(server)
    return client.allinfo()


def list_local(path: str) -> Dict[Tuple[str, ...], dict]:
    return LocalFiles(path).allinfo()


def format_exception(error):
    # type: (BaseException) -> str
    return "\n".join(traceback.format_exception_only(type(error), error))


class UniformHeightDelegate(QStyledItemDelegate):
    """
    Item delegate that always includes the icon size in the size hint.
    """
    def sizeHint(self, option, index):
        # type: (QStyleOptionViewItem, QModelIndex) -> QSize
        opt = QStyleOptionViewItem(option)
        self.initStyleOption(option, index)
        opt.features |= QStyleOptionViewItem.HasDecoration
        widget = option.widget
        style = widget.style() if widget is not None else QApplication.style()
        sh = style.sizeFromContents(
            QStyle.CT_ItemViewItem, opt, QSize(), widget)
        return sh


class SizeDelegate(UniformHeightDelegate):
    def initStyleOption(self, option, index):
        # type: (QStyleOptionViewItem, QModelIndex) -> None
        super().initStyleOption(option, index)
        value = index.data(Qt.DisplayRole)
        if isinstance(value, numbers.Integral):
            option.text = sizeformat(int(value))
            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter


class NumericalDelegate(UniformHeightDelegate):
    def initStyleOption(self, option, index):
        # type: (QStyleOptionViewItem, QModelIndex) -> None
        super().initStyleOption(option, index)
        data = index.data(Qt.DisplayRole)
        align = index.data(Qt.TextAlignmentRole)
        if align is None and isinstance(data, numbers.Number):
            # Right align if the model does not specify otherwise
            option.displayAlignment = Qt.AlignRight | Qt.AlignVCenter


class UniformHeightIndicatorDelegate(
        UniformHeightDelegate, gui.IndicatorItemDelegate):
    pass


class Namespace(SimpleNamespace):
    def __init__(self, **kwargs):
        self.file_path = None
        self.prefix = None
        self.filename = None
        self.islocal = None
        self.outdated = None

        # tags from JSON info file
        self.title = None
        self.description = None
        self.instances = None
        self.variables = None
        self.target = None
        self.size = None
        self.source = None
        self.year = None
        self.references = []
        self.seealso = []
        self.tags = []
        self.language = "English"

        super(Namespace, self).__init__(**kwargs)

        # if title missing, use filename
        if not self.title and self.filename:
            self.title = self.filename


class TreeViewWithReturn(QTreeView):
    returnPressed = Signal()

    def keyPressEvent(self, e):
        if e.key() == Qt.Key_Return:
            self.returnPressed.emit()
        else:
            super().keyPressEvent(e)


class SortFilterProxyWithLanguage(QSortFilterProxyModel):
    def __init__(self):
        super().__init__()
        self.__language = None

    def setLanguage(self, language):
        self.__language = language
        self.invalidateFilter()

    def language(self):
        return self.__language

    def filterAcceptsRow(self, row, parent):
        source = self.sourceModel()
        return super().filterAcceptsRow(row, parent) and (
            self.__language is None
            or source.index(row, 0).data(Qt.UserRole).language == self.__language
        )


class OWDataSets(OWWidget):
    name = "Datasets"
    description = "Load a dataset from an online repository"
    icon = "icons/DataSets.svg"
    priority = 20
    replaces = ["orangecontrib.prototypes.widgets.owdatasets.OWDataSets"]
    keywords = "datasets, online, data, sets"

    want_control_area = False

    # The following constants can be overridden in a subclass
    # to reuse this widget for a different repository
    # Take care when refactoring! (used in e.g. single-cell)
    INDEX_URL = "https://datasets.biolab.si/"
    DATASET_DIR = "datasets"
    DEFAULT_LANG = "English"
    ALL_LANGUAGES = "All Languages"

    # override HEADER_SCHEMA to define new columns
    # if schema is changed override methods: self.assign_delegates and
    # self.create_model
    HEADER_SCHEMA = [
        ['islocal', {'label': ''}],
        ['title', {'label': 'Title'}],
        ['size', {'label': 'Size'}],
        ['instances', {'label': 'Instances'}],
        ['variables', {'label': 'Variables'}],
        ['target', {'label': 'Target'}],
        ['tags', {'label': 'Tags'}]
    ]  # type: List[str, dict]

    IndicatorBrushes = (QBrush(Qt.darkGray), QBrush(QColor(0, 192, 0)))

    class Error(OWWidget.Error):
        no_remote_datasets = Msg("Could not fetch dataset list")

    class Warning(OWWidget.Warning):
        only_local_datasets = Msg("Could not fetch datasets list, only local "
                                  "cached datasets are shown")

    class Outputs:
        data = Output("Data", Orange.data.Table)

    #: Selected dataset id
    selected_id = settings.Setting(None)   # type: Optional[str]
    language = settings.Setting(DEFAULT_LANG)

    #: main area splitter state
    splitter_state = settings.Setting(b'')  # type: bytes
    header_state = settings.Setting(b'')    # type: bytes

    def __init__(self):
        super().__init__()
        self.allinfo_local = {}
        self.allinfo_remote = {}

        self.local_cache_path = os.path.join(data_dir(), self.DATASET_DIR)
        # current_output does not equal selected_id when, for instance, the
        # data is still downloading
        self.current_output = None

        self._header_labels = [
            header['label'] for _, header in self.HEADER_SCHEMA]
        self._header_index = namedtuple(
            '_header_index', [info_tag for info_tag, _ in self.HEADER_SCHEMA])
        self.Header = self._header_index(
            *[index for index, _ in enumerate(self._header_labels)])

        self.__awaiting_state = None  # type: Optional[_FetchState]

        layout = QHBoxLayout()
        self.filterLineEdit = QLineEdit(
            textChanged=self.filter, placeholderText="Search for data set ..."
        )
        layout.addWidget(self.filterLineEdit)
        layout.addSpacing(20)
        layout.addWidget(QLabel("Show data sets in "))
        lang_combo = self.language_combo = QComboBox()
        languages = [self.DEFAULT_LANG, self.ALL_LANGUAGES]
        if self.language is not None and self.language not in languages:
            languages.insert(1, self.language)
        lang_combo.addItems(languages)
        lang_combo.setCurrentText(self.language)
        lang_combo.activated.connect(self._on_language_changed)
        layout.addWidget(lang_combo)
        self.mainArea.layout().addLayout(layout)

        self.splitter = QSplitter(orientation=Qt.Vertical)

        self.view = TreeViewWithReturn(
            sortingEnabled=True,
            selectionMode=QTreeView.SingleSelection,
            alternatingRowColors=True,
            rootIsDecorated=False,
            editTriggers=QTreeView.NoEditTriggers,
            uniformRowHeights=True,
            toolTip="Press Return or double-click to send"
        )
        # the method doesn't exists yet, pylint: disable=unnecessary-lambda
        self.view.doubleClicked.connect(self.commit)
        self.view.returnPressed.connect(self.commit)
        box = gui.widgetBox(self.splitter, "Description", addToLayout=False)
        self.descriptionlabel = QLabel(
            wordWrap=True,
            textFormat=Qt.RichText,
        )
        self.descriptionlabel = QTextBrowser(
            openExternalLinks=True,
            textInteractionFlags=(Qt.TextSelectableByMouse |
                                  Qt.LinksAccessibleByMouse)
        )
        self.descriptionlabel.setFrameStyle(QTextBrowser.NoFrame)
        # no (white) text background
        self.descriptionlabel.viewport().setAutoFillBackground(False)

        box.layout().addWidget(self.descriptionlabel)
        self.splitter.addWidget(self.view)
        self.splitter.addWidget(box)

        self.splitter.setSizes([300, 200])
        self.splitter.splitterMoved.connect(
            lambda:
            setattr(self, "splitter_state", bytes(self.splitter.saveState()))
        )
        self.mainArea.layout().addWidget(self.splitter)

        proxy = SortFilterProxyWithLanguage()
        proxy.setFilterKeyColumn(-1)
        proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)
        self.view.setModel(proxy)

        if self.splitter_state:
            self.splitter.restoreState(self.splitter_state)

        self.assign_delegates()

        self.setBlocking(True)
        self.setStatusMessage("Initializing")

        self._executor = ThreadPoolExecutor(max_workers=1)
        f = self._executor.submit(list_remote, self.INDEX_URL)
        w = FutureWatcher(f, parent=self)
        w.done.connect(self.__set_index)

        self._on_language_changed()

    def assign_delegates(self):
        # NOTE: All columns must have size hinting delegates.
        # QTreeView queries only the columns displayed in the viewport so
        # the layout would be different depending in the horizontal scroll
        # position
        self.view.setItemDelegate(UniformHeightDelegate(self))
        self.view.setItemDelegateForColumn(
            self.Header.islocal,
            UniformHeightIndicatorDelegate(self, indicatorSize=4)
        )
        self.view.setItemDelegateForColumn(
            self.Header.size,
            SizeDelegate(self)
        )
        self.view.setItemDelegateForColumn(
            self.Header.instances,
            NumericalDelegate(self)
        )
        self.view.setItemDelegateForColumn(
            self.Header.variables,
            NumericalDelegate(self)
        )
        self.view.resizeColumnToContents(self.Header.islocal)

    def _parse_info(self, file_path):
        if file_path in self.allinfo_remote:
            info = self.allinfo_remote[file_path]
        else:
            info = self.allinfo_local[file_path]

        islocal = file_path in self.allinfo_local
        isremote = file_path in self.allinfo_remote

        outdated = islocal and isremote and (
            self.allinfo_remote[file_path].get('version', '')
            != self.allinfo_local[file_path].get('version', '')
        )
        islocal &= not outdated

        prefix = os.path.join('', *file_path[:-1])
        filename = file_path[-1]

        return Namespace(file_path=file_path, prefix=prefix, filename=filename,
                         islocal=islocal, outdated=outdated, **info)

    def create_model(self):
        self.update_language_combo()
        return self.update_model()

    def update_language_combo(self):
        combo = self.language_combo
        current_language = combo.currentText()
        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)
        languages = {self._parse_info(key).language for key in allkeys}
        if self.language is not None:
            languages.add(self.language)
        languages = sorted(languages)
        combo.clear()
        if self.DEFAULT_LANG not in languages:
            combo.addItem(self.DEFAULT_LANG)
        combo.addItems(languages + [self.ALL_LANGUAGES])
        if current_language in languages:
            combo.setCurrentText(current_language)
        elif self.DEFAULT_LANG in languages:
            combo.setCurrentText(self.DEFAULT_LANG)
        else:
            combo.setCurrentText(self.ALL_LANGUAGES)

    def update_model(self):
        allkeys = set(self.allinfo_local) | set(self.allinfo_remote)
        allkeys = sorted(allkeys)

        model = QStandardItemModel(self)
        model.setHorizontalHeaderLabels(self._header_labels)

        current_index = -1
        localinfo = list_local(self.local_cache_path)
        for i, file_path in enumerate(allkeys):
            datainfo = self._parse_info(file_path)
            item1 = QStandardItem()
            # this elegant and spotless trick is used for sorting
            state = self.indicator_state_for_info(datainfo, localinfo)
            item1.setData({None: "", False: " ", True: "  "}[state], Qt.DisplayRole)
            item1.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)
            item1.setData(self.IndicatorBrushes[0], Qt.ForegroundRole)
            item1.setData(datainfo, Qt.UserRole)
            item2 = QStandardItem(datainfo.title)
            item3 = QStandardItem()
            item3.setData(datainfo.size, Qt.DisplayRole)
            item4 = QStandardItem()
            item4.setData(datainfo.instances, Qt.DisplayRole)
            item5 = QStandardItem()
            item5.setData(datainfo.variables, Qt.DisplayRole)
            item6 = QStandardItem()
            item6.setData(datainfo.target, Qt.DisplayRole)
            if datainfo.target:
                item6.setIcon(variable_icon(datainfo.target))
            item7 = QStandardItem()
            item7.setData(", ".join(datainfo.tags) if datainfo.tags else "",
                          Qt.DisplayRole)
            row = [item1, item2, item3, item4, item5, item6, item7]
            model.appendRow(row)

            if os.path.join(*file_path) == self.selected_id:
                current_index = i

        return model, current_index

    def _on_language_changed(self):
        combo = self.language_combo
        if combo.currentIndex() == combo.count() - 1:
            self.language = None
        else:
            self.language = combo.currentText()
        self.view.model().setLanguage(self.language)

    @Slot(object)
    def __set_index(self, f):
        # type: (Future) -> None
        # set results from `list_remote` query.
        assert QThread.currentThread() is self.thread()
        assert f.done()
        self.setBlocking(False)
        self.setStatusMessage("")
        self.allinfo_local = list_local(self.local_cache_path)

        try:
            self.allinfo_remote = f.result()
        except Exception:  # anytying can happen, pylint: disable=broad-except
            log.exception("Error while fetching updated index")
            if not self.allinfo_local:
                self.Error.no_remote_datasets()
            else:
                self.Warning.only_local_datasets()
            self.allinfo_remote = {}

        model, current_index = self.create_model()
        self.set_model(model, current_index)

    def set_model(self, model, current_index):
        self.view.model().setSourceModel(model)
        self.view.selectionModel().selectionChanged.connect(
            self.__on_selection
        )

        scw = self.view.setColumnWidth
        width = self.view.fontMetrics().horizontalAdvance
        self.view.resizeColumnToContents(0)
        scw(self.Header.title, width("X" * 37))
        scw(self.Header.size, 20 + max(width("888 bytes "), width("9999.9 MB ")))
        scw(self.Header.instances, 20 + width("100000000"))
        scw(self.Header.variables, 20 + width("1000000"))

        header = self.view.header()
        header.restoreState(self.header_state)

        if current_index != -1:
            selmodel = self.view.selectionModel()
            selmodel.select(
                self.view.model().mapFromSource(model.index(current_index, 0)),
                QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)
            self.commit()

    def indicator_state_for_info(self, info, localinfo):
        if not info.file_path in localinfo:
            return None
        return (
            os.path.join(self.local_cache_path, *info.file_path)
            == self.current_output)

    def __update_cached_state(self):
        model = self.view.model().sourceModel()
        assert isinstance(model, QStandardItemModel)
        allinfo = []
        localinfo = list_local(self.local_cache_path)
        for i in range(model.rowCount()):
            item = model.item(i, 0)
            info = item.data(Qt.UserRole)
            state = self.indicator_state_for_info(info, localinfo)
            # this elegant and spotless trick is used for sorting
            item.setData({None: "", False: " ", True: "  "}[state], Qt.DisplayRole)
            item.setData(state, UniformHeightIndicatorDelegate.IndicatorRole)
            item.setData(self.IndicatorBrushes[bool(state)], Qt.ForegroundRole)
            allinfo.append(info)

    def selected_dataset(self):
        """
        Return the current selected dataset info or None if not selected

        Returns
        -------
        info : Optional[Namespace]
        """
        rows = self.view.selectionModel().selectedRows(0)
        assert 0 <= len(rows) <= 1
        current = rows[0] if rows else None  # type: Optional[QModelIndex]
        if current is not None:
            info = current.data(Qt.UserRole)
            assert isinstance(info, Namespace)
        else:
            info = None
        return info

    def filter(self):
        filter_string = self.filterLineEdit.text().strip()
        proxyModel = self.view.model()
        if proxyModel:
            proxyModel.setFilterFixedString(filter_string)

    def __on_selection(self):
        # Main datasets view selection has changed
        rows = self.view.selectionModel().selectedRows(0)
        assert 0 <= len(rows) <= 1
        current = rows[0] if rows else None  # type: Optional[QModelIndex]
        if current is not None:
            current = self.view.model().mapToSource(current)
            di = current.data(Qt.UserRole)
            text = description_html(di)
            self.descriptionlabel.setText(text)
            self.selected_id = os.path.join(di.prefix, di.filename)
        else:
            self.descriptionlabel.setText("")
            self.selected_id = None

    def commit(self):
        """
        Commit a dataset to the output immediately (if available locally) or
        schedule download background and an eventual send.

        During the download the widget is in blocking state
        (OWWidget.isBlocking)
        """
        di = self.selected_dataset()
        if di is not None:
            self.Error.clear()

            if self.__awaiting_state is not None:
                # disconnect from the __commit_complete
                self.__awaiting_state.watcher.done.disconnect(
                    self.__commit_complete)
                # .. and connect to update_cached_state
                # self.__awaiting_state.watcher.done.connect(
                #     self.__update_cached_state)
                # TODO: There are possible pending __progress_advance queued
                self.__awaiting_state.pb.advance.disconnect(
                    self.__progress_advance)
                self.progressBarFinished()
                self.__awaiting_state = None

            if not di.islocal:
                pr = progress()
                callback = lambda pr=pr: pr.advance.emit()
                pr.advance.connect(self.__progress_advance, Qt.QueuedConnection)

                self.progressBarInit()
                self.setStatusMessage("Fetching...")
                self.setBlocking(True)

                f = self._executor.submit(
                    ensure_local, self.INDEX_URL, di.file_path,
                    self.local_cache_path, force=di.outdated,
                    progress_advance=callback)
                w = FutureWatcher(f, parent=self)
                w.done.connect(self.__commit_complete)
                self.__awaiting_state = _FetchState(f, w, pr)
            else:
                self.setStatusMessage("")
                self.setBlocking(False)
                self.commit_cached(di.file_path)
        else:
            self.load_and_output(None)

    @Slot(object)
    def __commit_complete(self, f):
        # complete the commit operation after the required file has been
        # downloaded
        assert QThread.currentThread() is self.thread()
        assert self.__awaiting_state is not None
        assert self.__awaiting_state.future is f

        if self.isBlocking():
            self.progressBarFinished()
            self.setBlocking(False)
            self.setStatusMessage("")

        self.__awaiting_state = None

        try:
            path = f.result()
        # anything can happen here, pylint: disable=broad-except
        except Exception as ex:
            log.exception("Error:")
            self.error(format_exception(ex))
            path = None
        self.load_and_output(path)

    def commit_cached(self, file_path):
        path = LocalFiles(self.local_cache_path).localpath(*file_path)
        self.load_and_output(path)

    @Slot()
    def __progress_advance(self):
        assert QThread.currentThread() is self.thread()
        self.progressBarAdvance(1)

    def onDeleteWidget(self):
        super().onDeleteWidget()
        if self.__awaiting_state is not None:
            self.__awaiting_state.watcher.done.disconnect(self.__commit_complete)
            self.__awaiting_state.pb.advance.disconnect(self.__progress_advance)
            self.__awaiting_state = None

    @staticmethod
    def sizeHint():
        return QSize(1100, 500)

    def closeEvent(self, event):
        self.splitter_state = bytes(self.splitter.saveState())
        self.header_state = bytes(self.view.header().saveState())
        super().closeEvent(event)

    def load_and_output(self, path):
        if path is None:
            self.Outputs.data.send(None)
        else:
            data = self.load_data(path)
            self.Outputs.data.send(data)

        self.current_output = path
        self.__update_cached_state()

    @staticmethod
    def load_data(path):
        return Orange.data.Table(path)


class FutureWatcher(QObject):
    done = Signal(object)
    _p_done_notify = Signal(object)

    def __init__(self, future, parent=None, **kwargs):
        super().__init__(parent, **kwargs)
        self.__future = future
        self._p_done_notify.connect(self.__on_done, Qt.QueuedConnection)
        future.add_done_callback(self._p_done_notify.emit)

    @Slot(object)
    def __on_done(self, f):
        assert f is self.__future
        self.done.emit(self.__future)


class progress(QObject):
    advance = Signal()


class _FetchState:
    def __init__(self, future, watcher, pb):
        self.future = future
        self.watcher = watcher
        self.pb = pb


def variable_icon(name):
    if name == "categorical":
        return gui.attributeIconDict[Orange.data.DiscreteVariable("x")]
    elif name == "numeric":  # ??
        return gui.attributeIconDict[Orange.data.ContinuousVariable("x")]
    else:
        return gui.attributeIconDict[-1]


def make_html_list(items):
    if items is None:
        return ''
    style = '"margin: 5px; text-indent: -40px; margin-left: 40px;"'

    def format_item(i):
        return '<p style={}><small>{}</small></p>'.format(style, i)

    return '\n'.join([format_item(i) for i in items])


def description_html(datainfo):
    # type: (Namespace) -> str
    """
    Summarize a data info as a html fragment.
    """
    html = []
    year = " ({})".format(str(datainfo.year)) if datainfo.year else ""
    source = ", from {}".format(datainfo.source) if datainfo.source else ""

    html.append("<b>{}</b>{}{}".format(escape(datainfo.title), year, source))
    html.append("<p>{}</p>".format(datainfo.description))
    seealso = make_html_list(datainfo.seealso)
    if seealso:
        html.append("<small><b>See Also</b>\n" + seealso + "</small>")
    refs = make_html_list(datainfo.references)
    if refs:
        html.append("<small><b>References</b>\n" + refs + "</small>")
    return "\n".join(html)


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWDataSets).run()

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