{
    "file_diffs": [
        {
            "old_file_content": "import os\nimport logging\nfrom itertools import chain\nfrom urllib.parse import urlparse\nfrom typing import List, Dict, Any\n\nimport numpy as np\nfrom AnyQt.QtWidgets import \\\n    QStyle, QComboBox, QMessageBox, QGridLayout, QLabel, \\\n    QLineEdit, QSizePolicy as Policy, QCompleter\nfrom AnyQt.QtCore import Qt, QTimer, QSize, QUrl\nfrom AnyQt.QtGui import QBrush\n\nfrom orangewidget.utils.filedialogs import format_filter\nfrom orangewidget.workflow.drophandler import SingleUrlDropHandler\n\nfrom Orange.data.table import Table, get_sample_datasets_dir\nfrom Orange.data.io import FileFormat, UrlReader, class_from_qualified_name\nfrom Orange.data.io_base import MissingReaderException\nfrom Orange.util import log_warnings\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.utils.localization import pl\nfrom Orange.widgets.settings import Setting, ContextSetting, \\\n    PerfectDomainContextHandler, SettingProvider\nfrom Orange.widgets.utils.domaineditor import DomainEditor\nfrom Orange.widgets.utils.itemmodels import PyListModel\nfrom Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \\\n    open_filename_dialog, stored_recent_paths_prepend\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Output, Msg\n\n# Backward compatibility: class RecentPath used to be defined in this module,\n# and it is used in saved (pickled) settings. It must be imported into the\n# module's namespace so that old saved settings still work\nfrom Orange.widgets.utils.filedialogs import RecentPath\n\nDEFAULT_READER_TEXT = \"Automatically detect type\"\n\nlog = logging.getLogger(__name__)\n\n\ndef add_origin(examples, filename):\n    \"\"\"\n    Adds attribute with file location to each string variable\n    Used for relative filenames stored in string variables (e.g. pictures)\n    TODO: we should consider a cleaner solution (special variable type, ...)\n    \"\"\"\n    if not filename:\n        return\n    strings = [var\n               for var in examples.domain.variables + examples.domain.metas\n               if var.is_string]\n    dir_name, _ = os.path.split(filename)\n    for var in strings:\n        if \"type\" in var.attributes and \"origin\" not in var.attributes:\n            var.attributes[\"origin\"] = dir_name\n\n\nclass NamedURLModel(PyListModel):\n    def __init__(self, mapping):\n        self.mapping = mapping\n        super().__init__()\n\n    def data(self, index, role=Qt.DisplayRole):\n        data = super().data(index, role)\n        if role == Qt.DisplayRole:\n            return self.mapping.get(data, data)\n        return data\n\n    def add_name(self, url, name):\n        self.mapping[url] = name\n        self.modelReset.emit()\n\n\nclass LineEditSelectOnFocus(QLineEdit):\n    def focusInEvent(self, event):\n        super().focusInEvent(event)\n        # If selectAll is called directly, placing the cursor unselects the text\n        QTimer.singleShot(0, self.selectAll)\n\n\nclass OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)\n\n\nclass OWFileDropHandler(SingleUrlDropHandler):\n    WIDGET = OWFile\n\n    def canDropUrl(self, url: QUrl) -> bool:\n        if url.isLocalFile():\n            try:\n                FileFormat.get_reader(url.toLocalFile())\n                return True\n            except Exception:  # noqa # pylint:disable=broad-except\n                return False\n        else:\n            return url.scheme().lower() in (\"http\", \"https\", \"ftp\")\n\n    def parametersFromUrl(self, url: QUrl) -> Dict[str, Any]:\n        if url.isLocalFile():\n            path = url.toLocalFile()\n            r = RecentPath(os.path.abspath(path), None, None,\n                           os.path.basename(path))\n            return {\n                \"recent_paths\": stored_recent_paths_prepend(self.WIDGET, r),\n                \"source\": OWFile.LOCAL_FILE,\n            }\n        else:\n            return {\n                \"recent_urls\": [url.toString()],\n                \"source\": OWFile.URL,\n            }\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWFile).run()\n",
            "new_file_content": "import os\nimport logging\nfrom itertools import chain\nfrom urllib.parse import urlparse\nfrom typing import List, Dict, Any\n\nimport numpy as np\nfrom AnyQt.QtWidgets import \\\n    QStyle, QComboBox, QMessageBox, QGridLayout, QLabel, \\\n    QLineEdit, QSizePolicy as Policy, QCompleter\nfrom AnyQt.QtCore import Qt, QTimer, QSize, QUrl\nfrom AnyQt.QtGui import QBrush\n\nfrom orangewidget.utils.filedialogs import format_filter\nfrom orangewidget.workflow.drophandler import SingleUrlDropHandler\n\nfrom Orange.data.table import Table, get_sample_datasets_dir\nfrom Orange.data.io import FileFormat, UrlReader, class_from_qualified_name\nfrom Orange.data.io_base import MissingReaderException\nfrom Orange.util import log_warnings\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.utils.localization import pl\nfrom Orange.widgets.settings import Setting, ContextSetting, \\\n    PerfectDomainContextHandler, SettingProvider\nfrom Orange.widgets.utils.domaineditor import DomainEditor\nfrom Orange.widgets.utils.itemmodels import PyListModel\nfrom Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \\\n    open_filename_dialog, stored_recent_paths_prepend\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Output, Msg\nfrom Orange.widgets.utils.combobox import TextEditCombo\n\n\n# Backward compatibility: class RecentPath used to be defined in this module,\n# and it is used in saved (pickled) settings. It must be imported into the\n# module's namespace so that old saved settings still work\nfrom Orange.widgets.utils.filedialogs import RecentPath\n\nDEFAULT_READER_TEXT = \"Automatically detect type\"\n\nlog = logging.getLogger(__name__)\n\n\ndef add_origin(examples, filename):\n    \"\"\"\n    Adds attribute with file location to each string variable\n    Used for relative filenames stored in string variables (e.g. pictures)\n    TODO: we should consider a cleaner solution (special variable type, ...)\n    \"\"\"\n    if not filename:\n        return\n    strings = [var\n               for var in examples.domain.variables + examples.domain.metas\n               if var.is_string]\n    dir_name, _ = os.path.split(filename)\n    for var in strings:\n        if \"type\" in var.attributes and \"origin\" not in var.attributes:\n            var.attributes[\"origin\"] = dir_name\n\n\nclass NamedURLModel(PyListModel):\n    def __init__(self, mapping):\n        self.mapping = mapping\n        super().__init__()\n\n    def data(self, index, role=Qt.DisplayRole):\n        data = super().data(index, role)\n        if role == Qt.DisplayRole:\n            return self.mapping.get(data, data)\n        return data\n\n    def add_name(self, url, name):\n        self.mapping[url] = name\n        self.modelReset.emit()\n\n\nclass LineEditSelectOnFocus(QLineEdit):\n    def focusInEvent(self, event):\n        super().focusInEvent(event)\n        # If selectAll is called directly, placing the cursor unselects the text\n        QTimer.singleShot(0, self.selectAll)\n\n\nclass OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = TextEditCombo()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        index = self.url_combo.currentIndex()\n        url = self.url_combo.currentText()\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(index, url)\n\n        if index != 0:\n            model = self.url_combo.model()\n            root = self.url_combo.rootModelIndex()\n            model.moveRow(root, index, root, 0)\n            assert self.url_combo.currentIndex() == 0\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)\n\n\nclass OWFileDropHandler(SingleUrlDropHandler):\n    WIDGET = OWFile\n\n    def canDropUrl(self, url: QUrl) -> bool:\n        if url.isLocalFile():\n            try:\n                FileFormat.get_reader(url.toLocalFile())\n                return True\n            except Exception:  # noqa # pylint:disable=broad-except\n                return False\n        else:\n            return url.scheme().lower() in (\"http\", \"https\", \"ftp\")\n\n    def parametersFromUrl(self, url: QUrl) -> Dict[str, Any]:\n        if url.isLocalFile():\n            path = url.toLocalFile()\n            r = RecentPath(os.path.abspath(path), None, None,\n                           os.path.basename(path))\n            return {\n                \"recent_paths\": stored_recent_paths_prepend(self.WIDGET, r),\n                \"source\": OWFile.LOCAL_FILE,\n            }\n        else:\n            return {\n                \"recent_urls\": [url.toString()],\n                \"source\": OWFile.URL,\n            }\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWFile).run()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/owfile.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "fb3ae2dda",
                "new_commit_hash": "35fc2691b",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/owfile.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/owfile.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 28,
                            "length": 6
                        },
                        "new_range": {
                            "start": 28,
                            "length": 8
                        },
                        "section": "from Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \\"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    open_filename_dialog, stored_recent_paths_prepend",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.widgetpreview import WidgetPreview",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.widget import Output, Msg",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.combobox import TextEditCombo",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "# Backward compatibility: class RecentPath used to be defined in this module,",
                                "type": "context"
                            },
                            {
                                "content": "# and it is used in saved (pickled) settings. It must be imported into the",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/owfile.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.utils.combobox import TextEditCombo",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 31,
                            "end_lineno": 31,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 232,
                            "length": 13
                        },
                        "new_range": {
                            "start": 234,
                            "length": 12
                        },
                        "section": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)",
                                "type": "context"
                            },
                            {
                                "content": "        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.url_combo = url_combo = QComboBox()",
                                "type": "deleted"
                            },
                            {
                                "content": "        self.url_combo = url_combo = TextEditCombo()",
                                "type": "added"
                            },
                            {
                                "content": "        url_model = NamedURLModel(self.sheet_names)",
                                "type": "context"
                            },
                            {
                                "content": "        url_model.wrap(self.recent_urls)",
                                "type": "context"
                            },
                            {
                                "content": "        url_combo.setLineEdit(LineEditSelectOnFocus())",
                                "type": "context"
                            },
                            {
                                "content": "        url_combo.setModel(url_model)",
                                "type": "context"
                            },
                            {
                                "content": "        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)",
                                "type": "context"
                            },
                            {
                                "content": "        url_combo.setEditable(True)",
                                "type": "deleted"
                            },
                            {
                                "content": "        url_combo.setInsertPolicy(url_combo.InsertAtTop)",
                                "type": "context"
                            },
                            {
                                "content": "        url_edit = url_combo.lineEdit()",
                                "type": "context"
                            },
                            {
                                "content": "        margins = url_edit.textMargins()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owfile.py",
                            "type": "class",
                            "name": "OWFile",
                            "content": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 82,
                            "end_lineno": 659,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owfile.py",
                            "type": "method",
                            "name": "OWFile.__init__",
                            "content": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 161,
                            "end_lineno": 310,
                            "parent": {
                                "file_name": "Orange/widgets/data/owfile.py",
                                "type": "class",
                                "name": "OWFile",
                                "content": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 82,
                                "end_lineno": 659,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 343,
                            "length": 14
                        },
                        "new_range": {
                            "start": 344,
                            "length": 19
                        },
                        "section": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "                self.load_data()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def _url_set(self):",
                                "type": "context"
                            },
                            {
                                "content": "        index = self.url_combo.currentIndex()",
                                "type": "added"
                            },
                            {
                                "content": "        url = self.url_combo.currentText()",
                                "type": "context"
                            },
                            {
                                "content": "        pos = self.recent_urls.index(url)",
                                "type": "deleted"
                            },
                            {
                                "content": "        url = url.strip()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        if not urlparse(url).scheme:",
                                "type": "context"
                            },
                            {
                                "content": "            url = 'http://' + url",
                                "type": "context"
                            },
                            {
                                "content": "            self.url_combo.setItemText(pos, url)",
                                "type": "deleted"
                            },
                            {
                                "content": "            self.recent_urls[pos] = url",
                                "type": "deleted"
                            },
                            {
                                "content": "            self.url_combo.setItemText(index, url)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        if index != 0:",
                                "type": "added"
                            },
                            {
                                "content": "            model = self.url_combo.model()",
                                "type": "added"
                            },
                            {
                                "content": "            root = self.url_combo.rootModelIndex()",
                                "type": "added"
                            },
                            {
                                "content": "            model.moveRow(root, index, root, 0)",
                                "type": "added"
                            },
                            {
                                "content": "            assert self.url_combo.currentIndex() == 0",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.source = self.URL",
                                "type": "context"
                            },
                            {
                                "content": "        self.load_data()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owfile.py",
                            "type": "class",
                            "name": "OWFile",
                            "content": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 82,
                            "end_lineno": 659,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owfile.py",
                            "type": "method",
                            "name": "OWFile._url_set",
                            "content": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 345,
                            "end_lineno": 356,
                            "parent": {
                                "file_name": "Orange/widgets/data/owfile.py",
                                "type": "class",
                                "name": "OWFile",
                                "content": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 82,
                                "end_lineno": 659,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,protected-access\nfrom os import path, remove, getcwd\nfrom os.path import dirname\nimport unittest\nfrom threading import Thread\nfrom unittest.mock import Mock, patch\nimport pickle\nimport tempfile\nimport warnings\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import QMimeData, QPoint, Qt, QUrl, QPointF\nfrom AnyQt.QtGui import QDragEnterEvent, QDropEvent\nfrom AnyQt.QtWidgets import QComboBox\n\nimport Orange\n\nfrom Orange.data import FileFormat, dataset_dirs, StringVariable, Table, \\\n    Domain, DiscreteVariable, ContinuousVariable\nfrom Orange.util import OrangeDeprecationWarning\n\nfrom Orange.data.io import TabReader\nfrom Orange.tests import named_file\nfrom Orange.widgets.data.owfile import OWFile, OWFileDropHandler, DEFAULT_READER_TEXT\nfrom Orange.widgets.utils.filedialogs import dialog_formats, format_filter, RecentPath\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.domaineditor import ComboDelegate, VarTypeDelegate, VarTableModel\n\nTITANIC_PATH = path.join(path.dirname(Orange.__file__), 'datasets', 'titanic.tab')\norig_path_exists = path.exists\n\n\nclass FailedSheetsFormat(FileFormat):\n    EXTENSIONS = ('.failed_sheet',)\n    DESCRIPTION = \"Make a sheet function that fails\"\n\n    def read(self):\n        pass\n\n    def sheets(self):\n        raise Exception(\"Not working\")\n\n\nclass WithWarnings(FileFormat):\n    EXTENSIONS = ('.with_warning',)\n    DESCRIPTION = \"Warning\"\n\n    @staticmethod\n    def read():\n        warnings.warn(\"Some warning\")\n        return Orange.data.Table(\"iris\")\n\n\nclass MyCustomTabReader(FileFormat):\n    EXTENSIONS = ('.tab',)\n    DESCRIPTION = \"Always return iris\"\n    PRIORITY = 999999\n\n    @staticmethod\n    def read():\n        return Orange.data.Table(\"iris\")\n\n\nclass TestOWFile(WidgetTest):\n    # Attribute used to store event data so it does not get garbage\n    # collected before event is processed.\n    event_data = None\n\n    def setUp(self):\n        self.widget = self.create_widget(OWFile)  # type: OWFile\n        dataset_dirs.append(dirname(__file__))\n\n    def tearDown(self):\n        dataset_dirs.pop()\n\n    def test_describe_call_get_nans(self):\n        table = Table(\"iris\")\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_called()\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_not_called()\n\n    def test_dragEnterEvent_accepts_urls(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dragEnterEvent(event)\n        self.assertTrue(event.isAccepted())\n\n    def test_dragEnterEvent_skips_osx_file_references(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('/.file/id=12345'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def test_dragEnterEvent_skips_usupported_files(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('file.unsupported'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def _drag_enter_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n        return QDragEnterEvent(\n            QPoint(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier)\n\n    def test_dropEvent_selects_file(self):\n        self.widget.load_data = Mock()\n        self.widget.source = OWFile.URL\n\n        event = self._drop_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dropEvent(event)\n\n        self.assertEqual(self.widget.source, OWFile.LOCAL_FILE)\n        self.assertTrue(path.samefile(self.widget.last_path(), TITANIC_PATH))\n        self.widget.load_data.assert_called_with()\n\n    def _drop_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n\n        return QDropEvent(\n            QPointF(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier, QDropEvent.Drop)\n\n    def test_check_file_size(self):\n        self.assertFalse(self.widget.Warning.file_too_big.is_shown())\n        self.widget.SIZE_LIMIT = 4000\n        self.widget.__init__()\n        self.assertTrue(self.widget.Warning.file_too_big.is_shown())\n\n    def test_domain_changes_are_stored(self):\n        assert isinstance(self.widget, OWFile)\n\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n        self.open_dataset(\"zoo\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(data.name, \"zoo\")\n\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n    def test_rename_duplicates(self):\n        self.open_dataset(\"iris\")\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n        self.widget.domain_editor.model().setData(idx, \"iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"iris (1)\", data.domain)\n        self.assertIn(\"iris (2)\", data.domain)\n        self.assertTrue(self.widget.Warning.renamed_vars.is_shown())\n\n        self.widget.domain_editor.model().setData(idx, \"different iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n\n    def test_variable_name_change(self):\n        \"\"\"\n        Test whether the name of the variable is changed correctly by\n        the domaineditor.\n        \"\"\"\n        self.open_dataset(\"iris\")\n\n        # just rename\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"a\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"a\", data.domain)\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.widget.domain_editor.model().setData(idx, \"d\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"d\", data.domain)\n\n        # rename and change to text\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"b\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"b\", data.domain)\n        self.assertIsInstance(data.domain[\"b\"], StringVariable)\n\n        # rename and change to discrete\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(\n            idx, \"categorical\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], DiscreteVariable)\n\n        # rename and change to continuous\n        self.open_dataset(\"zoo\")\n        idx = self.widget.domain_editor.model().createIndex(0, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(0, 1)\n        self.widget.domain_editor.model().setData(idx, \"numeric\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], ContinuousVariable)\n\n    def open_dataset(self, name):\n        filename = FileFormat.locate(name, dataset_dirs)\n        self.widget.add_path(filename)\n        self.widget.load_data()\n\n    def test_no_last_path(self):\n        self.widget =\\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n        # Doesn't crash and contains a single item, (none).\n        self.assertEqual(self.widget.file_combo.count(), 1)\n\n    def test_file_not_found(self):\n        # Create a dummy file\n        file_name = \"test_owfile_data.tab\"\n        domainA = Domain([DiscreteVariable(\"d1\", values=(\"a\", \"b\"))],\n                         DiscreteVariable(\"c1\", values=(\"aaa\", \"bbb\")))\n        dataA = Table(domainA, np.array([[0], [1], [0], [np.nan]]),\n                      np.array([0, 1, 0, 1]))\n        dataA.save(file_name)\n\n        # Open the file with the widget\n        self.open_dataset(file_name)\n        self.assertEqual(self.get_output(self.widget.Outputs.data).domain, dataA.domain)\n\n        # Delete the file and try to reload it\n        remove(file_name)\n        self.widget.load_data()\n        self.assertEqual(file_name, path.basename(self.widget.last_path()))\n        self.assertTrue(self.widget.Error.file_not_found.is_shown())\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n        self.assertEqual(self.widget.infolabel.text(), \"No data.\")\n\n        # Open a sample dataset\n        self.open_dataset(\"iris\")\n        self.assertFalse(self.widget.Error.file_not_found.is_shown())\n\n    def test_nothing_selected(self):\n        # pylint: disable=protected-access\n        widget = self.widget = \\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n\n        widget.Outputs.data.send = Mock()\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n        widget.Outputs.data.send.reset_mock()\n        widget.source = widget.URL\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n    def test_check_column_noname(self):\n        \"\"\"\n        Column name cannot be changed to an empty string or a string with whitespaces.\n        GH-2039\n        \"\"\"\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(1, 0)\n        temp = self.widget.domain_editor.model().data(idx, Qt.DisplayRole)\n        self.widget.domain_editor.model().setData(idx, \"   \", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n        self.widget.domain_editor.model().setData(idx, \"\", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n\n    def test_invalid_role_mode(self):\n        self.open_dataset(\"iris\")\n        model = self.widget.domain_editor.model()\n        idx = model.createIndex(1, 0)\n        self.assertFalse(model.setData(idx, Qt.StatusTipRole, \"\"))\n        self.assertIsNone(model.data(idx, Qt.StatusTipRole))\n\n    def test_context_match_includes_variable_values(self):\n        file1 = \"\"\"\\\nvar\na b\n\na\n\"\"\"\n        file2 = \"\"\"\\\nvar\na b c\n\na\n\"\"\"\n        editor = self.widget.domain_editor\n        idx = self.widget.domain_editor.model().createIndex(0, 3)\n\n        with named_file(file1, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b\")\n\n        with named_file(file2, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b, c\")\n\n    def test_check_datetime_disabled(self):\n        \"\"\"\n        Datetime option is disable if numerical is disabled as well.\n        GH-2050 (code fixes)\n        GH-2120\n        \"\"\"\n        dat = \"\"\"\\\n            01.08.16\\t42.15\\tneumann\\t2017-02-20\n            03.08.16\\t16.08\\tneumann\\t2017-02-21\n            04.08.16\\t23.04\\tneumann\\t2017-02-22\n            03.09.16\\t48.84\\tturing\\t2017-02-23\n            02.02.17\\t23.16\\tturing\\t2017-02-24\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            domain_editor = self.widget.domain_editor\n            idx = lambda x: self.widget.domain_editor.model().createIndex(x, 1)\n\n            qcombobox = QComboBox()\n            combo = ComboDelegate(domain_editor,\n                                  VarTableModel.typenames).createEditor(qcombobox, None, idx(2))\n            vartype_delegate = VarTypeDelegate(domain_editor, VarTableModel.typenames)\n\n            vartype_delegate.setEditorData(combo, idx(2))\n            counts = [4, 2, 4, 2]\n            for i in range(4):\n                vartype_delegate.setEditorData(combo, idx(i))\n                self.assertEqual(combo.count(), counts[i])\n\n    def test_reader_custom_tab(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            qname = MyCustomTabReader.qualified_name()\n            reader = RecentPath(fn, None, None, file_format=qname)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [reader]})\n            self.widget.load_data()\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n        outdata = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(len(outdata), 150)  # loaded iris\n\n    def test_no_reader_extension(self):\n        with named_file(\"\", suffix=\".xyz_unknown\") as fn:\n            no_reader = RecentPath(fn, None, None)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_reader]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n\n    def test_fail_sheets(self):\n        with named_file(\"\", suffix=\".failed_sheet\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Error.sheet_error.is_shown())\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n\n    def test_fail(self):\n        with named_file(\"name\\nc\\n\\nstring\", suffix=\".tab\") as fn, \\\n                patch(\"Orange.widgets.data.owfile.log.exception\") as log:\n            self.open_dataset(fn)\n            log.assert_called()\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n\n    def test_read_format(self):\n        iris = Table(\"iris\")\n\n        def open_iris_with_no_spec_format(_a, _b, _c, filters, _e):\n            return iris.__file__, filters.split(\";;\")[0]\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_no_spec_format):\n            self.widget.browse_file()\n\n        self.assertIsNone(self.widget.recent_paths[0].file_format)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n\n        def open_iris_with_tab(*_):\n            return iris.__file__, format_filter(TabReader)\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_tab):\n            self.widget.browse_file()\n\n        self.assertEqual(self.widget.recent_paths[0].file_format, \"Orange.data.io.TabReader\")\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n\n    def test_no_specified_reader(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            no_class = RecentPath(fn, None, None, file_format=\"not.a.file.reader.class\")\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_class]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n\n    def test_select_reader(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        # a setting which adds a new qualified name to the reader combo\n        no_class = RecentPath(filename, None, None, file_format=\"not.a.file.reader.class\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        len_with_qname = len(self.widget.reader_combo)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the last option, the same reader\n        self.widget.reader_combo.activated.emit(len_with_qname - 1)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the tab reader\n        for i in range(len_with_qname):\n            text = self.widget.reader_combo.itemText(i)\n            if text.startswith(\"Tab-separated\"):\n                break\n        self.widget.reader_combo.activated.emit(i)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n        # select the default reader\n        self.widget.reader_combo.activated.emit(0)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n    def test_select_reader_errors(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        no_class = RecentPath(filename, None, None, file_format=\"Orange.data.io.ExcelReader\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        self.assertIn(\"Excel\", self.widget.reader_combo.currentText())\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n\n    def test_domain_edit_no_changes(self):\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        # When no changes have been made in the domain editor,\n        # output data should be the same object (and not recreated)\n        self.assertTrue(data is self.widget.data)\n\n    def test_domain_edit_on_sparse_data(self):\n        iris = Table(\"iris\").to_sparse()\n\n        with named_file(\"\", suffix='.pickle') as fn:\n            with open(fn, \"wb\") as f:\n                pickle.dump(iris, f)\n\n            self.widget.add_path(fn)\n            self.widget.load_data()\n\n        output = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(output, Table)\n        self.assertEqual(iris.X.shape, output.X.shape)\n        self.assertTrue(sp.issparse(output.X))\n\n    def test_drop_data_when_everything_skipped(self):\n        \"\"\"\n        No data when everything is skipped. Otherwise Select Rows crashes.\n        GH-2237\n        \"\"\"\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertTrue(len(data), 150)\n        self.assertTrue(len(data.domain.variables), 5)\n        for i in range(5):\n            idx = self.widget.domain_editor.model().createIndex(i, 2)\n            self.widget.domain_editor.model().setData(idx, \"skip\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsNone(data)\n\n    def test_call_deprecated_dialog_formats(self):\n        with self.assertWarns(OrangeDeprecationWarning):\n            self.assertIn(\"Tab\", dialog_formats())\n\n    def test_add_new_format(self):\n        # test adding file formats after registering the widget\n        called = False\n        with named_file(\"\", suffix=\".tab\") as filename:\n            def test_format(_sd, _sf, ff, **_):\n                nonlocal called\n                called = True\n                self.assertIn(FailedSheetsFormat, ff)\n                return filename, TabReader, \"\"\n            with patch(\"Orange.widgets.data.owfile.open_filename_dialog\", test_format):\n                self.widget.browse_file()\n        self.assertTrue(called)\n\n    def test_domain_editor_conversions(self):\n        dat = \"\"\"V0\\tV1\\tV2\\tV3\\tV4\\tV5\\tV6\n                 c\\tc\\td\\td\\tc\\td\\td\n                  \\t \\t \\t \\t \\t \\t\n                 3.0\\t1.0\\t4\\ta\\t0.0\\tx\\t1.0\n                 1.0\\t2.0\\t4\\tb\\t0.0\\ty\\t2.0\n                 2.0\\t1.0\\t7\\ta\\t0.0\\ty\\t2.0\n                 0.0\\t2.0\\t7\\ta\\t0.0\\tz\\t2.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            data1 = self.get_output(self.widget.Outputs.data)\n            model = self.widget.domain_editor.model()\n            # check the ordering of attributes\n            for i, a in enumerate(data1.domain.attributes):\n                self.assertEqual(str(a), model.data(model.createIndex(i, 0), Qt.DisplayRole))\n            # make conversions\n            model.setData(model.createIndex(0, 1), \"categorical\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(2, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(3, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(6, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n            data2 = self.get_output(self.widget.Outputs.data)\n            # round continuous values should be converted to integers (3.0 -> 3, \"3\")\n            self.assertEqual(len(data2.domain.attributes[0].values[0]), 1)\n            self.assertEqual(len(data2[0].metas[0]), 1)\n            # discrete integer values should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][2].value), data2[0][1])\n            # discrete round floats should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][6].value), data2[0][5])\n\n    def test_domaineditor_continuous_to_string(self):\n        # GH 2744\n        dat = \"\"\"V0\\nc\\n\\n1.0\\nnan\\n3.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertSequenceEqual(data.metas.ravel().tolist(), ['1', '', '3'])\n\n    def test_domaineditor_makes_variables(self):\n        # Variables created with domain editor should be interchangeable\n        # with variables read from file.\n\n        dat = \"\"\"V0\\tV1\\nc\\td\\n\\n1.0\\t2\"\"\"\n        v0 = StringVariable.make(\"V0\")\n        v1 = ContinuousVariable.make(\"V1\")\n\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertEqual(data.domain[\"V0\"], v0)\n            self.assertEqual(data.domain[\"V1\"], v1)\n\n    def test_url_no_scheme(self):\n        mock_urlreader = Mock(side_effect=ValueError())\n        url = 'foo.bar/xxx.csv'\n\n        with patch('Orange.widgets.data.owfile.UrlReader', mock_urlreader):\n            self.widget.url_combo.insertItem(0, url)\n            self.widget.url_combo.activated.emit(0)\n\n        mock_urlreader.assert_called_once_with('http://' + url)\n\n    def test_adds_origin(self):\n        self.open_dataset(\"origin1/images\")\n        data1 = self.get_output(self.widget.Outputs.data)\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n        self.open_dataset(\"origin2/images\")\n        data2 = self.get_output(self.widget.Outputs.data)\n        attrs = data2.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin2\", attrs[\"origin\"])\n\n        # Make sure that variable in data1 still contains correct origin\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_open_moved_workflow(self):\n        \"\"\"Test opening workflow that has been moved to another location\n        (i.e. sent by email), considering data file is stored in the same\n        directory as the workflow.\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n            self.assertEqual(w.file_combo.count(), 1)\n            self.assertFalse(w.Error.file_not_found.is_shown())\n        finally:\n            remove(file_name)\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_files_relocated(self):\n        \"\"\"\n        This test testes if paths are relocated correctly\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n\n            # relocation is called already\n            # if it works correctly relative path should be same than base name\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n\n            w.workflowEnvChanged(\"basedir\", base_name, base_name)\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n        finally:\n            remove(file_name)\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.itemText(0), \"Sheet1\")\n        self.assertEqual(combo.itemText(1), \"my_sheet\")\n        self.assertEqual(combo.itemText(2), \"Sheet3\")\n        self.assertEqual(combo.currentIndex(), 1)\n\n        widget.reader.sheet = \"no such sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.currentIndex(), 0)\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_another_thread(self):\n        def read():\n            thread = Thread(\n                target=lambda: warnings.warn(\"warning from another thread\")\n            )\n            thread.start()\n            thread.join()\n            return Table(TITANIC_PATH)\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        # Warning must be caught by unit tests, but not the widget\n        with self.assertWarns(UserWarning):\n            self.widget._try_load()\n            self.assertFalse(self.widget.Warning.load_warning.is_shown())\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n\n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        self.widget._try_load()\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n        self.assertIn(WARNING_MSG, str(self.widget.Warning.load_warning))\n\n\nclass TestOWFileDropHandler(unittest.TestCase):\n    def test_canDropUrl(self):\n        handler = OWFileDropHandler()\n        self.assertTrue(handler.canDropUrl(QUrl(\"https://example.com/test.tab\")))\n        self.assertTrue(handler.canDropUrl(QUrl.fromLocalFile(\"test.tab\")))\n\n    def test_parametersFromUrl(self):\n        handler = OWFileDropHandler()\n        r = handler.parametersFromUrl(QUrl(\"https://example.com/test.tab\"))\n        self.assertEqual(r[\"source\"], OWFile.URL)\n        self.assertEqual(r[\"recent_urls\"], [\"https://example.com/test.tab\"])\n        r = handler.parametersFromUrl(QUrl.fromLocalFile(\"test.tab\"))\n        self.assertEqual(r[\"source\"], OWFile.LOCAL_FILE)\n        self.assertEqual(r[\"recent_paths\"][0].basename, \"test.tab\")\n\n        defs = {\n            \"source\": OWFile.LOCAL_FILE,\n            \"recent_paths\": [\n                RecentPath(\"/foo.tab\", None,  None, \"foo.tab\"),\n                RecentPath(path.abspath(\"test.tab\"), None, None, \"test.tab\"),\n            ]\n        }\n        with patch.object(OWFile.settingsHandler, \"defaults\", defs):\n            r = handler.parametersFromUrl(QUrl.fromLocalFile(\"test.tab\"))\n\n        self.assertEqual(len(r[\"recent_paths\"]), 2)\n        self.assertEqual(r[\"recent_paths\"][0].basename, \"test.tab\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,protected-access\nfrom os import path, remove, getcwd\nfrom os.path import dirname\nimport unittest\nfrom threading import Thread\nfrom unittest.mock import Mock, patch\nimport pickle\nimport tempfile\nimport warnings\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import QMimeData, QPoint, Qt, QUrl, QPointF\nfrom AnyQt.QtGui import QDragEnterEvent, QDropEvent\nfrom AnyQt.QtTest import QTest\nfrom AnyQt.QtWidgets import QComboBox\n\nimport Orange\n\nfrom Orange.data import FileFormat, dataset_dirs, StringVariable, Table, \\\n    Domain, DiscreteVariable, ContinuousVariable\nfrom Orange.util import OrangeDeprecationWarning\n\nfrom Orange.data.io import TabReader\nfrom Orange.tests import named_file\nfrom Orange.widgets.data.owfile import OWFile, OWFileDropHandler, DEFAULT_READER_TEXT\nfrom Orange.widgets.utils.filedialogs import dialog_formats, format_filter, RecentPath\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.domaineditor import ComboDelegate, VarTypeDelegate, VarTableModel\n\nTITANIC_PATH = path.join(path.dirname(Orange.__file__), 'datasets', 'titanic.tab')\norig_path_exists = path.exists\n\n\nclass FailedSheetsFormat(FileFormat):\n    EXTENSIONS = ('.failed_sheet',)\n    DESCRIPTION = \"Make a sheet function that fails\"\n\n    def read(self):\n        pass\n\n    def sheets(self):\n        raise Exception(\"Not working\")\n\n\nclass WithWarnings(FileFormat):\n    EXTENSIONS = ('.with_warning',)\n    DESCRIPTION = \"Warning\"\n\n    @staticmethod\n    def read():\n        warnings.warn(\"Some warning\")\n        return Orange.data.Table(\"iris\")\n\n\nclass MyCustomTabReader(FileFormat):\n    EXTENSIONS = ('.tab',)\n    DESCRIPTION = \"Always return iris\"\n    PRIORITY = 999999\n\n    @staticmethod\n    def read():\n        return Orange.data.Table(\"iris\")\n\n\nclass TestOWFile(WidgetTest):\n    # Attribute used to store event data so it does not get garbage\n    # collected before event is processed.\n    event_data = None\n\n    def setUp(self):\n        self.widget = self.create_widget(OWFile)  # type: OWFile\n        dataset_dirs.append(dirname(__file__))\n\n    def tearDown(self):\n        dataset_dirs.pop()\n\n    def test_describe_call_get_nans(self):\n        table = Table(\"iris\")\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_called()\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_not_called()\n\n    def test_dragEnterEvent_accepts_urls(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dragEnterEvent(event)\n        self.assertTrue(event.isAccepted())\n\n    def test_dragEnterEvent_skips_osx_file_references(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('/.file/id=12345'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def test_dragEnterEvent_skips_usupported_files(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('file.unsupported'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def _drag_enter_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n        return QDragEnterEvent(\n            QPoint(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier)\n\n    def test_dropEvent_selects_file(self):\n        self.widget.load_data = Mock()\n        self.widget.source = OWFile.URL\n\n        event = self._drop_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dropEvent(event)\n\n        self.assertEqual(self.widget.source, OWFile.LOCAL_FILE)\n        self.assertTrue(path.samefile(self.widget.last_path(), TITANIC_PATH))\n        self.widget.load_data.assert_called_with()\n\n    def _drop_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n\n        return QDropEvent(\n            QPointF(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier, QDropEvent.Drop)\n\n    def test_check_file_size(self):\n        self.assertFalse(self.widget.Warning.file_too_big.is_shown())\n        self.widget.SIZE_LIMIT = 4000\n        self.widget.__init__()\n        self.assertTrue(self.widget.Warning.file_too_big.is_shown())\n\n    def test_domain_changes_are_stored(self):\n        assert isinstance(self.widget, OWFile)\n\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n        self.open_dataset(\"zoo\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(data.name, \"zoo\")\n\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n    def test_rename_duplicates(self):\n        self.open_dataset(\"iris\")\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n        self.widget.domain_editor.model().setData(idx, \"iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"iris (1)\", data.domain)\n        self.assertIn(\"iris (2)\", data.domain)\n        self.assertTrue(self.widget.Warning.renamed_vars.is_shown())\n\n        self.widget.domain_editor.model().setData(idx, \"different iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n\n    def test_variable_name_change(self):\n        \"\"\"\n        Test whether the name of the variable is changed correctly by\n        the domaineditor.\n        \"\"\"\n        self.open_dataset(\"iris\")\n\n        # just rename\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"a\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"a\", data.domain)\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.widget.domain_editor.model().setData(idx, \"d\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"d\", data.domain)\n\n        # rename and change to text\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"b\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"b\", data.domain)\n        self.assertIsInstance(data.domain[\"b\"], StringVariable)\n\n        # rename and change to discrete\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(\n            idx, \"categorical\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], DiscreteVariable)\n\n        # rename and change to continuous\n        self.open_dataset(\"zoo\")\n        idx = self.widget.domain_editor.model().createIndex(0, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(0, 1)\n        self.widget.domain_editor.model().setData(idx, \"numeric\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], ContinuousVariable)\n\n    def open_dataset(self, name):\n        filename = FileFormat.locate(name, dataset_dirs)\n        self.widget.add_path(filename)\n        self.widget.load_data()\n\n    def test_no_last_path(self):\n        self.widget =\\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n        # Doesn't crash and contains a single item, (none).\n        self.assertEqual(self.widget.file_combo.count(), 1)\n\n    def test_file_not_found(self):\n        # Create a dummy file\n        file_name = \"test_owfile_data.tab\"\n        domainA = Domain([DiscreteVariable(\"d1\", values=(\"a\", \"b\"))],\n                         DiscreteVariable(\"c1\", values=(\"aaa\", \"bbb\")))\n        dataA = Table(domainA, np.array([[0], [1], [0], [np.nan]]),\n                      np.array([0, 1, 0, 1]))\n        dataA.save(file_name)\n\n        # Open the file with the widget\n        self.open_dataset(file_name)\n        self.assertEqual(self.get_output(self.widget.Outputs.data).domain, dataA.domain)\n\n        # Delete the file and try to reload it\n        remove(file_name)\n        self.widget.load_data()\n        self.assertEqual(file_name, path.basename(self.widget.last_path()))\n        self.assertTrue(self.widget.Error.file_not_found.is_shown())\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n        self.assertEqual(self.widget.infolabel.text(), \"No data.\")\n\n        # Open a sample dataset\n        self.open_dataset(\"iris\")\n        self.assertFalse(self.widget.Error.file_not_found.is_shown())\n\n    def test_nothing_selected(self):\n        # pylint: disable=protected-access\n        widget = self.widget = \\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n\n        widget.Outputs.data.send = Mock()\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n        widget.Outputs.data.send.reset_mock()\n        widget.source = widget.URL\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n    def test_check_column_noname(self):\n        \"\"\"\n        Column name cannot be changed to an empty string or a string with whitespaces.\n        GH-2039\n        \"\"\"\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(1, 0)\n        temp = self.widget.domain_editor.model().data(idx, Qt.DisplayRole)\n        self.widget.domain_editor.model().setData(idx, \"   \", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n        self.widget.domain_editor.model().setData(idx, \"\", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n\n    def test_invalid_role_mode(self):\n        self.open_dataset(\"iris\")\n        model = self.widget.domain_editor.model()\n        idx = model.createIndex(1, 0)\n        self.assertFalse(model.setData(idx, Qt.StatusTipRole, \"\"))\n        self.assertIsNone(model.data(idx, Qt.StatusTipRole))\n\n    def test_context_match_includes_variable_values(self):\n        file1 = \"\"\"\\\nvar\na b\n\na\n\"\"\"\n        file2 = \"\"\"\\\nvar\na b c\n\na\n\"\"\"\n        editor = self.widget.domain_editor\n        idx = self.widget.domain_editor.model().createIndex(0, 3)\n\n        with named_file(file1, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b\")\n\n        with named_file(file2, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b, c\")\n\n    def test_check_datetime_disabled(self):\n        \"\"\"\n        Datetime option is disable if numerical is disabled as well.\n        GH-2050 (code fixes)\n        GH-2120\n        \"\"\"\n        dat = \"\"\"\\\n            01.08.16\\t42.15\\tneumann\\t2017-02-20\n            03.08.16\\t16.08\\tneumann\\t2017-02-21\n            04.08.16\\t23.04\\tneumann\\t2017-02-22\n            03.09.16\\t48.84\\tturing\\t2017-02-23\n            02.02.17\\t23.16\\tturing\\t2017-02-24\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            domain_editor = self.widget.domain_editor\n            idx = lambda x: self.widget.domain_editor.model().createIndex(x, 1)\n\n            qcombobox = QComboBox()\n            combo = ComboDelegate(domain_editor,\n                                  VarTableModel.typenames).createEditor(qcombobox, None, idx(2))\n            vartype_delegate = VarTypeDelegate(domain_editor, VarTableModel.typenames)\n\n            vartype_delegate.setEditorData(combo, idx(2))\n            counts = [4, 2, 4, 2]\n            for i in range(4):\n                vartype_delegate.setEditorData(combo, idx(i))\n                self.assertEqual(combo.count(), counts[i])\n\n    def test_reader_custom_tab(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            qname = MyCustomTabReader.qualified_name()\n            reader = RecentPath(fn, None, None, file_format=qname)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [reader]})\n            self.widget.load_data()\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n        outdata = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(len(outdata), 150)  # loaded iris\n\n    def test_no_reader_extension(self):\n        with named_file(\"\", suffix=\".xyz_unknown\") as fn:\n            no_reader = RecentPath(fn, None, None)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_reader]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n\n    def test_fail_sheets(self):\n        with named_file(\"\", suffix=\".failed_sheet\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Error.sheet_error.is_shown())\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n\n    def test_fail(self):\n        with named_file(\"name\\nc\\n\\nstring\", suffix=\".tab\") as fn, \\\n                patch(\"Orange.widgets.data.owfile.log.exception\") as log:\n            self.open_dataset(fn)\n            log.assert_called()\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n\n    def test_read_format(self):\n        iris = Table(\"iris\")\n\n        def open_iris_with_no_spec_format(_a, _b, _c, filters, _e):\n            return iris.__file__, filters.split(\";;\")[0]\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_no_spec_format):\n            self.widget.browse_file()\n\n        self.assertIsNone(self.widget.recent_paths[0].file_format)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n\n        def open_iris_with_tab(*_):\n            return iris.__file__, format_filter(TabReader)\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_tab):\n            self.widget.browse_file()\n\n        self.assertEqual(self.widget.recent_paths[0].file_format, \"Orange.data.io.TabReader\")\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n\n    def test_no_specified_reader(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            no_class = RecentPath(fn, None, None, file_format=\"not.a.file.reader.class\")\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_class]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n\n    def test_select_reader(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        # a setting which adds a new qualified name to the reader combo\n        no_class = RecentPath(filename, None, None, file_format=\"not.a.file.reader.class\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        len_with_qname = len(self.widget.reader_combo)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the last option, the same reader\n        self.widget.reader_combo.activated.emit(len_with_qname - 1)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the tab reader\n        for i in range(len_with_qname):\n            text = self.widget.reader_combo.itemText(i)\n            if text.startswith(\"Tab-separated\"):\n                break\n        self.widget.reader_combo.activated.emit(i)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n        # select the default reader\n        self.widget.reader_combo.activated.emit(0)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n    def test_select_reader_errors(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        no_class = RecentPath(filename, None, None, file_format=\"Orange.data.io.ExcelReader\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        self.assertIn(\"Excel\", self.widget.reader_combo.currentText())\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n\n    def test_domain_edit_no_changes(self):\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        # When no changes have been made in the domain editor,\n        # output data should be the same object (and not recreated)\n        self.assertTrue(data is self.widget.data)\n\n    def test_domain_edit_on_sparse_data(self):\n        iris = Table(\"iris\").to_sparse()\n\n        with named_file(\"\", suffix='.pickle') as fn:\n            with open(fn, \"wb\") as f:\n                pickle.dump(iris, f)\n\n            self.widget.add_path(fn)\n            self.widget.load_data()\n\n        output = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(output, Table)\n        self.assertEqual(iris.X.shape, output.X.shape)\n        self.assertTrue(sp.issparse(output.X))\n\n    def test_drop_data_when_everything_skipped(self):\n        \"\"\"\n        No data when everything is skipped. Otherwise Select Rows crashes.\n        GH-2237\n        \"\"\"\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertTrue(len(data), 150)\n        self.assertTrue(len(data.domain.variables), 5)\n        for i in range(5):\n            idx = self.widget.domain_editor.model().createIndex(i, 2)\n            self.widget.domain_editor.model().setData(idx, \"skip\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsNone(data)\n\n    def test_call_deprecated_dialog_formats(self):\n        with self.assertWarns(OrangeDeprecationWarning):\n            self.assertIn(\"Tab\", dialog_formats())\n\n    def test_add_new_format(self):\n        # test adding file formats after registering the widget\n        called = False\n        with named_file(\"\", suffix=\".tab\") as filename:\n            def test_format(_sd, _sf, ff, **_):\n                nonlocal called\n                called = True\n                self.assertIn(FailedSheetsFormat, ff)\n                return filename, TabReader, \"\"\n            with patch(\"Orange.widgets.data.owfile.open_filename_dialog\", test_format):\n                self.widget.browse_file()\n        self.assertTrue(called)\n\n    def test_domain_editor_conversions(self):\n        dat = \"\"\"V0\\tV1\\tV2\\tV3\\tV4\\tV5\\tV6\n                 c\\tc\\td\\td\\tc\\td\\td\n                  \\t \\t \\t \\t \\t \\t\n                 3.0\\t1.0\\t4\\ta\\t0.0\\tx\\t1.0\n                 1.0\\t2.0\\t4\\tb\\t0.0\\ty\\t2.0\n                 2.0\\t1.0\\t7\\ta\\t0.0\\ty\\t2.0\n                 0.0\\t2.0\\t7\\ta\\t0.0\\tz\\t2.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            data1 = self.get_output(self.widget.Outputs.data)\n            model = self.widget.domain_editor.model()\n            # check the ordering of attributes\n            for i, a in enumerate(data1.domain.attributes):\n                self.assertEqual(str(a), model.data(model.createIndex(i, 0), Qt.DisplayRole))\n            # make conversions\n            model.setData(model.createIndex(0, 1), \"categorical\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(2, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(3, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(6, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n            data2 = self.get_output(self.widget.Outputs.data)\n            # round continuous values should be converted to integers (3.0 -> 3, \"3\")\n            self.assertEqual(len(data2.domain.attributes[0].values[0]), 1)\n            self.assertEqual(len(data2[0].metas[0]), 1)\n            # discrete integer values should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][2].value), data2[0][1])\n            # discrete round floats should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][6].value), data2[0][5])\n\n    def test_domaineditor_continuous_to_string(self):\n        # GH 2744\n        dat = \"\"\"V0\\nc\\n\\n1.0\\nnan\\n3.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertSequenceEqual(data.metas.ravel().tolist(), ['1', '', '3'])\n\n    def test_domaineditor_makes_variables(self):\n        # Variables created with domain editor should be interchangeable\n        # with variables read from file.\n\n        dat = \"\"\"V0\\tV1\\nc\\td\\n\\n1.0\\t2\"\"\"\n        v0 = StringVariable.make(\"V0\")\n        v1 = ContinuousVariable.make(\"V1\")\n\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertEqual(data.domain[\"V0\"], v0)\n            self.assertEqual(data.domain[\"V1\"], v1)\n\n    def test_url_no_scheme(self):\n        mock_urlreader = Mock(side_effect=ValueError())\n        url = 'foo.bar/xxx.csv'\n\n        with patch('Orange.widgets.data.owfile.UrlReader', mock_urlreader):\n            self.widget.url_combo.insertItem(0, url)\n            self.widget.url_combo.activated.emit(0)\n\n        mock_urlreader.assert_called_once_with('http://' + url)\n\n    def test_adds_origin(self):\n        self.open_dataset(\"origin1/images\")\n        data1 = self.get_output(self.widget.Outputs.data)\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n        self.open_dataset(\"origin2/images\")\n        data2 = self.get_output(self.widget.Outputs.data)\n        attrs = data2.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin2\", attrs[\"origin\"])\n\n        # Make sure that variable in data1 still contains correct origin\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_open_moved_workflow(self):\n        \"\"\"Test opening workflow that has been moved to another location\n        (i.e. sent by email), considering data file is stored in the same\n        directory as the workflow.\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n            self.assertEqual(w.file_combo.count(), 1)\n            self.assertFalse(w.Error.file_not_found.is_shown())\n        finally:\n            remove(file_name)\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_files_relocated(self):\n        \"\"\"\n        This test testes if paths are relocated correctly\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n\n            # relocation is called already\n            # if it works correctly relative path should be same than base name\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n\n            w.workflowEnvChanged(\"basedir\", base_name, base_name)\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n        finally:\n            remove(file_name)\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.itemText(0), \"Sheet1\")\n        self.assertEqual(combo.itemText(1), \"my_sheet\")\n        self.assertEqual(combo.itemText(2), \"Sheet3\")\n        self.assertEqual(combo.currentIndex(), 1)\n\n        widget.reader.sheet = \"no such sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.currentIndex(), 0)\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_another_thread(self):\n        def read():\n            thread = Thread(\n                target=lambda: warnings.warn(\"warning from another thread\")\n            )\n            thread.start()\n            thread.join()\n            return Table(TITANIC_PATH)\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        # Warning must be caught by unit tests, but not the widget\n        with self.assertWarns(UserWarning):\n            self.widget._try_load()\n            self.assertFalse(self.widget.Warning.load_warning.is_shown())\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n\n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        self.widget._try_load()\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n        self.assertIn(WARNING_MSG, str(self.widget.Warning.load_warning))\n\n    def test_recent_url_serialization(self):\n        with patch.object(self.widget, \"load_data\", lambda: None):\n            self.widget.url_combo.insertItem(0, \"https://example.com/test.tab\")\n            self.widget.url_combo.insertItem(1, \"https://example.com/test1.tab\")\n            self.widget.source = OWFile.URL\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test.tab\",\n                              \"https://example.com/test1.tab\"])\n            self.widget.url_combo.lineEdit().clear()\n            QTest.keyClicks(self.widget.url_combo, \"https://example.com/test1.tab\")\n            QTest.keyClick(self.widget.url_combo, Qt.Key_Enter)\n            # must move the entered url to first position\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test1.tab\",\n                              \"https://example.com/test.tab\"])\n\n\nclass TestOWFileDropHandler(unittest.TestCase):\n    def test_canDropUrl(self):\n        handler = OWFileDropHandler()\n        self.assertTrue(handler.canDropUrl(QUrl(\"https://example.com/test.tab\")))\n        self.assertTrue(handler.canDropUrl(QUrl.fromLocalFile(\"test.tab\")))\n\n    def test_parametersFromUrl(self):\n        handler = OWFileDropHandler()\n        r = handler.parametersFromUrl(QUrl(\"https://example.com/test.tab\"))\n        self.assertEqual(r[\"source\"], OWFile.URL)\n        self.assertEqual(r[\"recent_urls\"], [\"https://example.com/test.tab\"])\n        r = handler.parametersFromUrl(QUrl.fromLocalFile(\"test.tab\"))\n        self.assertEqual(r[\"source\"], OWFile.LOCAL_FILE)\n        self.assertEqual(r[\"recent_paths\"][0].basename, \"test.tab\")\n\n        defs = {\n            \"source\": OWFile.LOCAL_FILE,\n            \"recent_paths\": [\n                RecentPath(\"/foo.tab\", None,  None, \"foo.tab\"),\n                RecentPath(path.abspath(\"test.tab\"), None, None, \"test.tab\"),\n            ]\n        }\n        with patch.object(OWFile.settingsHandler, \"defaults\", defs):\n            r = handler.parametersFromUrl(QUrl.fromLocalFile(\"test.tab\"))\n\n        self.assertEqual(len(r[\"recent_paths\"]), 2)\n        self.assertEqual(r[\"recent_paths\"][0].basename, \"test.tab\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/tests/test_owfile.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "264723c7c",
                "new_commit_hash": "1426c44d1",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/tests/test_owfile.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/tests/test_owfile.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 14,
                            "length": 6
                        },
                        "new_range": {
                            "start": 14,
                            "length": 7
                        },
                        "section": "import scipy.sparse as sp"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from AnyQt.QtCore import QMimeData, QPoint, Qt, QUrl, QPointF",
                                "type": "context"
                            },
                            {
                                "content": "from AnyQt.QtGui import QDragEnterEvent, QDropEvent",
                                "type": "context"
                            },
                            {
                                "content": "from AnyQt.QtTest import QTest",
                                "type": "added"
                            },
                            {
                                "content": "from AnyQt.QtWidgets import QComboBox",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import Orange",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owfile.py",
                            "type": "statement",
                            "name": "",
                            "content": "from AnyQt.QtTest import QTest",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 17,
                            "end_lineno": 17,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 713,
                            "length": 6
                        },
                        "new_range": {
                            "start": 714,
                            "length": 24
                        },
                        "section": "a"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.assertTrue(self.widget.Warning.load_warning.is_shown())",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertIn(WARNING_MSG, str(self.widget.Warning.load_warning))",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_recent_url_serialization(self):",
                                "type": "added"
                            },
                            {
                                "content": "        with patch.object(self.widget, \"load_data\", lambda: None):",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.url_combo.insertItem(0, \"https://example.com/test.tab\")",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.url_combo.insertItem(1, \"https://example.com/test1.tab\")",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.source = OWFile.URL",
                                "type": "added"
                            },
                            {
                                "content": "            s = self.widget.settingsHandler.pack_data(self.widget)",
                                "type": "added"
                            },
                            {
                                "content": "            self.assertEqual(s[\"recent_urls\"],",
                                "type": "added"
                            },
                            {
                                "content": "                             [\"https://example.com/test.tab\",",
                                "type": "added"
                            },
                            {
                                "content": "                              \"https://example.com/test1.tab\"])",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.url_combo.lineEdit().clear()",
                                "type": "added"
                            },
                            {
                                "content": "            QTest.keyClicks(self.widget.url_combo, \"https://example.com/test1.tab\")",
                                "type": "added"
                            },
                            {
                                "content": "            QTest.keyClick(self.widget.url_combo, Qt.Key_Enter)",
                                "type": "added"
                            },
                            {
                                "content": "            # must move the entered url to first position",
                                "type": "added"
                            },
                            {
                                "content": "            s = self.widget.settingsHandler.pack_data(self.widget)",
                                "type": "added"
                            },
                            {
                                "content": "            self.assertEqual(s[\"recent_urls\"],",
                                "type": "added"
                            },
                            {
                                "content": "                             [\"https://example.com/test1.tab\",",
                                "type": "added"
                            },
                            {
                                "content": "                              \"https://example.com/test.tab\"])",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class TestOWFileDropHandler(unittest.TestCase):",
                                "type": "context"
                            },
                            {
                                "content": "    def test_canDropUrl(self):",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owfile.py",
                            "type": "class",
                            "name": "TestOWFile",
                            "content": "class TestOWFile(WidgetTest):\n    # Attribute used to store event data so it does not get garbage\n    # collected before event is processed.\n    event_data = None\n\n    def setUp(self):\n        self.widget = self.create_widget(OWFile)  # type: OWFile\n        dataset_dirs.append(dirname(__file__))\n\n    def tearDown(self):\n        dataset_dirs.pop()\n\n    def test_describe_call_get_nans(self):\n        table = Table(\"iris\")\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_called()\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_not_called()\n\n    def test_dragEnterEvent_accepts_urls(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dragEnterEvent(event)\n        self.assertTrue(event.isAccepted())\n\n    def test_dragEnterEvent_skips_osx_file_references(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('/.file/id=12345'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def test_dragEnterEvent_skips_usupported_files(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('file.unsupported'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def _drag_enter_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n        return QDragEnterEvent(\n            QPoint(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier)\n\n    def test_dropEvent_selects_file(self):\n        self.widget.load_data = Mock()\n        self.widget.source = OWFile.URL\n\n        event = self._drop_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dropEvent(event)\n\n        self.assertEqual(self.widget.source, OWFile.LOCAL_FILE)\n        self.assertTrue(path.samefile(self.widget.last_path(), TITANIC_PATH))\n        self.widget.load_data.assert_called_with()\n\n    def _drop_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n\n        return QDropEvent(\n            QPointF(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier, QDropEvent.Drop)\n\n    def test_check_file_size(self):\n        self.assertFalse(self.widget.Warning.file_too_big.is_shown())\n        self.widget.SIZE_LIMIT = 4000\n        self.widget.__init__()\n        self.assertTrue(self.widget.Warning.file_too_big.is_shown())\n\n    def test_domain_changes_are_stored(self):\n        assert isinstance(self.widget, OWFile)\n\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n        self.open_dataset(\"zoo\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(data.name, \"zoo\")\n\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n    def test_rename_duplicates(self):\n        self.open_dataset(\"iris\")\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n        self.widget.domain_editor.model().setData(idx, \"iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"iris (1)\", data.domain)\n        self.assertIn(\"iris (2)\", data.domain)\n        self.assertTrue(self.widget.Warning.renamed_vars.is_shown())\n\n        self.widget.domain_editor.model().setData(idx, \"different iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n\n    def test_variable_name_change(self):\n        \"\"\"\n        Test whether the name of the variable is changed correctly by\n        the domaineditor.\n        \"\"\"\n        self.open_dataset(\"iris\")\n\n        # just rename\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"a\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"a\", data.domain)\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.widget.domain_editor.model().setData(idx, \"d\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"d\", data.domain)\n\n        # rename and change to text\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"b\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"b\", data.domain)\n        self.assertIsInstance(data.domain[\"b\"], StringVariable)\n\n        # rename and change to discrete\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(\n            idx, \"categorical\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], DiscreteVariable)\n\n        # rename and change to continuous\n        self.open_dataset(\"zoo\")\n        idx = self.widget.domain_editor.model().createIndex(0, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(0, 1)\n        self.widget.domain_editor.model().setData(idx, \"numeric\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], ContinuousVariable)\n\n    def open_dataset(self, name):\n        filename = FileFormat.locate(name, dataset_dirs)\n        self.widget.add_path(filename)\n        self.widget.load_data()\n\n    def test_no_last_path(self):\n        self.widget =\\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n        # Doesn't crash and contains a single item, (none).\n        self.assertEqual(self.widget.file_combo.count(), 1)\n\n    def test_file_not_found(self):\n        # Create a dummy file\n        file_name = \"test_owfile_data.tab\"\n        domainA = Domain([DiscreteVariable(\"d1\", values=(\"a\", \"b\"))],\n                         DiscreteVariable(\"c1\", values=(\"aaa\", \"bbb\")))\n        dataA = Table(domainA, np.array([[0], [1], [0], [np.nan]]),\n                      np.array([0, 1, 0, 1]))\n        dataA.save(file_name)\n\n        # Open the file with the widget\n        self.open_dataset(file_name)\n        self.assertEqual(self.get_output(self.widget.Outputs.data).domain, dataA.domain)\n\n        # Delete the file and try to reload it\n        remove(file_name)\n        self.widget.load_data()\n        self.assertEqual(file_name, path.basename(self.widget.last_path()))\n        self.assertTrue(self.widget.Error.file_not_found.is_shown())\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n        self.assertEqual(self.widget.infolabel.text(), \"No data.\")\n\n        # Open a sample dataset\n        self.open_dataset(\"iris\")\n        self.assertFalse(self.widget.Error.file_not_found.is_shown())\n\n    def test_nothing_selected(self):\n        # pylint: disable=protected-access\n        widget = self.widget = \\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n\n        widget.Outputs.data.send = Mock()\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n        widget.Outputs.data.send.reset_mock()\n        widget.source = widget.URL\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n    def test_check_column_noname(self):\n        \"\"\"\n        Column name cannot be changed to an empty string or a string with whitespaces.\n        GH-2039\n        \"\"\"\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(1, 0)\n        temp = self.widget.domain_editor.model().data(idx, Qt.DisplayRole)\n        self.widget.domain_editor.model().setData(idx, \"   \", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n        self.widget.domain_editor.model().setData(idx, \"\", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n\n    def test_invalid_role_mode(self):\n        self.open_dataset(\"iris\")\n        model = self.widget.domain_editor.model()\n        idx = model.createIndex(1, 0)\n        self.assertFalse(model.setData(idx, Qt.StatusTipRole, \"\"))\n        self.assertIsNone(model.data(idx, Qt.StatusTipRole))\n\n    def test_context_match_includes_variable_values(self):\n        file1 = \"\"\"\\\nvar\na b\n\na\n\"\"\"\n        file2 = \"\"\"\\\nvar\na b c\n\na\n\"\"\"\n        editor = self.widget.domain_editor\n        idx = self.widget.domain_editor.model().createIndex(0, 3)\n\n        with named_file(file1, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b\")\n\n        with named_file(file2, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b, c\")\n\n    def test_check_datetime_disabled(self):\n        \"\"\"\n        Datetime option is disable if numerical is disabled as well.\n        GH-2050 (code fixes)\n        GH-2120\n        \"\"\"\n        dat = \"\"\"\\\n            01.08.16\\t42.15\\tneumann\\t2017-02-20\n            03.08.16\\t16.08\\tneumann\\t2017-02-21\n            04.08.16\\t23.04\\tneumann\\t2017-02-22\n            03.09.16\\t48.84\\tturing\\t2017-02-23\n            02.02.17\\t23.16\\tturing\\t2017-02-24\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            domain_editor = self.widget.domain_editor\n            idx = lambda x: self.widget.domain_editor.model().createIndex(x, 1)\n\n            qcombobox = QComboBox()\n            combo = ComboDelegate(domain_editor,\n                                  VarTableModel.typenames).createEditor(qcombobox, None, idx(2))\n            vartype_delegate = VarTypeDelegate(domain_editor, VarTableModel.typenames)\n\n            vartype_delegate.setEditorData(combo, idx(2))\n            counts = [4, 2, 4, 2]\n            for i in range(4):\n                vartype_delegate.setEditorData(combo, idx(i))\n                self.assertEqual(combo.count(), counts[i])\n\n    def test_reader_custom_tab(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            qname = MyCustomTabReader.qualified_name()\n            reader = RecentPath(fn, None, None, file_format=qname)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [reader]})\n            self.widget.load_data()\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n        outdata = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(len(outdata), 150)  # loaded iris\n\n    def test_no_reader_extension(self):\n        with named_file(\"\", suffix=\".xyz_unknown\") as fn:\n            no_reader = RecentPath(fn, None, None)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_reader]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n\n    def test_fail_sheets(self):\n        with named_file(\"\", suffix=\".failed_sheet\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Error.sheet_error.is_shown())\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n\n    def test_fail(self):\n        with named_file(\"name\\nc\\n\\nstring\", suffix=\".tab\") as fn, \\\n                patch(\"Orange.widgets.data.owfile.log.exception\") as log:\n            self.open_dataset(fn)\n            log.assert_called()\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n\n    def test_read_format(self):\n        iris = Table(\"iris\")\n\n        def open_iris_with_no_spec_format(_a, _b, _c, filters, _e):\n            return iris.__file__, filters.split(\";;\")[0]\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_no_spec_format):\n            self.widget.browse_file()\n\n        self.assertIsNone(self.widget.recent_paths[0].file_format)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n\n        def open_iris_with_tab(*_):\n            return iris.__file__, format_filter(TabReader)\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_tab):\n            self.widget.browse_file()\n\n        self.assertEqual(self.widget.recent_paths[0].file_format, \"Orange.data.io.TabReader\")\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n\n    def test_no_specified_reader(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            no_class = RecentPath(fn, None, None, file_format=\"not.a.file.reader.class\")\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_class]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n\n    def test_select_reader(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        # a setting which adds a new qualified name to the reader combo\n        no_class = RecentPath(filename, None, None, file_format=\"not.a.file.reader.class\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        len_with_qname = len(self.widget.reader_combo)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the last option, the same reader\n        self.widget.reader_combo.activated.emit(len_with_qname - 1)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the tab reader\n        for i in range(len_with_qname):\n            text = self.widget.reader_combo.itemText(i)\n            if text.startswith(\"Tab-separated\"):\n                break\n        self.widget.reader_combo.activated.emit(i)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n        # select the default reader\n        self.widget.reader_combo.activated.emit(0)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n    def test_select_reader_errors(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        no_class = RecentPath(filename, None, None, file_format=\"Orange.data.io.ExcelReader\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        self.assertIn(\"Excel\", self.widget.reader_combo.currentText())\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n\n    def test_domain_edit_no_changes(self):\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        # When no changes have been made in the domain editor,\n        # output data should be the same object (and not recreated)\n        self.assertTrue(data is self.widget.data)\n\n    def test_domain_edit_on_sparse_data(self):\n        iris = Table(\"iris\").to_sparse()\n\n        with named_file(\"\", suffix='.pickle') as fn:\n            with open(fn, \"wb\") as f:\n                pickle.dump(iris, f)\n\n            self.widget.add_path(fn)\n            self.widget.load_data()\n\n        output = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(output, Table)\n        self.assertEqual(iris.X.shape, output.X.shape)\n        self.assertTrue(sp.issparse(output.X))\n\n    def test_drop_data_when_everything_skipped(self):\n        \"\"\"\n        No data when everything is skipped. Otherwise Select Rows crashes.\n        GH-2237\n        \"\"\"\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertTrue(len(data), 150)\n        self.assertTrue(len(data.domain.variables), 5)\n        for i in range(5):\n            idx = self.widget.domain_editor.model().createIndex(i, 2)\n            self.widget.domain_editor.model().setData(idx, \"skip\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsNone(data)\n\n    def test_call_deprecated_dialog_formats(self):\n        with self.assertWarns(OrangeDeprecationWarning):\n            self.assertIn(\"Tab\", dialog_formats())\n\n    def test_add_new_format(self):\n        # test adding file formats after registering the widget\n        called = False\n        with named_file(\"\", suffix=\".tab\") as filename:\n            def test_format(_sd, _sf, ff, **_):\n                nonlocal called\n                called = True\n                self.assertIn(FailedSheetsFormat, ff)\n                return filename, TabReader, \"\"\n            with patch(\"Orange.widgets.data.owfile.open_filename_dialog\", test_format):\n                self.widget.browse_file()\n        self.assertTrue(called)\n\n    def test_domain_editor_conversions(self):\n        dat = \"\"\"V0\\tV1\\tV2\\tV3\\tV4\\tV5\\tV6\n                 c\\tc\\td\\td\\tc\\td\\td\n                  \\t \\t \\t \\t \\t \\t\n                 3.0\\t1.0\\t4\\ta\\t0.0\\tx\\t1.0\n                 1.0\\t2.0\\t4\\tb\\t0.0\\ty\\t2.0\n                 2.0\\t1.0\\t7\\ta\\t0.0\\ty\\t2.0\n                 0.0\\t2.0\\t7\\ta\\t0.0\\tz\\t2.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            data1 = self.get_output(self.widget.Outputs.data)\n            model = self.widget.domain_editor.model()\n            # check the ordering of attributes\n            for i, a in enumerate(data1.domain.attributes):\n                self.assertEqual(str(a), model.data(model.createIndex(i, 0), Qt.DisplayRole))\n            # make conversions\n            model.setData(model.createIndex(0, 1), \"categorical\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(2, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(3, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(6, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n            data2 = self.get_output(self.widget.Outputs.data)\n            # round continuous values should be converted to integers (3.0 -> 3, \"3\")\n            self.assertEqual(len(data2.domain.attributes[0].values[0]), 1)\n            self.assertEqual(len(data2[0].metas[0]), 1)\n            # discrete integer values should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][2].value), data2[0][1])\n            # discrete round floats should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][6].value), data2[0][5])\n\n    def test_domaineditor_continuous_to_string(self):\n        # GH 2744\n        dat = \"\"\"V0\\nc\\n\\n1.0\\nnan\\n3.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertSequenceEqual(data.metas.ravel().tolist(), ['1', '', '3'])\n\n    def test_domaineditor_makes_variables(self):\n        # Variables created with domain editor should be interchangeable\n        # with variables read from file.\n\n        dat = \"\"\"V0\\tV1\\nc\\td\\n\\n1.0\\t2\"\"\"\n        v0 = StringVariable.make(\"V0\")\n        v1 = ContinuousVariable.make(\"V1\")\n\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertEqual(data.domain[\"V0\"], v0)\n            self.assertEqual(data.domain[\"V1\"], v1)\n\n    def test_url_no_scheme(self):\n        mock_urlreader = Mock(side_effect=ValueError())\n        url = 'foo.bar/xxx.csv'\n\n        with patch('Orange.widgets.data.owfile.UrlReader', mock_urlreader):\n            self.widget.url_combo.insertItem(0, url)\n            self.widget.url_combo.activated.emit(0)\n\n        mock_urlreader.assert_called_once_with('http://' + url)\n\n    def test_adds_origin(self):\n        self.open_dataset(\"origin1/images\")\n        data1 = self.get_output(self.widget.Outputs.data)\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n        self.open_dataset(\"origin2/images\")\n        data2 = self.get_output(self.widget.Outputs.data)\n        attrs = data2.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin2\", attrs[\"origin\"])\n\n        # Make sure that variable in data1 still contains correct origin\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_open_moved_workflow(self):\n        \"\"\"Test opening workflow that has been moved to another location\n        (i.e. sent by email), considering data file is stored in the same\n        directory as the workflow.\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n            self.assertEqual(w.file_combo.count(), 1)\n            self.assertFalse(w.Error.file_not_found.is_shown())\n        finally:\n            remove(file_name)\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_files_relocated(self):\n        \"\"\"\n        This test testes if paths are relocated correctly\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n\n            # relocation is called already\n            # if it works correctly relative path should be same than base name\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n\n            w.workflowEnvChanged(\"basedir\", base_name, base_name)\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n        finally:\n            remove(file_name)\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.itemText(0), \"Sheet1\")\n        self.assertEqual(combo.itemText(1), \"my_sheet\")\n        self.assertEqual(combo.itemText(2), \"Sheet3\")\n        self.assertEqual(combo.currentIndex(), 1)\n\n        widget.reader.sheet = \"no such sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.currentIndex(), 0)\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_another_thread(self):\n        def read():\n            thread = Thread(\n                target=lambda: warnings.warn(\"warning from another thread\")\n            )\n            thread.start()\n            thread.join()\n            return Table(TITANIC_PATH)\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        # Warning must be caught by unit tests, but not the widget\n        with self.assertWarns(UserWarning):\n            self.widget._try_load()\n            self.assertFalse(self.widget.Warning.load_warning.is_shown())\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n\n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        self.widget._try_load()\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n        self.assertIn(WARNING_MSG, str(self.widget.Warning.load_warning))\n\n    def test_recent_url_serialization(self):\n        with patch.object(self.widget, \"load_data\", lambda: None):\n            self.widget.url_combo.insertItem(0, \"https://example.com/test.tab\")\n            self.widget.url_combo.insertItem(1, \"https://example.com/test1.tab\")\n            self.widget.source = OWFile.URL\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test.tab\",\n                              \"https://example.com/test1.tab\"])\n            self.widget.url_combo.lineEdit().clear()\n            QTest.keyClicks(self.widget.url_combo, \"https://example.com/test1.tab\")\n            QTest.keyClick(self.widget.url_combo, Qt.Key_Enter)\n            # must move the entered url to first position\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test1.tab\",\n                              \"https://example.com/test.tab\"])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 68,
                            "end_lineno": 733,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owfile.py",
                            "type": "method",
                            "name": "TestOWFile.test_recent_url_serialization",
                            "content": "class TestOWFile(WidgetTest):\n    # Attribute used to store event data so it does not get garbage\n    # collected before event is processed.\n    event_data = None\n\n    def setUp(self):\n        self.widget = self.create_widget(OWFile)  # type: OWFile\n        dataset_dirs.append(dirname(__file__))\n\n    def tearDown(self):\n        dataset_dirs.pop()\n\n    def test_describe_call_get_nans(self):\n        table = Table(\"iris\")\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_called()\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_not_called()\n\n    def test_dragEnterEvent_accepts_urls(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dragEnterEvent(event)\n        self.assertTrue(event.isAccepted())\n\n    def test_dragEnterEvent_skips_osx_file_references(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('/.file/id=12345'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def test_dragEnterEvent_skips_usupported_files(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('file.unsupported'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def _drag_enter_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n        return QDragEnterEvent(\n            QPoint(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier)\n\n    def test_dropEvent_selects_file(self):\n        self.widget.load_data = Mock()\n        self.widget.source = OWFile.URL\n\n        event = self._drop_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dropEvent(event)\n\n        self.assertEqual(self.widget.source, OWFile.LOCAL_FILE)\n        self.assertTrue(path.samefile(self.widget.last_path(), TITANIC_PATH))\n        self.widget.load_data.assert_called_with()\n\n    def _drop_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n\n        return QDropEvent(\n            QPointF(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier, QDropEvent.Drop)\n\n    def test_check_file_size(self):\n        self.assertFalse(self.widget.Warning.file_too_big.is_shown())\n        self.widget.SIZE_LIMIT = 4000\n        self.widget.__init__()\n        self.assertTrue(self.widget.Warning.file_too_big.is_shown())\n\n    def test_domain_changes_are_stored(self):\n        assert isinstance(self.widget, OWFile)\n\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n        self.open_dataset(\"zoo\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(data.name, \"zoo\")\n\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n    def test_rename_duplicates(self):\n        self.open_dataset(\"iris\")\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n        self.widget.domain_editor.model().setData(idx, \"iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"iris (1)\", data.domain)\n        self.assertIn(\"iris (2)\", data.domain)\n        self.assertTrue(self.widget.Warning.renamed_vars.is_shown())\n\n        self.widget.domain_editor.model().setData(idx, \"different iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n\n    def test_variable_name_change(self):\n        \"\"\"\n        Test whether the name of the variable is changed correctly by\n        the domaineditor.\n        \"\"\"\n        self.open_dataset(\"iris\")\n\n        # just rename\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"a\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"a\", data.domain)\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.widget.domain_editor.model().setData(idx, \"d\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"d\", data.domain)\n\n        # rename and change to text\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"b\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"b\", data.domain)\n        self.assertIsInstance(data.domain[\"b\"], StringVariable)\n\n        # rename and change to discrete\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(\n            idx, \"categorical\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], DiscreteVariable)\n\n        # rename and change to continuous\n        self.open_dataset(\"zoo\")\n        idx = self.widget.domain_editor.model().createIndex(0, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(0, 1)\n        self.widget.domain_editor.model().setData(idx, \"numeric\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], ContinuousVariable)\n\n    def open_dataset(self, name):\n        filename = FileFormat.locate(name, dataset_dirs)\n        self.widget.add_path(filename)\n        self.widget.load_data()\n\n    def test_no_last_path(self):\n        self.widget =\\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n        # Doesn't crash and contains a single item, (none).\n        self.assertEqual(self.widget.file_combo.count(), 1)\n\n    def test_file_not_found(self):\n        # Create a dummy file\n        file_name = \"test_owfile_data.tab\"\n        domainA = Domain([DiscreteVariable(\"d1\", values=(\"a\", \"b\"))],\n                         DiscreteVariable(\"c1\", values=(\"aaa\", \"bbb\")))\n        dataA = Table(domainA, np.array([[0], [1], [0], [np.nan]]),\n                      np.array([0, 1, 0, 1]))\n        dataA.save(file_name)\n\n        # Open the file with the widget\n        self.open_dataset(file_name)\n        self.assertEqual(self.get_output(self.widget.Outputs.data).domain, dataA.domain)\n\n        # Delete the file and try to reload it\n        remove(file_name)\n        self.widget.load_data()\n        self.assertEqual(file_name, path.basename(self.widget.last_path()))\n        self.assertTrue(self.widget.Error.file_not_found.is_shown())\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n        self.assertEqual(self.widget.infolabel.text(), \"No data.\")\n\n        # Open a sample dataset\n        self.open_dataset(\"iris\")\n        self.assertFalse(self.widget.Error.file_not_found.is_shown())\n\n    def test_nothing_selected(self):\n        # pylint: disable=protected-access\n        widget = self.widget = \\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n\n        widget.Outputs.data.send = Mock()\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n        widget.Outputs.data.send.reset_mock()\n        widget.source = widget.URL\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n    def test_check_column_noname(self):\n        \"\"\"\n        Column name cannot be changed to an empty string or a string with whitespaces.\n        GH-2039\n        \"\"\"\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(1, 0)\n        temp = self.widget.domain_editor.model().data(idx, Qt.DisplayRole)\n        self.widget.domain_editor.model().setData(idx, \"   \", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n        self.widget.domain_editor.model().setData(idx, \"\", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n\n    def test_invalid_role_mode(self):\n        self.open_dataset(\"iris\")\n        model = self.widget.domain_editor.model()\n        idx = model.createIndex(1, 0)\n        self.assertFalse(model.setData(idx, Qt.StatusTipRole, \"\"))\n        self.assertIsNone(model.data(idx, Qt.StatusTipRole))\n\n    def test_context_match_includes_variable_values(self):\n        file1 = \"\"\"\\\nvar\na b\n\na\n\"\"\"\n        file2 = \"\"\"\\\nvar\na b c\n\na\n\"\"\"\n        editor = self.widget.domain_editor\n        idx = self.widget.domain_editor.model().createIndex(0, 3)\n\n        with named_file(file1, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b\")\n\n        with named_file(file2, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b, c\")\n\n    def test_check_datetime_disabled(self):\n        \"\"\"\n        Datetime option is disable if numerical is disabled as well.\n        GH-2050 (code fixes)\n        GH-2120\n        \"\"\"\n        dat = \"\"\"\\\n            01.08.16\\t42.15\\tneumann\\t2017-02-20\n            03.08.16\\t16.08\\tneumann\\t2017-02-21\n            04.08.16\\t23.04\\tneumann\\t2017-02-22\n            03.09.16\\t48.84\\tturing\\t2017-02-23\n            02.02.17\\t23.16\\tturing\\t2017-02-24\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            domain_editor = self.widget.domain_editor\n            idx = lambda x: self.widget.domain_editor.model().createIndex(x, 1)\n\n            qcombobox = QComboBox()\n            combo = ComboDelegate(domain_editor,\n                                  VarTableModel.typenames).createEditor(qcombobox, None, idx(2))\n            vartype_delegate = VarTypeDelegate(domain_editor, VarTableModel.typenames)\n\n            vartype_delegate.setEditorData(combo, idx(2))\n            counts = [4, 2, 4, 2]\n            for i in range(4):\n                vartype_delegate.setEditorData(combo, idx(i))\n                self.assertEqual(combo.count(), counts[i])\n\n    def test_reader_custom_tab(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            qname = MyCustomTabReader.qualified_name()\n            reader = RecentPath(fn, None, None, file_format=qname)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [reader]})\n            self.widget.load_data()\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n        outdata = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(len(outdata), 150)  # loaded iris\n\n    def test_no_reader_extension(self):\n        with named_file(\"\", suffix=\".xyz_unknown\") as fn:\n            no_reader = RecentPath(fn, None, None)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_reader]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n\n    def test_fail_sheets(self):\n        with named_file(\"\", suffix=\".failed_sheet\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Error.sheet_error.is_shown())\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n\n    def test_fail(self):\n        with named_file(\"name\\nc\\n\\nstring\", suffix=\".tab\") as fn, \\\n                patch(\"Orange.widgets.data.owfile.log.exception\") as log:\n            self.open_dataset(fn)\n            log.assert_called()\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n\n    def test_read_format(self):\n        iris = Table(\"iris\")\n\n        def open_iris_with_no_spec_format(_a, _b, _c, filters, _e):\n            return iris.__file__, filters.split(\";;\")[0]\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_no_spec_format):\n            self.widget.browse_file()\n\n        self.assertIsNone(self.widget.recent_paths[0].file_format)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n\n        def open_iris_with_tab(*_):\n            return iris.__file__, format_filter(TabReader)\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_tab):\n            self.widget.browse_file()\n\n        self.assertEqual(self.widget.recent_paths[0].file_format, \"Orange.data.io.TabReader\")\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n\n    def test_no_specified_reader(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            no_class = RecentPath(fn, None, None, file_format=\"not.a.file.reader.class\")\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_class]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n\n    def test_select_reader(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        # a setting which adds a new qualified name to the reader combo\n        no_class = RecentPath(filename, None, None, file_format=\"not.a.file.reader.class\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        len_with_qname = len(self.widget.reader_combo)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the last option, the same reader\n        self.widget.reader_combo.activated.emit(len_with_qname - 1)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the tab reader\n        for i in range(len_with_qname):\n            text = self.widget.reader_combo.itemText(i)\n            if text.startswith(\"Tab-separated\"):\n                break\n        self.widget.reader_combo.activated.emit(i)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n        # select the default reader\n        self.widget.reader_combo.activated.emit(0)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n    def test_select_reader_errors(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        no_class = RecentPath(filename, None, None, file_format=\"Orange.data.io.ExcelReader\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        self.assertIn(\"Excel\", self.widget.reader_combo.currentText())\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n\n    def test_domain_edit_no_changes(self):\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        # When no changes have been made in the domain editor,\n        # output data should be the same object (and not recreated)\n        self.assertTrue(data is self.widget.data)\n\n    def test_domain_edit_on_sparse_data(self):\n        iris = Table(\"iris\").to_sparse()\n\n        with named_file(\"\", suffix='.pickle') as fn:\n            with open(fn, \"wb\") as f:\n                pickle.dump(iris, f)\n\n            self.widget.add_path(fn)\n            self.widget.load_data()\n\n        output = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(output, Table)\n        self.assertEqual(iris.X.shape, output.X.shape)\n        self.assertTrue(sp.issparse(output.X))\n\n    def test_drop_data_when_everything_skipped(self):\n        \"\"\"\n        No data when everything is skipped. Otherwise Select Rows crashes.\n        GH-2237\n        \"\"\"\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertTrue(len(data), 150)\n        self.assertTrue(len(data.domain.variables), 5)\n        for i in range(5):\n            idx = self.widget.domain_editor.model().createIndex(i, 2)\n            self.widget.domain_editor.model().setData(idx, \"skip\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsNone(data)\n\n    def test_call_deprecated_dialog_formats(self):\n        with self.assertWarns(OrangeDeprecationWarning):\n            self.assertIn(\"Tab\", dialog_formats())\n\n    def test_add_new_format(self):\n        # test adding file formats after registering the widget\n        called = False\n        with named_file(\"\", suffix=\".tab\") as filename:\n            def test_format(_sd, _sf, ff, **_):\n                nonlocal called\n                called = True\n                self.assertIn(FailedSheetsFormat, ff)\n                return filename, TabReader, \"\"\n            with patch(\"Orange.widgets.data.owfile.open_filename_dialog\", test_format):\n                self.widget.browse_file()\n        self.assertTrue(called)\n\n    def test_domain_editor_conversions(self):\n        dat = \"\"\"V0\\tV1\\tV2\\tV3\\tV4\\tV5\\tV6\n                 c\\tc\\td\\td\\tc\\td\\td\n                  \\t \\t \\t \\t \\t \\t\n                 3.0\\t1.0\\t4\\ta\\t0.0\\tx\\t1.0\n                 1.0\\t2.0\\t4\\tb\\t0.0\\ty\\t2.0\n                 2.0\\t1.0\\t7\\ta\\t0.0\\ty\\t2.0\n                 0.0\\t2.0\\t7\\ta\\t0.0\\tz\\t2.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            data1 = self.get_output(self.widget.Outputs.data)\n            model = self.widget.domain_editor.model()\n            # check the ordering of attributes\n            for i, a in enumerate(data1.domain.attributes):\n                self.assertEqual(str(a), model.data(model.createIndex(i, 0), Qt.DisplayRole))\n            # make conversions\n            model.setData(model.createIndex(0, 1), \"categorical\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(2, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(3, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(6, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n            data2 = self.get_output(self.widget.Outputs.data)\n            # round continuous values should be converted to integers (3.0 -> 3, \"3\")\n            self.assertEqual(len(data2.domain.attributes[0].values[0]), 1)\n            self.assertEqual(len(data2[0].metas[0]), 1)\n            # discrete integer values should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][2].value), data2[0][1])\n            # discrete round floats should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][6].value), data2[0][5])\n\n    def test_domaineditor_continuous_to_string(self):\n        # GH 2744\n        dat = \"\"\"V0\\nc\\n\\n1.0\\nnan\\n3.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertSequenceEqual(data.metas.ravel().tolist(), ['1', '', '3'])\n\n    def test_domaineditor_makes_variables(self):\n        # Variables created with domain editor should be interchangeable\n        # with variables read from file.\n\n        dat = \"\"\"V0\\tV1\\nc\\td\\n\\n1.0\\t2\"\"\"\n        v0 = StringVariable.make(\"V0\")\n        v1 = ContinuousVariable.make(\"V1\")\n\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertEqual(data.domain[\"V0\"], v0)\n            self.assertEqual(data.domain[\"V1\"], v1)\n\n    def test_url_no_scheme(self):\n        mock_urlreader = Mock(side_effect=ValueError())\n        url = 'foo.bar/xxx.csv'\n\n        with patch('Orange.widgets.data.owfile.UrlReader', mock_urlreader):\n            self.widget.url_combo.insertItem(0, url)\n            self.widget.url_combo.activated.emit(0)\n\n        mock_urlreader.assert_called_once_with('http://' + url)\n\n    def test_adds_origin(self):\n        self.open_dataset(\"origin1/images\")\n        data1 = self.get_output(self.widget.Outputs.data)\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n        self.open_dataset(\"origin2/images\")\n        data2 = self.get_output(self.widget.Outputs.data)\n        attrs = data2.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin2\", attrs[\"origin\"])\n\n        # Make sure that variable in data1 still contains correct origin\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_open_moved_workflow(self):\n        \"\"\"Test opening workflow that has been moved to another location\n        (i.e. sent by email), considering data file is stored in the same\n        directory as the workflow.\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n            self.assertEqual(w.file_combo.count(), 1)\n            self.assertFalse(w.Error.file_not_found.is_shown())\n        finally:\n            remove(file_name)\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_files_relocated(self):\n        \"\"\"\n        This test testes if paths are relocated correctly\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n\n            # relocation is called already\n            # if it works correctly relative path should be same than base name\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n\n            w.workflowEnvChanged(\"basedir\", base_name, base_name)\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n        finally:\n            remove(file_name)\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.itemText(0), \"Sheet1\")\n        self.assertEqual(combo.itemText(1), \"my_sheet\")\n        self.assertEqual(combo.itemText(2), \"Sheet3\")\n        self.assertEqual(combo.currentIndex(), 1)\n\n        widget.reader.sheet = \"no such sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.currentIndex(), 0)\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_another_thread(self):\n        def read():\n            thread = Thread(\n                target=lambda: warnings.warn(\"warning from another thread\")\n            )\n            thread.start()\n            thread.join()\n            return Table(TITANIC_PATH)\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        # Warning must be caught by unit tests, but not the widget\n        with self.assertWarns(UserWarning):\n            self.widget._try_load()\n            self.assertFalse(self.widget.Warning.load_warning.is_shown())\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n\n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        self.widget._try_load()\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n        self.assertIn(WARNING_MSG, str(self.widget.Warning.load_warning))\n\n    def test_recent_url_serialization(self):\n        with patch.object(self.widget, \"load_data\", lambda: None):\n            self.widget.url_combo.insertItem(0, \"https://example.com/test.tab\")\n            self.widget.url_combo.insertItem(1, \"https://example.com/test1.tab\")\n            self.widget.source = OWFile.URL\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test.tab\",\n                              \"https://example.com/test1.tab\"])\n            self.widget.url_combo.lineEdit().clear()\n            QTest.keyClicks(self.widget.url_combo, \"https://example.com/test1.tab\")\n            QTest.keyClick(self.widget.url_combo, Qt.Key_Enter)\n            # must move the entered url to first position\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test1.tab\",\n                              \"https://example.com/test.tab\"])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 717,
                            "end_lineno": 733,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owfile.py",
                                "type": "class",
                                "name": "TestOWFile",
                                "content": "class TestOWFile(WidgetTest):\n    # Attribute used to store event data so it does not get garbage\n    # collected before event is processed.\n    event_data = None\n\n    def setUp(self):\n        self.widget = self.create_widget(OWFile)  # type: OWFile\n        dataset_dirs.append(dirname(__file__))\n\n    def tearDown(self):\n        dataset_dirs.pop()\n\n    def test_describe_call_get_nans(self):\n        table = Table(\"iris\")\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_called()\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_not_called()\n\n    def test_dragEnterEvent_accepts_urls(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dragEnterEvent(event)\n        self.assertTrue(event.isAccepted())\n\n    def test_dragEnterEvent_skips_osx_file_references(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('/.file/id=12345'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def test_dragEnterEvent_skips_usupported_files(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('file.unsupported'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def _drag_enter_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n        return QDragEnterEvent(\n            QPoint(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier)\n\n    def test_dropEvent_selects_file(self):\n        self.widget.load_data = Mock()\n        self.widget.source = OWFile.URL\n\n        event = self._drop_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dropEvent(event)\n\n        self.assertEqual(self.widget.source, OWFile.LOCAL_FILE)\n        self.assertTrue(path.samefile(self.widget.last_path(), TITANIC_PATH))\n        self.widget.load_data.assert_called_with()\n\n    def _drop_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n\n        return QDropEvent(\n            QPointF(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier, QDropEvent.Drop)\n\n    def test_check_file_size(self):\n        self.assertFalse(self.widget.Warning.file_too_big.is_shown())\n        self.widget.SIZE_LIMIT = 4000\n        self.widget.__init__()\n        self.assertTrue(self.widget.Warning.file_too_big.is_shown())\n\n    def test_domain_changes_are_stored(self):\n        assert isinstance(self.widget, OWFile)\n\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n        self.open_dataset(\"zoo\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(data.name, \"zoo\")\n\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n    def test_rename_duplicates(self):\n        self.open_dataset(\"iris\")\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n        self.widget.domain_editor.model().setData(idx, \"iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"iris (1)\", data.domain)\n        self.assertIn(\"iris (2)\", data.domain)\n        self.assertTrue(self.widget.Warning.renamed_vars.is_shown())\n\n        self.widget.domain_editor.model().setData(idx, \"different iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n\n    def test_variable_name_change(self):\n        \"\"\"\n        Test whether the name of the variable is changed correctly by\n        the domaineditor.\n        \"\"\"\n        self.open_dataset(\"iris\")\n\n        # just rename\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"a\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"a\", data.domain)\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.widget.domain_editor.model().setData(idx, \"d\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"d\", data.domain)\n\n        # rename and change to text\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"b\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"b\", data.domain)\n        self.assertIsInstance(data.domain[\"b\"], StringVariable)\n\n        # rename and change to discrete\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(\n            idx, \"categorical\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], DiscreteVariable)\n\n        # rename and change to continuous\n        self.open_dataset(\"zoo\")\n        idx = self.widget.domain_editor.model().createIndex(0, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(0, 1)\n        self.widget.domain_editor.model().setData(idx, \"numeric\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], ContinuousVariable)\n\n    def open_dataset(self, name):\n        filename = FileFormat.locate(name, dataset_dirs)\n        self.widget.add_path(filename)\n        self.widget.load_data()\n\n    def test_no_last_path(self):\n        self.widget =\\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n        # Doesn't crash and contains a single item, (none).\n        self.assertEqual(self.widget.file_combo.count(), 1)\n\n    def test_file_not_found(self):\n        # Create a dummy file\n        file_name = \"test_owfile_data.tab\"\n        domainA = Domain([DiscreteVariable(\"d1\", values=(\"a\", \"b\"))],\n                         DiscreteVariable(\"c1\", values=(\"aaa\", \"bbb\")))\n        dataA = Table(domainA, np.array([[0], [1], [0], [np.nan]]),\n                      np.array([0, 1, 0, 1]))\n        dataA.save(file_name)\n\n        # Open the file with the widget\n        self.open_dataset(file_name)\n        self.assertEqual(self.get_output(self.widget.Outputs.data).domain, dataA.domain)\n\n        # Delete the file and try to reload it\n        remove(file_name)\n        self.widget.load_data()\n        self.assertEqual(file_name, path.basename(self.widget.last_path()))\n        self.assertTrue(self.widget.Error.file_not_found.is_shown())\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n        self.assertEqual(self.widget.infolabel.text(), \"No data.\")\n\n        # Open a sample dataset\n        self.open_dataset(\"iris\")\n        self.assertFalse(self.widget.Error.file_not_found.is_shown())\n\n    def test_nothing_selected(self):\n        # pylint: disable=protected-access\n        widget = self.widget = \\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n\n        widget.Outputs.data.send = Mock()\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n        widget.Outputs.data.send.reset_mock()\n        widget.source = widget.URL\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n    def test_check_column_noname(self):\n        \"\"\"\n        Column name cannot be changed to an empty string or a string with whitespaces.\n        GH-2039\n        \"\"\"\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(1, 0)\n        temp = self.widget.domain_editor.model().data(idx, Qt.DisplayRole)\n        self.widget.domain_editor.model().setData(idx, \"   \", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n        self.widget.domain_editor.model().setData(idx, \"\", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n\n    def test_invalid_role_mode(self):\n        self.open_dataset(\"iris\")\n        model = self.widget.domain_editor.model()\n        idx = model.createIndex(1, 0)\n        self.assertFalse(model.setData(idx, Qt.StatusTipRole, \"\"))\n        self.assertIsNone(model.data(idx, Qt.StatusTipRole))\n\n    def test_context_match_includes_variable_values(self):\n        file1 = \"\"\"\\\nvar\na b\n\na\n\"\"\"\n        file2 = \"\"\"\\\nvar\na b c\n\na\n\"\"\"\n        editor = self.widget.domain_editor\n        idx = self.widget.domain_editor.model().createIndex(0, 3)\n\n        with named_file(file1, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b\")\n\n        with named_file(file2, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b, c\")\n\n    def test_check_datetime_disabled(self):\n        \"\"\"\n        Datetime option is disable if numerical is disabled as well.\n        GH-2050 (code fixes)\n        GH-2120\n        \"\"\"\n        dat = \"\"\"\\\n            01.08.16\\t42.15\\tneumann\\t2017-02-20\n            03.08.16\\t16.08\\tneumann\\t2017-02-21\n            04.08.16\\t23.04\\tneumann\\t2017-02-22\n            03.09.16\\t48.84\\tturing\\t2017-02-23\n            02.02.17\\t23.16\\tturing\\t2017-02-24\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            domain_editor = self.widget.domain_editor\n            idx = lambda x: self.widget.domain_editor.model().createIndex(x, 1)\n\n            qcombobox = QComboBox()\n            combo = ComboDelegate(domain_editor,\n                                  VarTableModel.typenames).createEditor(qcombobox, None, idx(2))\n            vartype_delegate = VarTypeDelegate(domain_editor, VarTableModel.typenames)\n\n            vartype_delegate.setEditorData(combo, idx(2))\n            counts = [4, 2, 4, 2]\n            for i in range(4):\n                vartype_delegate.setEditorData(combo, idx(i))\n                self.assertEqual(combo.count(), counts[i])\n\n    def test_reader_custom_tab(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            qname = MyCustomTabReader.qualified_name()\n            reader = RecentPath(fn, None, None, file_format=qname)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [reader]})\n            self.widget.load_data()\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n        outdata = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(len(outdata), 150)  # loaded iris\n\n    def test_no_reader_extension(self):\n        with named_file(\"\", suffix=\".xyz_unknown\") as fn:\n            no_reader = RecentPath(fn, None, None)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_reader]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n\n    def test_fail_sheets(self):\n        with named_file(\"\", suffix=\".failed_sheet\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Error.sheet_error.is_shown())\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n\n    def test_fail(self):\n        with named_file(\"name\\nc\\n\\nstring\", suffix=\".tab\") as fn, \\\n                patch(\"Orange.widgets.data.owfile.log.exception\") as log:\n            self.open_dataset(fn)\n            log.assert_called()\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n\n    def test_read_format(self):\n        iris = Table(\"iris\")\n\n        def open_iris_with_no_spec_format(_a, _b, _c, filters, _e):\n            return iris.__file__, filters.split(\";;\")[0]\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_no_spec_format):\n            self.widget.browse_file()\n\n        self.assertIsNone(self.widget.recent_paths[0].file_format)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n\n        def open_iris_with_tab(*_):\n            return iris.__file__, format_filter(TabReader)\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_tab):\n            self.widget.browse_file()\n\n        self.assertEqual(self.widget.recent_paths[0].file_format, \"Orange.data.io.TabReader\")\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n\n    def test_no_specified_reader(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            no_class = RecentPath(fn, None, None, file_format=\"not.a.file.reader.class\")\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_class]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n\n    def test_select_reader(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        # a setting which adds a new qualified name to the reader combo\n        no_class = RecentPath(filename, None, None, file_format=\"not.a.file.reader.class\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        len_with_qname = len(self.widget.reader_combo)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the last option, the same reader\n        self.widget.reader_combo.activated.emit(len_with_qname - 1)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the tab reader\n        for i in range(len_with_qname):\n            text = self.widget.reader_combo.itemText(i)\n            if text.startswith(\"Tab-separated\"):\n                break\n        self.widget.reader_combo.activated.emit(i)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n        # select the default reader\n        self.widget.reader_combo.activated.emit(0)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n    def test_select_reader_errors(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        no_class = RecentPath(filename, None, None, file_format=\"Orange.data.io.ExcelReader\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        self.assertIn(\"Excel\", self.widget.reader_combo.currentText())\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n\n    def test_domain_edit_no_changes(self):\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        # When no changes have been made in the domain editor,\n        # output data should be the same object (and not recreated)\n        self.assertTrue(data is self.widget.data)\n\n    def test_domain_edit_on_sparse_data(self):\n        iris = Table(\"iris\").to_sparse()\n\n        with named_file(\"\", suffix='.pickle') as fn:\n            with open(fn, \"wb\") as f:\n                pickle.dump(iris, f)\n\n            self.widget.add_path(fn)\n            self.widget.load_data()\n\n        output = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(output, Table)\n        self.assertEqual(iris.X.shape, output.X.shape)\n        self.assertTrue(sp.issparse(output.X))\n\n    def test_drop_data_when_everything_skipped(self):\n        \"\"\"\n        No data when everything is skipped. Otherwise Select Rows crashes.\n        GH-2237\n        \"\"\"\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertTrue(len(data), 150)\n        self.assertTrue(len(data.domain.variables), 5)\n        for i in range(5):\n            idx = self.widget.domain_editor.model().createIndex(i, 2)\n            self.widget.domain_editor.model().setData(idx, \"skip\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsNone(data)\n\n    def test_call_deprecated_dialog_formats(self):\n        with self.assertWarns(OrangeDeprecationWarning):\n            self.assertIn(\"Tab\", dialog_formats())\n\n    def test_add_new_format(self):\n        # test adding file formats after registering the widget\n        called = False\n        with named_file(\"\", suffix=\".tab\") as filename:\n            def test_format(_sd, _sf, ff, **_):\n                nonlocal called\n                called = True\n                self.assertIn(FailedSheetsFormat, ff)\n                return filename, TabReader, \"\"\n            with patch(\"Orange.widgets.data.owfile.open_filename_dialog\", test_format):\n                self.widget.browse_file()\n        self.assertTrue(called)\n\n    def test_domain_editor_conversions(self):\n        dat = \"\"\"V0\\tV1\\tV2\\tV3\\tV4\\tV5\\tV6\n                 c\\tc\\td\\td\\tc\\td\\td\n                  \\t \\t \\t \\t \\t \\t\n                 3.0\\t1.0\\t4\\ta\\t0.0\\tx\\t1.0\n                 1.0\\t2.0\\t4\\tb\\t0.0\\ty\\t2.0\n                 2.0\\t1.0\\t7\\ta\\t0.0\\ty\\t2.0\n                 0.0\\t2.0\\t7\\ta\\t0.0\\tz\\t2.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            data1 = self.get_output(self.widget.Outputs.data)\n            model = self.widget.domain_editor.model()\n            # check the ordering of attributes\n            for i, a in enumerate(data1.domain.attributes):\n                self.assertEqual(str(a), model.data(model.createIndex(i, 0), Qt.DisplayRole))\n            # make conversions\n            model.setData(model.createIndex(0, 1), \"categorical\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(2, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(3, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(6, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n            data2 = self.get_output(self.widget.Outputs.data)\n            # round continuous values should be converted to integers (3.0 -> 3, \"3\")\n            self.assertEqual(len(data2.domain.attributes[0].values[0]), 1)\n            self.assertEqual(len(data2[0].metas[0]), 1)\n            # discrete integer values should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][2].value), data2[0][1])\n            # discrete round floats should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][6].value), data2[0][5])\n\n    def test_domaineditor_continuous_to_string(self):\n        # GH 2744\n        dat = \"\"\"V0\\nc\\n\\n1.0\\nnan\\n3.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertSequenceEqual(data.metas.ravel().tolist(), ['1', '', '3'])\n\n    def test_domaineditor_makes_variables(self):\n        # Variables created with domain editor should be interchangeable\n        # with variables read from file.\n\n        dat = \"\"\"V0\\tV1\\nc\\td\\n\\n1.0\\t2\"\"\"\n        v0 = StringVariable.make(\"V0\")\n        v1 = ContinuousVariable.make(\"V1\")\n\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertEqual(data.domain[\"V0\"], v0)\n            self.assertEqual(data.domain[\"V1\"], v1)\n\n    def test_url_no_scheme(self):\n        mock_urlreader = Mock(side_effect=ValueError())\n        url = 'foo.bar/xxx.csv'\n\n        with patch('Orange.widgets.data.owfile.UrlReader', mock_urlreader):\n            self.widget.url_combo.insertItem(0, url)\n            self.widget.url_combo.activated.emit(0)\n\n        mock_urlreader.assert_called_once_with('http://' + url)\n\n    def test_adds_origin(self):\n        self.open_dataset(\"origin1/images\")\n        data1 = self.get_output(self.widget.Outputs.data)\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n        self.open_dataset(\"origin2/images\")\n        data2 = self.get_output(self.widget.Outputs.data)\n        attrs = data2.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin2\", attrs[\"origin\"])\n\n        # Make sure that variable in data1 still contains correct origin\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_open_moved_workflow(self):\n        \"\"\"Test opening workflow that has been moved to another location\n        (i.e. sent by email), considering data file is stored in the same\n        directory as the workflow.\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n            self.assertEqual(w.file_combo.count(), 1)\n            self.assertFalse(w.Error.file_not_found.is_shown())\n        finally:\n            remove(file_name)\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_files_relocated(self):\n        \"\"\"\n        This test testes if paths are relocated correctly\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n\n            # relocation is called already\n            # if it works correctly relative path should be same than base name\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n\n            w.workflowEnvChanged(\"basedir\", base_name, base_name)\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n        finally:\n            remove(file_name)\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.itemText(0), \"Sheet1\")\n        self.assertEqual(combo.itemText(1), \"my_sheet\")\n        self.assertEqual(combo.itemText(2), \"Sheet3\")\n        self.assertEqual(combo.currentIndex(), 1)\n\n        widget.reader.sheet = \"no such sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.currentIndex(), 0)\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_another_thread(self):\n        def read():\n            thread = Thread(\n                target=lambda: warnings.warn(\"warning from another thread\")\n            )\n            thread.start()\n            thread.join()\n            return Table(TITANIC_PATH)\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        # Warning must be caught by unit tests, but not the widget\n        with self.assertWarns(UserWarning):\n            self.widget._try_load()\n            self.assertFalse(self.widget.Warning.load_warning.is_shown())\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n\n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        self.widget._try_load()\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n        self.assertIn(WARNING_MSG, str(self.widget.Warning.load_warning))\n\n    def test_recent_url_serialization(self):\n        with patch.object(self.widget, \"load_data\", lambda: None):\n            self.widget.url_combo.insertItem(0, \"https://example.com/test.tab\")\n            self.widget.url_combo.insertItem(1, \"https://example.com/test1.tab\")\n            self.widget.source = OWFile.URL\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test.tab\",\n                              \"https://example.com/test1.tab\"])\n            self.widget.url_combo.lineEdit().clear()\n            QTest.keyClicks(self.widget.url_combo, \"https://example.com/test1.tab\")\n            QTest.keyClick(self.widget.url_combo, Qt.Key_Enter)\n            # must move the entered url to first position\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test1.tab\",\n                              \"https://example.com/test.tab\"])",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 68,
                                "end_lineno": 733,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "5357f43a3929e36919b4279c4b5156967fa4d300^",
    "new_commit_hash": "5357f43a3929e36919b4279c4b5156967fa4d300",
    "commit_message": "owfile: Fix saving recent urls",
    "commit_date": "2022-12-20T13:36:30+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "5357f43a3929e36919b4279c4b5156967fa4d300",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,protected-access\nfrom os import path, remove, getcwd\nfrom os.path import dirname\nimport unittest\nfrom threading import Thread\nfrom unittest.mock import Mock, patch\nimport pickle\nimport tempfile\nimport warnings\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import QMimeData, QPoint, Qt, QUrl, QPointF\nfrom AnyQt.QtGui import QDragEnterEvent, QDropEvent\nfrom AnyQt.QtTest import QTest\nfrom AnyQt.QtWidgets import QComboBox\n\nimport Orange\n\nfrom Orange.data import FileFormat, dataset_dirs, StringVariable, Table, \\\n    Domain, DiscreteVariable, ContinuousVariable\nfrom Orange.util import OrangeDeprecationWarning\n\nfrom Orange.data.io import TabReader\nfrom Orange.tests import named_file\nfrom Orange.widgets.data.owfile import OWFile, OWFileDropHandler, DEFAULT_READER_TEXT\nfrom Orange.widgets.utils.filedialogs import dialog_formats, format_filter, RecentPath\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.domaineditor import ComboDelegate, VarTypeDelegate, VarTableModel\n\nTITANIC_PATH = path.join(path.dirname(Orange.__file__), 'datasets', 'titanic.tab')\norig_path_exists = path.exists\n\n\nclass FailedSheetsFormat(FileFormat):\n    EXTENSIONS = ('.failed_sheet',)\n    DESCRIPTION = \"Make a sheet function that fails\"\n\n    def read(self):\n        pass\n\n    def sheets(self):\n        raise Exception(\"Not working\")\n\n\nclass WithWarnings(FileFormat):\n    EXTENSIONS = ('.with_warning',)\n    DESCRIPTION = \"Warning\"\n\n    @staticmethod\n    def read():\n        warnings.warn(\"Some warning\")\n        return Orange.data.Table(\"iris\")\n\n\nclass MyCustomTabReader(FileFormat):\n    EXTENSIONS = ('.tab',)\n    DESCRIPTION = \"Always return iris\"\n    PRIORITY = 999999\n\n    @staticmethod\n    def read():\n        return Orange.data.Table(\"iris\")\n\n\nclass TestOWFile(WidgetTest):\n    # Attribute used to store event data so it does not get garbage\n    # collected before event is processed.\n    event_data = None\n\n    def setUp(self):\n        self.widget = self.create_widget(OWFile)  # type: OWFile\n        dataset_dirs.append(dirname(__file__))\n\n    def tearDown(self):\n        dataset_dirs.pop()\n\n    def test_describe_call_get_nans(self):\n        table = Table(\"iris\")\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_called()\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        with patch.object(Table, \"get_nan_frequency_attribute\", return_value=0.) as mock:\n            self.widget._describe(table)\n            mock.assert_not_called()\n\n    def test_dragEnterEvent_accepts_urls(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dragEnterEvent(event)\n        self.assertTrue(event.isAccepted())\n\n    def test_dragEnterEvent_skips_osx_file_references(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('/.file/id=12345'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def test_dragEnterEvent_skips_usupported_files(self):\n        event = self._drag_enter_event(QUrl.fromLocalFile('file.unsupported'))\n        self.widget.dragEnterEvent(event)\n        self.assertFalse(event.isAccepted())\n\n    def _drag_enter_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n        return QDragEnterEvent(\n            QPoint(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier)\n\n    def test_dropEvent_selects_file(self):\n        self.widget.load_data = Mock()\n        self.widget.source = OWFile.URL\n\n        event = self._drop_event(QUrl.fromLocalFile(TITANIC_PATH))\n        self.widget.dropEvent(event)\n\n        self.assertEqual(self.widget.source, OWFile.LOCAL_FILE)\n        self.assertTrue(path.samefile(self.widget.last_path(), TITANIC_PATH))\n        self.widget.load_data.assert_called_with()\n\n    def _drop_event(self, url):\n        # make sure data does not get garbage collected before it used\n        self.event_data = data = QMimeData()\n        data.setUrls([QUrl(url)])\n\n        return QDropEvent(\n            QPointF(0, 0), Qt.MoveAction, data,\n            Qt.NoButton, Qt.NoModifier, QDropEvent.Drop)\n\n    def test_check_file_size(self):\n        self.assertFalse(self.widget.Warning.file_too_big.is_shown())\n        self.widget.SIZE_LIMIT = 4000\n        self.widget.__init__()\n        self.assertTrue(self.widget.Warning.file_too_big.is_shown())\n\n    def test_domain_changes_are_stored(self):\n        assert isinstance(self.widget, OWFile)\n\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n        self.open_dataset(\"zoo\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(data.name, \"zoo\")\n\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(data.domain[\"iris\"], StringVariable)\n\n    def test_rename_duplicates(self):\n        self.open_dataset(\"iris\")\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n        self.widget.domain_editor.model().setData(idx, \"iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"iris (1)\", data.domain)\n        self.assertIn(\"iris (2)\", data.domain)\n        self.assertTrue(self.widget.Warning.renamed_vars.is_shown())\n\n        self.widget.domain_editor.model().setData(idx, \"different iris\", Qt.EditRole)\n        self.widget.apply_button.click()\n        self.assertFalse(self.widget.Warning.renamed_vars.is_shown())\n\n    def test_variable_name_change(self):\n        \"\"\"\n        Test whether the name of the variable is changed correctly by\n        the domaineditor.\n        \"\"\"\n        self.open_dataset(\"iris\")\n\n        # just rename\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"a\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"a\", data.domain)\n\n        idx = self.widget.domain_editor.model().createIndex(3, 0)\n        self.widget.domain_editor.model().setData(idx, \"d\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"d\", data.domain)\n\n        # rename and change to text\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"b\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(idx, \"text\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"b\", data.domain)\n        self.assertIsInstance(data.domain[\"b\"], StringVariable)\n\n        # rename and change to discrete\n        idx = self.widget.domain_editor.model().createIndex(4, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(4, 1)\n        self.widget.domain_editor.model().setData(\n            idx, \"categorical\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], DiscreteVariable)\n\n        # rename and change to continuous\n        self.open_dataset(\"zoo\")\n        idx = self.widget.domain_editor.model().createIndex(0, 0)\n        self.widget.domain_editor.model().setData(idx, \"c\", Qt.EditRole)\n        idx = self.widget.domain_editor.model().createIndex(0, 1)\n        self.widget.domain_editor.model().setData(idx, \"numeric\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIn(\"c\", data.domain)\n        self.assertIsInstance(data.domain[\"c\"], ContinuousVariable)\n\n    def open_dataset(self, name):\n        filename = FileFormat.locate(name, dataset_dirs)\n        self.widget.add_path(filename)\n        self.widget.load_data()\n\n    def test_no_last_path(self):\n        self.widget =\\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n        # Doesn't crash and contains a single item, (none).\n        self.assertEqual(self.widget.file_combo.count(), 1)\n\n    def test_file_not_found(self):\n        # Create a dummy file\n        file_name = \"test_owfile_data.tab\"\n        domainA = Domain([DiscreteVariable(\"d1\", values=(\"a\", \"b\"))],\n                         DiscreteVariable(\"c1\", values=(\"aaa\", \"bbb\")))\n        dataA = Table(domainA, np.array([[0], [1], [0], [np.nan]]),\n                      np.array([0, 1, 0, 1]))\n        dataA.save(file_name)\n\n        # Open the file with the widget\n        self.open_dataset(file_name)\n        self.assertEqual(self.get_output(self.widget.Outputs.data).domain, dataA.domain)\n\n        # Delete the file and try to reload it\n        remove(file_name)\n        self.widget.load_data()\n        self.assertEqual(file_name, path.basename(self.widget.last_path()))\n        self.assertTrue(self.widget.Error.file_not_found.is_shown())\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n        self.assertEqual(self.widget.infolabel.text(), \"No data.\")\n\n        # Open a sample dataset\n        self.open_dataset(\"iris\")\n        self.assertFalse(self.widget.Error.file_not_found.is_shown())\n\n    def test_nothing_selected(self):\n        # pylint: disable=protected-access\n        widget = self.widget = \\\n            self.create_widget(OWFile, stored_settings={\"recent_paths\": []})\n\n        widget.Outputs.data.send = Mock()\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n        widget.Outputs.data.send.reset_mock()\n        widget.source = widget.URL\n        widget.load_data()\n        self.assertTrue(widget.Information.no_file_selected.is_shown())\n        widget.Outputs.data.send.assert_called_with(None)\n\n    def test_check_column_noname(self):\n        \"\"\"\n        Column name cannot be changed to an empty string or a string with whitespaces.\n        GH-2039\n        \"\"\"\n        self.open_dataset(\"iris\")\n        idx = self.widget.domain_editor.model().createIndex(1, 0)\n        temp = self.widget.domain_editor.model().data(idx, Qt.DisplayRole)\n        self.widget.domain_editor.model().setData(idx, \"   \", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n        self.widget.domain_editor.model().setData(idx, \"\", Qt.EditRole)\n        self.assertEqual(self.widget.domain_editor.model().data(idx, Qt.DisplayRole), temp)\n\n    def test_invalid_role_mode(self):\n        self.open_dataset(\"iris\")\n        model = self.widget.domain_editor.model()\n        idx = model.createIndex(1, 0)\n        self.assertFalse(model.setData(idx, Qt.StatusTipRole, \"\"))\n        self.assertIsNone(model.data(idx, Qt.StatusTipRole))\n\n    def test_context_match_includes_variable_values(self):\n        file1 = \"\"\"\\\nvar\na b\n\na\n\"\"\"\n        file2 = \"\"\"\\\nvar\na b c\n\na\n\"\"\"\n        editor = self.widget.domain_editor\n        idx = self.widget.domain_editor.model().createIndex(0, 3)\n\n        with named_file(file1, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b\")\n\n        with named_file(file2, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            self.assertEqual(editor.model().data(idx, Qt.DisplayRole), \"a, b, c\")\n\n    def test_check_datetime_disabled(self):\n        \"\"\"\n        Datetime option is disable if numerical is disabled as well.\n        GH-2050 (code fixes)\n        GH-2120\n        \"\"\"\n        dat = \"\"\"\\\n            01.08.16\\t42.15\\tneumann\\t2017-02-20\n            03.08.16\\t16.08\\tneumann\\t2017-02-21\n            04.08.16\\t23.04\\tneumann\\t2017-02-22\n            03.09.16\\t48.84\\tturing\\t2017-02-23\n            02.02.17\\t23.16\\tturing\\t2017-02-24\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            domain_editor = self.widget.domain_editor\n            idx = lambda x: self.widget.domain_editor.model().createIndex(x, 1)\n\n            qcombobox = QComboBox()\n            combo = ComboDelegate(domain_editor,\n                                  VarTableModel.typenames).createEditor(qcombobox, None, idx(2))\n            vartype_delegate = VarTypeDelegate(domain_editor, VarTableModel.typenames)\n\n            vartype_delegate.setEditorData(combo, idx(2))\n            counts = [4, 2, 4, 2]\n            for i in range(4):\n                vartype_delegate.setEditorData(combo, idx(i))\n                self.assertEqual(combo.count(), counts[i])\n\n    def test_reader_custom_tab(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            qname = MyCustomTabReader.qualified_name()\n            reader = RecentPath(fn, None, None, file_format=qname)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [reader]})\n            self.widget.load_data()\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n        outdata = self.get_output(self.widget.Outputs.data)\n        self.assertEqual(len(outdata), 150)  # loaded iris\n\n    def test_no_reader_extension(self):\n        with named_file(\"\", suffix=\".xyz_unknown\") as fn:\n            no_reader = RecentPath(fn, None, None)\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_reader]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n\n    def test_fail_sheets(self):\n        with named_file(\"\", suffix=\".failed_sheet\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Error.sheet_error.is_shown())\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n\n    def test_fail(self):\n        with named_file(\"name\\nc\\n\\nstring\", suffix=\".tab\") as fn, \\\n                patch(\"Orange.widgets.data.owfile.log.exception\") as log:\n            self.open_dataset(fn)\n            log.assert_called()\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n\n    def test_read_format(self):\n        iris = Table(\"iris\")\n\n        def open_iris_with_no_spec_format(_a, _b, _c, filters, _e):\n            return iris.__file__, filters.split(\";;\")[0]\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_no_spec_format):\n            self.widget.browse_file()\n\n        self.assertIsNone(self.widget.recent_paths[0].file_format)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n\n        def open_iris_with_tab(*_):\n            return iris.__file__, format_filter(TabReader)\n\n        with patch(\"AnyQt.QtWidgets.QFileDialog.getOpenFileName\",\n                   open_iris_with_tab):\n            self.widget.browse_file()\n\n        self.assertEqual(self.widget.recent_paths[0].file_format, \"Orange.data.io.TabReader\")\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n\n    def test_no_specified_reader(self):\n        with named_file(\"\", suffix=\".tab\") as fn:\n            no_class = RecentPath(fn, None, None, file_format=\"not.a.file.reader.class\")\n            self.widget = self.create_widget(OWFile,\n                                             stored_settings={\"recent_paths\": [no_class]})\n            self.widget.load_data()\n        self.assertTrue(self.widget.Error.missing_reader.is_shown())\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n\n    def test_select_reader(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        # a setting which adds a new qualified name to the reader combo\n        no_class = RecentPath(filename, None, None, file_format=\"not.a.file.reader.class\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        len_with_qname = len(self.widget.reader_combo)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the last option, the same reader\n        self.widget.reader_combo.activated.emit(len_with_qname - 1)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname)\n        self.assertEqual(self.widget.reader_combo.currentText(), \"not.a.file.reader.class\")\n        self.assertEqual(self.widget.reader, None)\n\n        # select the tab reader\n        for i in range(len_with_qname):\n            text = self.widget.reader_combo.itemText(i)\n            if text.startswith(\"Tab-separated\"):\n                break\n        self.widget.reader_combo.activated.emit(i)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertTrue(self.widget.reader_combo.currentText().startswith(\"Tab-separated\"))\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n        # select the default reader\n        self.widget.reader_combo.activated.emit(0)\n        self.assertEqual(len(self.widget.reader_combo), len_with_qname - 1)\n        self.assertEqual(self.widget.reader_combo.currentText(), DEFAULT_READER_TEXT)\n        self.assertIsInstance(self.widget.reader, TabReader)\n\n    def test_select_reader_errors(self):\n        filename = FileFormat.locate(\"iris.tab\", dataset_dirs)\n\n        no_class = RecentPath(filename, None, None, file_format=\"Orange.data.io.ExcelReader\")\n        self.widget = self.create_widget(OWFile,\n                                         stored_settings={\"recent_paths\": [no_class]})\n        self.widget.load_data()\n        self.assertIn(\"Excel\", self.widget.reader_combo.currentText())\n        self.assertTrue(self.widget.Error.unknown.is_shown())\n        self.assertFalse(self.widget.Error.missing_reader.is_shown())\n\n    def test_domain_edit_no_changes(self):\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        # When no changes have been made in the domain editor,\n        # output data should be the same object (and not recreated)\n        self.assertTrue(data is self.widget.data)\n\n    def test_domain_edit_on_sparse_data(self):\n        iris = Table(\"iris\").to_sparse()\n\n        with named_file(\"\", suffix='.pickle') as fn:\n            with open(fn, \"wb\") as f:\n                pickle.dump(iris, f)\n\n            self.widget.add_path(fn)\n            self.widget.load_data()\n\n        output = self.get_output(self.widget.Outputs.data)\n        self.assertIsInstance(output, Table)\n        self.assertEqual(iris.X.shape, output.X.shape)\n        self.assertTrue(sp.issparse(output.X))\n\n    def test_drop_data_when_everything_skipped(self):\n        \"\"\"\n        No data when everything is skipped. Otherwise Select Rows crashes.\n        GH-2237\n        \"\"\"\n        self.open_dataset(\"iris\")\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertTrue(len(data), 150)\n        self.assertTrue(len(data.domain.variables), 5)\n        for i in range(5):\n            idx = self.widget.domain_editor.model().createIndex(i, 2)\n            self.widget.domain_editor.model().setData(idx, \"skip\", Qt.EditRole)\n        self.widget.apply_button.click()\n        data = self.get_output(self.widget.Outputs.data)\n        self.assertIsNone(data)\n\n    def test_call_deprecated_dialog_formats(self):\n        with self.assertWarns(OrangeDeprecationWarning):\n            self.assertIn(\"Tab\", dialog_formats())\n\n    def test_add_new_format(self):\n        # test adding file formats after registering the widget\n        called = False\n        with named_file(\"\", suffix=\".tab\") as filename:\n            def test_format(_sd, _sf, ff, **_):\n                nonlocal called\n                called = True\n                self.assertIn(FailedSheetsFormat, ff)\n                return filename, TabReader, \"\"\n            with patch(\"Orange.widgets.data.owfile.open_filename_dialog\", test_format):\n                self.widget.browse_file()\n        self.assertTrue(called)\n\n    def test_domain_editor_conversions(self):\n        dat = \"\"\"V0\\tV1\\tV2\\tV3\\tV4\\tV5\\tV6\n                 c\\tc\\td\\td\\tc\\td\\td\n                  \\t \\t \\t \\t \\t \\t\n                 3.0\\t1.0\\t4\\ta\\t0.0\\tx\\t1.0\n                 1.0\\t2.0\\t4\\tb\\t0.0\\ty\\t2.0\n                 2.0\\t1.0\\t7\\ta\\t0.0\\ty\\t2.0\n                 0.0\\t2.0\\t7\\ta\\t0.0\\tz\\t2.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n            data1 = self.get_output(self.widget.Outputs.data)\n            model = self.widget.domain_editor.model()\n            # check the ordering of attributes\n            for i, a in enumerate(data1.domain.attributes):\n                self.assertEqual(str(a), model.data(model.createIndex(i, 0), Qt.DisplayRole))\n            # make conversions\n            model.setData(model.createIndex(0, 1), \"categorical\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(2, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(3, 1), \"numeric\", Qt.EditRole)\n            model.setData(model.createIndex(6, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n            data2 = self.get_output(self.widget.Outputs.data)\n            # round continuous values should be converted to integers (3.0 -> 3, \"3\")\n            self.assertEqual(len(data2.domain.attributes[0].values[0]), 1)\n            self.assertEqual(len(data2[0].metas[0]), 1)\n            # discrete integer values should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][2].value), data2[0][1])\n            # discrete round floats should stay the same after conversion to continuous\n            self.assertAlmostEqual(float(data1[0][6].value), data2[0][5])\n\n    def test_domaineditor_continuous_to_string(self):\n        # GH 2744\n        dat = \"\"\"V0\\nc\\n\\n1.0\\nnan\\n3.0\"\"\"\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertSequenceEqual(data.metas.ravel().tolist(), ['1', '', '3'])\n\n    def test_domaineditor_makes_variables(self):\n        # Variables created with domain editor should be interchangeable\n        # with variables read from file.\n\n        dat = \"\"\"V0\\tV1\\nc\\td\\n\\n1.0\\t2\"\"\"\n        v0 = StringVariable.make(\"V0\")\n        v1 = ContinuousVariable.make(\"V1\")\n\n        with named_file(dat, suffix=\".tab\") as filename:\n            self.open_dataset(filename)\n\n            model = self.widget.domain_editor.model()\n            model.setData(model.createIndex(0, 1), \"text\", Qt.EditRole)\n            model.setData(model.createIndex(1, 1), \"numeric\", Qt.EditRole)\n            self.widget.apply_button.click()\n\n            data = self.get_output(self.widget.Outputs.data)\n            self.assertEqual(data.domain[\"V0\"], v0)\n            self.assertEqual(data.domain[\"V1\"], v1)\n\n    def test_url_no_scheme(self):\n        mock_urlreader = Mock(side_effect=ValueError())\n        url = 'foo.bar/xxx.csv'\n\n        with patch('Orange.widgets.data.owfile.UrlReader', mock_urlreader):\n            self.widget.url_combo.insertItem(0, url)\n            self.widget.url_combo.activated.emit(0)\n\n        mock_urlreader.assert_called_once_with('http://' + url)\n\n    def test_adds_origin(self):\n        self.open_dataset(\"origin1/images\")\n        data1 = self.get_output(self.widget.Outputs.data)\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n        self.open_dataset(\"origin2/images\")\n        data2 = self.get_output(self.widget.Outputs.data)\n        attrs = data2.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin2\", attrs[\"origin\"])\n\n        # Make sure that variable in data1 still contains correct origin\n        attrs = data1.domain[\"image\"].attributes\n        self.assertIn(\"origin\", attrs)\n        self.assertIn(\"origin1\", attrs[\"origin\"])\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_open_moved_workflow(self):\n        \"\"\"Test opening workflow that has been moved to another location\n        (i.e. sent by email), considering data file is stored in the same\n        directory as the workflow.\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n            self.assertEqual(w.file_combo.count(), 1)\n            self.assertFalse(w.Error.file_not_found.is_shown())\n        finally:\n            remove(file_name)\n\n    @patch(\"Orange.widgets.widget.OWWidget.workflowEnv\",\n           Mock(return_value={\"basedir\": getcwd()}))\n    def test_files_relocated(self):\n        \"\"\"\n        This test testes if paths are relocated correctly\n        \"\"\"\n        with tempfile.NamedTemporaryFile(dir=getcwd(), delete=False) as temp_file:\n            file_name = temp_file.name\n        base_name = path.basename(file_name)\n        try:\n            recent_path = RecentPath(\n                path.join(\"temp/datasets\", base_name), \"\",\n                path.join(\"datasets\", base_name)\n            )\n            stored_settings = {\"recent_paths\": [recent_path]}\n            w = self.create_widget(OWFile, stored_settings=stored_settings)\n            w.load_data()\n\n            # relocation is called already\n            # if it works correctly relative path should be same than base name\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n\n            w.workflowEnvChanged(\"basedir\", base_name, base_name)\n            self.assertEqual(w.recent_paths[0].relpath, base_name)\n        finally:\n            remove(file_name)\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.itemText(0), \"Sheet1\")\n        self.assertEqual(combo.itemText(1), \"my_sheet\")\n        self.assertEqual(combo.itemText(2), \"Sheet3\")\n        self.assertEqual(combo.currentIndex(), 1)\n\n        widget.reader.sheet = \"no such sheet\"\n        widget._select_active_sheet()\n        self.assertEqual(combo.currentIndex(), 0)\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_another_thread(self):\n        def read():\n            thread = Thread(\n                target=lambda: warnings.warn(\"warning from another thread\")\n            )\n            thread.start()\n            thread.join()\n            return Table(TITANIC_PATH)\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        # Warning must be caught by unit tests, but not the widget\n        with self.assertWarns(UserWarning):\n            self.widget._try_load()\n            self.assertFalse(self.widget.Warning.load_warning.is_shown())\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n\n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n\n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n\n        self.widget._try_load()\n        self.assertTrue(self.widget.Warning.load_warning.is_shown())\n        self.assertIn(WARNING_MSG, str(self.widget.Warning.load_warning))\n\n    def test_recent_url_serialization(self):\n        with patch.object(self.widget, \"load_data\", lambda: None):\n            self.widget.url_combo.insertItem(0, \"https://example.com/test.tab\")\n            self.widget.url_combo.insertItem(1, \"https://example.com/test1.tab\")\n            self.widget.source = OWFile.URL\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test.tab\",\n                              \"https://example.com/test1.tab\"])\n            self.widget.url_combo.lineEdit().clear()\n            QTest.keyClicks(self.widget.url_combo, \"https://example.com/test1.tab\")\n            QTest.keyClick(self.widget.url_combo, Qt.Key_Enter)\n            # must move the entered url to first position\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test1.tab\",\n                              \"https://example.com/test.tab\"])\n\n\nclass TestOWFileDropHandler(unittest.TestCase):\n    def test_canDropUrl(self):\n        handler = OWFileDropHandler()\n        self.assertTrue(handler.canDropUrl(QUrl(\"https://example.com/test.tab\")))\n        self.assertTrue(handler.canDropUrl(QUrl.fromLocalFile(\"test.tab\")))\n\n    def test_parametersFromUrl(self):\n        handler = OWFileDropHandler()\n        r = handler.parametersFromUrl(QUrl(\"https://example.com/test.tab\"))\n        self.assertEqual(r[\"source\"], OWFile.URL)\n        self.assertEqual(r[\"recent_urls\"], [\"https://example.com/test.tab\"])\n        r = handler.parametersFromUrl(QUrl.fromLocalFile(\"test.tab\"))\n        self.assertEqual(r[\"source\"], OWFile.LOCAL_FILE)\n        self.assertEqual(r[\"recent_paths\"][0].basename, \"test.tab\")\n\n        defs = {\n            \"source\": OWFile.LOCAL_FILE,\n            \"recent_paths\": [\n                RecentPath(\"/foo.tab\", None,  None, \"foo.tab\"),\n                RecentPath(path.abspath(\"test.tab\"), None, None, \"test.tab\"),\n            ]\n        }\n        with patch.object(OWFile.settingsHandler, \"defaults\", defs):\n            r = handler.parametersFromUrl(QUrl.fromLocalFile(\"test.tab\"))\n\n        self.assertEqual(len(r[\"recent_paths\"]), 2)\n        self.assertEqual(r[\"recent_paths\"][0].basename, \"test.tab\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._simple_tree' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.35.0.dev0+5357f43 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300\nProcessing dependencies for Orange3==3.35.0.dev0+5357f43\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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/xlrd-2.0.1-py3.7.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-4_frf6wg/serverfiles-0.3.1/setup.cfg\nRunning serverfiles-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-4_frf6wg/serverfiles-0.3.1/egg-dist-tmp-y8cqbpja\ncreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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._tree_scorers' 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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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\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/_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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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\nbuilding 'Orange.classification._simple_tree' 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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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\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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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\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\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\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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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/_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\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\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.35.0.dev0+5357f43 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300\nProcessing dependencies for Orange3==3.35.0.dev0+5357f43\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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling f2py3.8 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages\nFinished processing dependencies for Orange3==3.35.0.dev0+5357f43\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 70ms\nPrepared 18 packages in 2ms\nInstalled 18 packages in 111ms\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`)\nResolved 59 packages in 466ms\nInstalled 52 packages in 739ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + backcall==0.2.0\n + cattrs==23.1.2\n + certifi==2024.12.14\n + charset-normalizer==3.4.1\n + commonmark==0.9.1\n + cycler==0.11.0\n + debugpy==1.7.0\n + decorator==5.1.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + entrypoints==0.4\n + fonttools==4.38.0\n + idna==3.10\n + ipykernel==6.16.2\n + ipython==7.34.0\n + ipython-genutils==0.2.0\n + jedi==0.19.2\n + jupyter-client==7.4.9\n + jupyter-core==4.12.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + matplotlib-inline==0.1.6\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 + pillow==9.5.0\n + pip==24.0\n + platformdirs==4.0.0\n + prompt-toolkit==3.0.48\n + psutil==6.1.1\n + ptyprocess==0.7.0\n + pygments==2.17.2\n + pyparsing==3.1.4\n + pyqtgraph==0.12.3\n + python-dateutil==2.9.0.post0\n + pyzmq==26.2.0\n + qasync==0.25.0\n + qtconsole==5.4.4\n + qtpy==2.4.2\n + requests==2.31.0\n + requests-cache==1.1.1\n + six==1.17.0\n + tornado==6.2\n + traitlets==5.9.0\n + url-normalize==1.4.3\n + urllib3==2.0.7\n + wcwidth==0.2.13\nResolved 2 packages in 3ms\nInstalled 2 packages in 27ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 130ms\nInstalled 8 packages in 1.25s\n + catboost==1.2.7\n + graphviz==0.20.1\n + pandas==1.3.5\n + plotly==5.18.0\n + pytz==2024.2\n + scipy==1.7.3\n + tenacity==8.2.3\n + xgboost==1.6.2\nResolved 5 packages in 12ms\nInstalled 3 packages in 22ms\n + joblib==1.3.2\n + scikit-learn==1.0.2\n + threadpoolctl==3.1.0\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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:3427:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3427 |   __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:4883:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4883 |   __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:5629:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5629 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5750:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5750 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5756:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5756 |           __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:7217:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7217 |         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:7874:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7874 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7934:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7934 |               __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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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-wl6rx8jl/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 85ms\nPrepared 15 packages in 1ms\nInstalled 15 packages in 56ms\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 59 packages in 77ms\nInstalled 55 packages in 138ms\n + anyio==4.5.2\n + backports-tarfile==1.2.0\n + baycomp==1.0.3\n + bottleneck==1.4.0\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 + 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 + 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 + 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 + threadpoolctl==3.5.0\n + typing-extensions==4.12.2\n + tzdata==2024.2\n + urllib3==2.2.3\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\n + zipp==3.20.2\nResolved 64 packages in 66ms\nInstalled 41 packages in 96ms\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 3ms\nInstalled 2 packages in 4ms\n + psycopg2==2.9.10\n + pymssql==2.3.2\nResolved 23 packages in 54ms\nInstalled 6 packages in 518ms\n + catboost==1.2.7\n + graphviz==0.20.3\n + nvidia-nccl-cu12==2.24.3\n + plotly==5.24.1\n + tenacity==9.0.0\n + xgboost==2.1.3\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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:3427:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3427 |   __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:4883:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4883 |   __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:5629:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5629 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5750:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5750 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5756:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5756 |           __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:7217:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7217 |         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:7874:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7874 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7934:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7934 |               __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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.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_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` directly.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.\n        ********************************************************************************\n\n!!\n  self.initialize_options()\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 49 items\n\nr2e_tests/test_1.py sss.F.......................F............F...FF..    [100%]\n\n=================================== FAILURES ===================================\n_________________________ TestOWFile.test_adds_origin __________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_adds_origin>\n\n    def test_adds_origin(self):\n>       self.open_dataset(\"origin1/images\")\n\nr2e_tests/test_1.py:593: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_1.py:227: in open_dataset\n    filename = FileFormat.locate(name, dataset_dirs)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncls = <class 'Orange.data.io.FileFormat'>, filename = 'origin1/images'\nsearch_dirs = ['', '/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/datasets']\n\n    @classmethod\n    def locate(cls, filename, search_dirs=('.',)):\n        \"\"\"Locate a file with given filename that can be opened by one\n        of the available readers.\n    \n        Parameters\n        ----------\n        filename : str\n        search_dirs : Iterable[str]\n    \n        Returns\n        -------\n        str\n            Absolute path to the file\n        \"\"\"\n        if path.exists(filename):\n            return filename\n    \n        for directory in search_dirs:\n            absolute_filename = path.join(directory, filename)\n            if path.exists(absolute_filename):\n                break\n            for ext in cls.readers:\n                if fnmatch(path.basename(filename), '*' + ext):\n                    break\n                # glob uses fnmatch internally\n                matching_files = glob(absolute_filename + ext)\n                if matching_files:\n                    absolute_filename = matching_files[0]\n                    break\n            if path.exists(absolute_filename):\n                break\n        else:\n            absolute_filename = \"\"\n    \n        if not path.exists(absolute_filename):\n>           raise IOError('File \"{}\" was not found.'.format(filename))\nE           OSError: File \"origin1/images\" was not found.\n\nOrange/data/io_base.py:796: OSError\n_________________________ TestOWFile.test_minimum_size _________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_minimum_size>\n\n    def test_minimum_size(self):\n        widget = getattr(self, \"widget\", None)\n        if widget is None:\n            self.skipTest(\"minimum size not tested as .widget was not set\")\n>       self.check_minimum_size(widget)\n\n.venv/lib/python3.8/site-packages/orangewidget/tests/base.py:242: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.8/site-packages/orangewidget/tests/base.py:615: in check_minimum_size\n    self.assertLess(min_size.width(), 800)\nE   AssertionError: 1520 not less than 800\n____________________________ TestOWFile.test_sheets ____________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_sheets>\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n>       self.assertEqual(combo.itemText(0), \"Sheet1\")\nE       AssertionError: '' != 'Sheet1'\nE       + Sheet1\n\nr2e_tests/test_1.py:670: AssertionError\n___________________ TestOWFile.test_warning_from_this_thread ___________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_warning_from_this_thread>\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n    \n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n    \n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n    \n        self.widget._try_load()\n>       self.assertTrue(self.widget.Warning.load_warning.is_shown())\nE       AssertionError: False is not true\n\nr2e_tests/test_1.py:714: AssertionError\n________________________ TestOWFile.test_with_warnings _________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_with_warnings>\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n>       self.assertTrue(self.widget.Warning.load_warning.is_shown())\nE       AssertionError: False is not true\n\nr2e_tests/test_1.py:377: AssertionError\n==================================== PASSES ====================================\n___________________ TestOWFile.test_check_datetime_disabled ____________________\n----------------------------- Captured stderr call -----------------------------\nThis plugin does not support raise()\nThis plugin does not support grabbing the keyboard\nThis plugin does not support raise()\nThis plugin does not support raise()\nThis plugin does not support raise()\nThis plugin does not support raise()\n_____________________ TestOWFile.test_select_reader_errors _____________________\n------------------------------ Captured log call -------------------------------\nERROR    Orange.widgets.data.owfile:owfile.py:429 openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\nTraceback (most recent call last):\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 422, in _try_load\n    self.reader = self._get_reader()  # also sets current reader index\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 474, in _get_reader\n    reader = reader_class(path)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 284, in __init__\n    self.sheet = self.workbook.active.title\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 295, in workbook\n    self._workbook = openpyxl.load_workbook(self.filename,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 346, in load_workbook\n    reader = ExcelReader(filename, read_only, keep_vba,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 123, in __init__\n    self.archive = _validate_archive(fn)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 93, in _validate_archive\n    raise InvalidFileException(msg)\nopenpyxl.utils.exceptions.InvalidFileException: openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\nERROR    Orange.widgets.data.owfile:owfile.py:429 openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\nTraceback (most recent call last):\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 422, in _try_load\n    self.reader = self._get_reader()  # also sets current reader index\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 474, in _get_reader\n    reader = reader_class(path)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 284, in __init__\n    self.sheet = self.workbook.active.title\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 295, in workbook\n    self._workbook = openpyxl.load_workbook(self.filename,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 346, in load_workbook\n    reader = ExcelReader(filename, read_only, keep_vba,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 123, in __init__\n    self.archive = _validate_archive(fn)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 93, in _validate_archive\n    raise InvalidFileException(msg)\nopenpyxl.utils.exceptions.InvalidFileException: openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\n________________________ TestOWFile.test_url_no_scheme _________________________\n------------------------------ Captured log call -------------------------------\nERROR    Orange.widgets.data.owfile:owfile.py:429 \nTraceback (most recent call last):\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 422, in _try_load\n    self.reader = self._get_reader()  # also sets current reader index\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 483, in _get_reader\n    return UrlReader(url)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/unittest/mock.py\", line 1081, in __call__\n    return self._mock_call(*args, **kwargs)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/unittest/mock.py\", line 1085, in _mock_call\n    return self._execute_mock_call(*args, **kwargs)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/unittest/mock.py\", line 1140, in _execute_mock_call\n    raise effect\nValueError\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWFile::test_add_new_format\nPASSED r2e_tests/test_1.py::TestOWFile::test_call_deprecated_dialog_formats\nPASSED r2e_tests/test_1.py::TestOWFile::test_check_column_noname\nPASSED r2e_tests/test_1.py::TestOWFile::test_check_datetime_disabled\nPASSED r2e_tests/test_1.py::TestOWFile::test_check_file_size\nPASSED r2e_tests/test_1.py::TestOWFile::test_context_match_includes_variable_values\nPASSED r2e_tests/test_1.py::TestOWFile::test_describe_call_get_nans\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_changes_are_stored\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_edit_no_changes\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_edit_on_sparse_data\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_editor_conversions\nPASSED r2e_tests/test_1.py::TestOWFile::test_domaineditor_continuous_to_string\nPASSED r2e_tests/test_1.py::TestOWFile::test_domaineditor_makes_variables\nPASSED r2e_tests/test_1.py::TestOWFile::test_dragEnterEvent_accepts_urls\nPASSED r2e_tests/test_1.py::TestOWFile::test_dragEnterEvent_skips_osx_file_references\nPASSED r2e_tests/test_1.py::TestOWFile::test_dragEnterEvent_skips_usupported_files\nPASSED r2e_tests/test_1.py::TestOWFile::test_dropEvent_selects_file\nPASSED r2e_tests/test_1.py::TestOWFile::test_drop_data_when_everything_skipped\nPASSED r2e_tests/test_1.py::TestOWFile::test_fail\nPASSED r2e_tests/test_1.py::TestOWFile::test_fail_sheets\nPASSED r2e_tests/test_1.py::TestOWFile::test_file_not_found\nPASSED r2e_tests/test_1.py::TestOWFile::test_files_relocated\nPASSED r2e_tests/test_1.py::TestOWFile::test_image_export\nPASSED r2e_tests/test_1.py::TestOWFile::test_invalid_role_mode\nPASSED r2e_tests/test_1.py::TestOWFile::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWFile::test_no_last_path\nPASSED r2e_tests/test_1.py::TestOWFile::test_no_reader_extension\nPASSED r2e_tests/test_1.py::TestOWFile::test_no_specified_reader\nPASSED r2e_tests/test_1.py::TestOWFile::test_nothing_selected\nPASSED r2e_tests/test_1.py::TestOWFile::test_open_moved_workflow\nPASSED r2e_tests/test_1.py::TestOWFile::test_read_format\nPASSED r2e_tests/test_1.py::TestOWFile::test_reader_custom_tab\nPASSED r2e_tests/test_1.py::TestOWFile::test_recent_url_serialization\nPASSED r2e_tests/test_1.py::TestOWFile::test_rename_duplicates\nPASSED r2e_tests/test_1.py::TestOWFile::test_select_reader\nPASSED r2e_tests/test_1.py::TestOWFile::test_select_reader_errors\nPASSED r2e_tests/test_1.py::TestOWFile::test_url_no_scheme\nPASSED r2e_tests/test_1.py::TestOWFile::test_variable_name_change\nPASSED r2e_tests/test_1.py::TestOWFile::test_warning_from_another_thread\nPASSED r2e_tests/test_1.py::TestOWFileDropHandler::test_canDropUrl\nPASSED r2e_tests/test_1.py::TestOWFileDropHandler::test_parametersFromUrl\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWFile::test_adds_origin - OSError: File \"ori...\nFAILED r2e_tests/test_1.py::TestOWFile::test_minimum_size - AssertionError: 1...\nFAILED r2e_tests/test_1.py::TestOWFile::test_sheets - AssertionError: '' != '...\nFAILED r2e_tests/test_1.py::TestOWFile::test_warning_from_this_thread - Asser...\nFAILED r2e_tests/test_1.py::TestOWFile::test_with_warnings - AssertionError: ...\n=================== 5 failed, 41 passed, 3 skipped in 6.77s ====================\nWidgets left: 0    Max widgets: 4933 \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_5357f43a3929e36919b4279c4b5156967fa4d300\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 49 items\n\nr2e_tests/test_1.py sss.F.......................F........F...F...FF..    [100%]\n\n=================================== FAILURES ===================================\n_________________________ TestOWFile.test_adds_origin __________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_adds_origin>\n\n    def test_adds_origin(self):\n>       self.open_dataset(\"origin1/images\")\n\nr2e_tests/test_1.py:593: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_1.py:227: in open_dataset\n    filename = FileFormat.locate(name, dataset_dirs)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncls = <class 'Orange.data.io.FileFormat'>, filename = 'origin1/images'\nsearch_dirs = ['', '/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/datasets']\n\n    @classmethod\n    def locate(cls, filename, search_dirs=('.',)):\n        \"\"\"Locate a file with given filename that can be opened by one\n        of the available readers.\n    \n        Parameters\n        ----------\n        filename : str\n        search_dirs : Iterable[str]\n    \n        Returns\n        -------\n        str\n            Absolute path to the file\n        \"\"\"\n        if path.exists(filename):\n            return filename\n    \n        for directory in search_dirs:\n            absolute_filename = path.join(directory, filename)\n            if path.exists(absolute_filename):\n                break\n            for ext in cls.readers:\n                if fnmatch(path.basename(filename), '*' + ext):\n                    break\n                # glob uses fnmatch internally\n                matching_files = glob(absolute_filename + ext)\n                if matching_files:\n                    absolute_filename = matching_files[0]\n                    break\n            if path.exists(absolute_filename):\n                break\n        else:\n            absolute_filename = \"\"\n    \n        if not path.exists(absolute_filename):\n>           raise IOError('File \"{}\" was not found.'.format(filename))\nE           OSError: File \"origin1/images\" was not found.\n\nOrange/data/io_base.py:796: OSError\n_________________________ TestOWFile.test_minimum_size _________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_minimum_size>\n\n    def test_minimum_size(self):\n        widget = getattr(self, \"widget\", None)\n        if widget is None:\n            self.skipTest(\"minimum size not tested as .widget was not set\")\n>       self.check_minimum_size(widget)\n\n.venv/lib/python3.8/site-packages/orangewidget/tests/base.py:242: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.8/site-packages/orangewidget/tests/base.py:615: in check_minimum_size\n    self.assertLess(min_size.width(), 800)\nE   AssertionError: 1520 not less than 800\n___________________ TestOWFile.test_recent_url_serialization ___________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_recent_url_serialization>\n\n    def test_recent_url_serialization(self):\n        with patch.object(self.widget, \"load_data\", lambda: None):\n            self.widget.url_combo.insertItem(0, \"https://example.com/test.tab\")\n            self.widget.url_combo.insertItem(1, \"https://example.com/test1.tab\")\n            self.widget.source = OWFile.URL\n            s = self.widget.settingsHandler.pack_data(self.widget)\n            self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test.tab\",\n                              \"https://example.com/test1.tab\"])\n            self.widget.url_combo.lineEdit().clear()\n            QTest.keyClicks(self.widget.url_combo, \"https://example.com/test1.tab\")\n            QTest.keyClick(self.widget.url_combo, Qt.Key_Enter)\n            # must move the entered url to first position\n            s = self.widget.settingsHandler.pack_data(self.widget)\n>           self.assertEqual(s[\"recent_urls\"],\n                             [\"https://example.com/test1.tab\",\n                              \"https://example.com/test.tab\"])\nE           AssertionError: Lists differ: ['https://example.com/test.tab', 'https://example.com/test1.tab'] != ['https://example.com/test1.tab', 'https://example.com/test.tab']\nE           \nE           First differing element 0:\nE           'https://example.com/test.tab'\nE           'https://example.com/test1.tab'\nE           \nE           - ['https://example.com/test.tab', 'https://example.com/test1.tab']\nE           + ['https://example.com/test1.tab', 'https://example.com/test.tab']\n\nr2e_tests/test_1.py:731: AssertionError\n____________________________ TestOWFile.test_sheets ____________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_sheets>\n\n    def test_sheets(self):\n        # pylint: disable=protected-access\n        widget = self.widget\n        combo = widget.sheet_combo\n        widget.last_path = \\\n            lambda: path.join(path.dirname(__file__), '..', \"..\", '..',\n                              'tests', 'xlsx_files', 'header_0_sheet.xlsx')\n        widget._try_load()\n        widget.reader.sheet = \"my_sheet\"\n        widget._select_active_sheet()\n>       self.assertEqual(combo.itemText(0), \"Sheet1\")\nE       AssertionError: '' != 'Sheet1'\nE       + Sheet1\n\nr2e_tests/test_1.py:670: AssertionError\n___________________ TestOWFile.test_warning_from_this_thread ___________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_warning_from_this_thread>\n\n    @patch(\"os.path.exists\", new=lambda _: True)\n    def test_warning_from_this_thread(self):\n        WARNING_MSG = \"warning from this thread\"\n    \n        def read():\n            warnings.warn(WARNING_MSG)\n            return Table(TITANIC_PATH)\n    \n        reader = Mock()\n        reader.read = read\n        self.widget._get_reader = lambda: reader\n        self.widget.last_path = lambda: \"foo\"\n        self.widget._update_sheet_combo = Mock()\n    \n        self.widget._try_load()\n>       self.assertTrue(self.widget.Warning.load_warning.is_shown())\nE       AssertionError: False is not true\n\nr2e_tests/test_1.py:714: AssertionError\n________________________ TestOWFile.test_with_warnings _________________________\n\nself = <r2e_tests.test_1.TestOWFile testMethod=test_with_warnings>\n\n    def test_with_warnings(self):\n        with named_file(\"\", suffix=\".with_warning\") as fn:\n            self.open_dataset(fn)\n>       self.assertTrue(self.widget.Warning.load_warning.is_shown())\nE       AssertionError: False is not true\n\nr2e_tests/test_1.py:377: AssertionError\n==================================== PASSES ====================================\n___________________ TestOWFile.test_check_datetime_disabled ____________________\n----------------------------- Captured stderr call -----------------------------\nThis plugin does not support raise()\nThis plugin does not support grabbing the keyboard\nThis plugin does not support raise()\nThis plugin does not support raise()\nThis plugin does not support raise()\nThis plugin does not support raise()\n_____________________ TestOWFile.test_select_reader_errors _____________________\n------------------------------ Captured log call -------------------------------\nERROR    Orange.widgets.data.owfile:owfile.py:423 openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\nTraceback (most recent call last):\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 416, in _try_load\n    self.reader = self._get_reader()  # also sets current reader index\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 468, in _get_reader\n    reader = reader_class(path)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 284, in __init__\n    self.sheet = self.workbook.active.title\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 295, in workbook\n    self._workbook = openpyxl.load_workbook(self.filename,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 346, in load_workbook\n    reader = ExcelReader(filename, read_only, keep_vba,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 123, in __init__\n    self.archive = _validate_archive(fn)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 93, in _validate_archive\n    raise InvalidFileException(msg)\nopenpyxl.utils.exceptions.InvalidFileException: openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\nERROR    Orange.widgets.data.owfile:owfile.py:423 openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\nTraceback (most recent call last):\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 416, in _try_load\n    self.reader = self._get_reader()  # also sets current reader index\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 468, in _get_reader\n    reader = reader_class(path)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 284, in __init__\n    self.sheet = self.workbook.active.title\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/data/io.py\", line 295, in workbook\n    self._workbook = openpyxl.load_workbook(self.filename,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 346, in load_workbook\n    reader = ExcelReader(filename, read_only, keep_vba,\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 123, in __init__\n    self.archive = _validate_archive(fn)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/.venv/lib/python3.8/site-packages/openpyxl/reader/excel.py\", line 93, in _validate_archive\n    raise InvalidFileException(msg)\nopenpyxl.utils.exceptions.InvalidFileException: openpyxl does not support .tab file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm\n________________________ TestOWFile.test_url_no_scheme _________________________\n------------------------------ Captured log call -------------------------------\nERROR    Orange.widgets.data.owfile:owfile.py:423 \nTraceback (most recent call last):\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 416, in _try_load\n    self.reader = self._get_reader()  # also sets current reader index\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_5357f43a3929e36919b4279c4b5156967fa4d300/Orange/widgets/data/owfile.py\", line 477, in _get_reader\n    return UrlReader(url)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/unittest/mock.py\", line 1081, in __call__\n    return self._mock_call(*args, **kwargs)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/unittest/mock.py\", line 1085, in _mock_call\n    return self._execute_mock_call(*args, **kwargs)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/unittest/mock.py\", line 1140, in _execute_mock_call\n    raise effect\nValueError\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWFile::test_add_new_format\nPASSED r2e_tests/test_1.py::TestOWFile::test_call_deprecated_dialog_formats\nPASSED r2e_tests/test_1.py::TestOWFile::test_check_column_noname\nPASSED r2e_tests/test_1.py::TestOWFile::test_check_datetime_disabled\nPASSED r2e_tests/test_1.py::TestOWFile::test_check_file_size\nPASSED r2e_tests/test_1.py::TestOWFile::test_context_match_includes_variable_values\nPASSED r2e_tests/test_1.py::TestOWFile::test_describe_call_get_nans\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_changes_are_stored\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_edit_no_changes\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_edit_on_sparse_data\nPASSED r2e_tests/test_1.py::TestOWFile::test_domain_editor_conversions\nPASSED r2e_tests/test_1.py::TestOWFile::test_domaineditor_continuous_to_string\nPASSED r2e_tests/test_1.py::TestOWFile::test_domaineditor_makes_variables\nPASSED r2e_tests/test_1.py::TestOWFile::test_dragEnterEvent_accepts_urls\nPASSED r2e_tests/test_1.py::TestOWFile::test_dragEnterEvent_skips_osx_file_references\nPASSED r2e_tests/test_1.py::TestOWFile::test_dragEnterEvent_skips_usupported_files\nPASSED r2e_tests/test_1.py::TestOWFile::test_dropEvent_selects_file\nPASSED r2e_tests/test_1.py::TestOWFile::test_drop_data_when_everything_skipped\nPASSED r2e_tests/test_1.py::TestOWFile::test_fail\nPASSED r2e_tests/test_1.py::TestOWFile::test_fail_sheets\nPASSED r2e_tests/test_1.py::TestOWFile::test_file_not_found\nPASSED r2e_tests/test_1.py::TestOWFile::test_files_relocated\nPASSED r2e_tests/test_1.py::TestOWFile::test_image_export\nPASSED r2e_tests/test_1.py::TestOWFile::test_invalid_role_mode\nPASSED r2e_tests/test_1.py::TestOWFile::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWFile::test_no_last_path\nPASSED r2e_tests/test_1.py::TestOWFile::test_no_reader_extension\nPASSED r2e_tests/test_1.py::TestOWFile::test_no_specified_reader\nPASSED r2e_tests/test_1.py::TestOWFile::test_nothing_selected\nPASSED r2e_tests/test_1.py::TestOWFile::test_open_moved_workflow\nPASSED r2e_tests/test_1.py::TestOWFile::test_read_format\nPASSED r2e_tests/test_1.py::TestOWFile::test_reader_custom_tab\nPASSED r2e_tests/test_1.py::TestOWFile::test_rename_duplicates\nPASSED r2e_tests/test_1.py::TestOWFile::test_select_reader\nPASSED r2e_tests/test_1.py::TestOWFile::test_select_reader_errors\nPASSED r2e_tests/test_1.py::TestOWFile::test_url_no_scheme\nPASSED r2e_tests/test_1.py::TestOWFile::test_variable_name_change\nPASSED r2e_tests/test_1.py::TestOWFile::test_warning_from_another_thread\nPASSED r2e_tests/test_1.py::TestOWFileDropHandler::test_canDropUrl\nPASSED r2e_tests/test_1.py::TestOWFileDropHandler::test_parametersFromUrl\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWFile::test_adds_origin - OSError: File \"ori...\nFAILED r2e_tests/test_1.py::TestOWFile::test_minimum_size - AssertionError: 1...\nFAILED r2e_tests/test_1.py::TestOWFile::test_recent_url_serialization - Asser...\nFAILED r2e_tests/test_1.py::TestOWFile::test_sheets - AssertionError: '' != '...\nFAILED r2e_tests/test_1.py::TestOWFile::test_warning_from_this_thread - Asser...\nFAILED r2e_tests/test_1.py::TestOWFile::test_with_warnings - AssertionError: ...\n=================== 6 failed, 40 passed, 3 skipped in 4.77s ====================\nWidgets left: 0    Max widgets: 4555 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/data/owfile.py Orange/widgets/data/tests/test_owfile.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Recent URLs Not Reordered When Re-entered

**Description:**
When a user re-enters an existing URL into the recent URLs list, the URL should move to the top of the list to indicate it was recently used. However, currently, re-entering a URL does not change its position in the list.

**Example Code:**
```python
# Add initial URLs to the recent list
widget.url_combo.insertItem(0, "https://example.com/test.tab")
widget.url_combo.insertItem(1, "https://example.com/test1.tab")
widget.source = OWFile.URL

# Serialize the settings
settings = widget.settingsHandler.pack_data(widget)
print(settings["recent_urls"])
# Output: ["https://example.com/test.tab", "https://example.com/test1.tab"]

# Re-enter an existing URL
widget.url_combo.lineEdit().clear()
QTest.keyClicks(widget.url_combo, "https://example.com/test1.tab")
QTest.keyClick(widget.url_combo, Qt.Key_Enter)

# Serialize the settings again
settings = widget.settingsHandler.pack_data(widget)
print(settings["recent_urls"])
# Expected Output: ["https://example.com/test1.tab", "https://example.com/test.tab"]
# Actual Output: ["https://example.com/test.tab", "https://example.com/test1.tab"]
```

**Expected Behavior:**
When an existing URL is re-entered, it should automatically move to the top of the recent URLs list, indicating it as the most recently used.

**Actual Behavior:**
Re-entering an existing URL does not change its position in the recent URLs list. The URL remains in its original position, failing to reflect its recent usage.

[/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/owfile.py
import os
import logging
from itertools import chain
from urllib.parse import urlparse
from typing import List, Dict, Any

import numpy as np
from AnyQt.QtWidgets import \
    QStyle, QComboBox, QMessageBox, QGridLayout, QLabel, \
    QLineEdit, QSizePolicy as Policy, QCompleter
from AnyQt.QtCore import Qt, QTimer, QSize, QUrl
from AnyQt.QtGui import QBrush

from orangewidget.utils.filedialogs import format_filter
from orangewidget.workflow.drophandler import SingleUrlDropHandler

from Orange.data.table import Table, get_sample_datasets_dir
from Orange.data.io import FileFormat, UrlReader, class_from_qualified_name
from Orange.data.io_base import MissingReaderException
from Orange.util import log_warnings
from Orange.widgets import widget, gui
from Orange.widgets.utils.localization import pl
from Orange.widgets.settings import Setting, ContextSetting, \
    PerfectDomainContextHandler, SettingProvider
from Orange.widgets.utils.domaineditor import DomainEditor
from Orange.widgets.utils.itemmodels import PyListModel
from Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \
    open_filename_dialog, stored_recent_paths_prepend
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Output, Msg

# Backward compatibility: class RecentPath used to be defined in this module,
# and it is used in saved (pickled) settings. It must be imported into the
# module's namespace so that old saved settings still work
from Orange.widgets.utils.filedialogs import RecentPath

DEFAULT_READER_TEXT = "Automatically detect type"

log = logging.getLogger(__name__)


def add_origin(examples, filename):
    """
    Adds attribute with file location to each string variable
    Used for relative filenames stored in string variables (e.g. pictures)
    TODO: we should consider a cleaner solution (special variable type, ...)
    """
    if not filename:
        return
    strings = [var
               for var in examples.domain.variables + examples.domain.metas
               if var.is_string]
    dir_name, _ = os.path.split(filename)
    for var in strings:
        if "type" in var.attributes and "origin" not in var.attributes:
            var.attributes["origin"] = dir_name


class NamedURLModel(PyListModel):
    def __init__(self, mapping):
        self.mapping = mapping
        super().__init__()

    def data(self, index, role=Qt.DisplayRole):
        data = super().data(index, role)
        if role == Qt.DisplayRole:
            return self.mapping.get(data, data)
        return data

    def add_name(self, url, name):
        self.mapping[url] = name
        self.modelReset.emit()


class LineEditSelectOnFocus(QLineEdit):
    def focusInEvent(self, event):
        super().focusInEvent(event)
        # If selectAll is called directly, placing the cursor unselects the text
        QTimer.singleShot(0, self.selectAll)


class OWFile(widget.OWWidget, RecentPathsWComboMixin):
    name = "File"
    id = "orange.widgets.data.file"
    description = "Read data from an input file or network " \
                  "and send a data table to the output."
    icon = "icons/File.svg"
    priority = 10
    category = "Data"
    keywords = ["file", "load", "read", "open"]

    class Outputs:
        data = Output("Data", Table,
                      doc="Attribute-valued dataset read from the input file.")

    want_main_area = False
    buttons_area_orientation = None

    SEARCH_PATHS = [("sample-datasets", get_sample_datasets_dir())]
    SIZE_LIMIT = 1e7
    LOCAL_FILE, URL = range(2)

    settingsHandler = PerfectDomainContextHandler(
        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL
    )

    # pylint seems to want declarations separated from definitions
    recent_paths: List[RecentPath]
    recent_urls: List[str]
    variables: list

    # Overload RecentPathsWidgetMixin.recent_paths to set defaults
    recent_paths = Setting([
        RecentPath("", "sample-datasets", "iris.tab"),
        RecentPath("", "sample-datasets", "titanic.tab"),
        RecentPath("", "sample-datasets", "housing.tab"),
        RecentPath("", "sample-datasets", "heart_disease.tab"),
        RecentPath("", "sample-datasets", "brown-selected.tab"),
        RecentPath("", "sample-datasets", "zoo.tab"),
    ])
    recent_urls = Setting([])
    source = Setting(LOCAL_FILE)
    sheet_names = Setting({})
    url = Setting("")

    variables = ContextSetting([])

    domain_editor = SettingProvider(DomainEditor)

    class Information(widget.OWWidget.Information):
        no_file_selected = Msg("No file selected.")

    class Warning(widget.OWWidget.Warning):
        file_too_big = Msg("The file is too large to load automatically."
                           " Press Reload to load.")
        load_warning = Msg("Read warning:\n{}")
        performance_warning = Msg(
            "Categorical variables with >100 values may decrease performance.")
        renamed_vars = Msg("Some variables have been renamed "
                           "to avoid duplicates.\n{}")
        multiple_targets = Msg("Most widgets do not support multiple targets")

    class Error(widget.OWWidget.Error):
        file_not_found = Msg("File not found.")
        missing_reader = Msg("Missing reader.")
        sheet_error = Msg("Error listing available sheets.")
        unknown = Msg("Read error:\n{}")

    UserAdviceMessages = [
        widget.Message(
            "Use CSV File Import widget for advanced options "
            "for comma-separated files",
            "use-csv-file-import"),
        widget.Message(
            "This widget loads only tabular data. Use other widgets to load "
            "other data types like models, distance matrices and networks.",
            "other-data-types"
        )
    ]

    def __init__(self):
        super().__init__()
        RecentPathsWComboMixin.__init__(self)
        self.domain = None
        self.data = None
        self.loaded_file = ""
        self.reader = None

        readers = [f for f in FileFormat.formats
                   if getattr(f, 'read', None)
                   and getattr(f, "EXTENSIONS", None)]

        def group_readers_per_addon_key(w):
            # readers from Orange.data.io should go first
            def package(w):
                package = w.qualified_name().split(".")[:-1]
                package = package[:2]
                if ".".join(package) == "Orange.data":
                    return ["0"]  # force "Orange" to come first
                return package
            return package(w), w.DESCRIPTION

        self.available_readers = sorted(set(readers),
                                        key=group_readers_per_addon_key)

        layout = QGridLayout()
        layout.setSpacing(4)
        gui.widgetBox(self.controlArea, orientation=layout, box='Source')
        vbox = gui.radioButtons(None, self, "source", box=True,
                                callback=self.load_data, addToLayout=False)

        rb_button = gui.appendRadioButton(vbox, "File:", addToLayout=False)
        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)

        box = gui.hBox(None, addToLayout=False, margin=0)
        box.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.file_combo.setMinimumSize(QSize(100, 1))
        self.file_combo.activated[int].connect(self.select_file)
        box.layout().addWidget(self.file_combo)
        layout.addWidget(box, 0, 1)

        file_button = gui.button(
            None, self, '...', callback=self.browse_file, autoDefault=False)
        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))
        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)
        layout.addWidget(file_button, 0, 2)

        reload_button = gui.button(
            None, self, "Reload", callback=self.load_data, autoDefault=False)
        reload_button.setIcon(self.style().standardIcon(
            QStyle.SP_BrowserReload))
        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)
        layout.addWidget(reload_button, 0, 3)

        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)
        self.sheet_combo = QComboBox()
        self.sheet_combo.textActivated.connect(self.select_sheet)
        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.sheet_combo.setMinimumSize(QSize(50, 1))
        self.sheet_label = QLabel()
        self.sheet_label.setText('Sheet')
        self.sheet_label.setSizePolicy(
            Policy.MinimumExpanding, Policy.Fixed)
        self.sheet_box.layout().addWidget(
            self.sheet_label, Qt.AlignLeft)
        self.sheet_box.layout().addWidget(
            self.sheet_combo, Qt.AlignVCenter)
        layout.addWidget(self.sheet_box, 2, 1)
        self.sheet_box.hide()

        rb_button = gui.appendRadioButton(vbox, "URL:", addToLayout=False)
        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)

        self.url_combo = url_combo = QComboBox()
        url_model = NamedURLModel(self.sheet_names)
        url_model.wrap(self.recent_urls)
        url_combo.setLineEdit(LineEditSelectOnFocus())
        url_combo.setModel(url_model)
        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)
        url_combo.setEditable(True)
        url_combo.setInsertPolicy(url_combo.InsertAtTop)
        url_edit = url_combo.lineEdit()
        margins = url_edit.textMargins()
        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()
        url_edit.setTextMargins(l + 5, t, r, b)
        layout.addWidget(url_combo, 3, 1, 1, 3)
        url_combo.activated.connect(self._url_set)
        # whit completer we set that combo box is case sensitive when
        # matching the history
        completer = QCompleter()
        completer.setCaseSensitivity(Qt.CaseSensitive)
        url_combo.setCompleter(completer)

        layout = QGridLayout()
        layout.setSpacing(4)
        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')

        box = gui.hBox(None, addToLayout=False, margin=0)
        box.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.reader_combo = QComboBox(self)
        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.reader_combo.setMinimumSize(QSize(100, 1))
        self.reader_combo.activated[int].connect(self.select_reader)

        box.layout().addWidget(self.reader_combo)
        layout.addWidget(box, 0, 1)

        box = gui.vBox(self.controlArea, "Info")
        self.infolabel = gui.widgetLabel(box, 'No data loaded.')

        box = gui.widgetBox(self.controlArea, "Columns (Double click to edit)")
        self.domain_editor = DomainEditor(self)
        self.editor_model = self.domain_editor.model()
        box.layout().addWidget(self.domain_editor)

        box = gui.hBox(box)
        gui.button(
            box, self, "Reset", callback=self.reset_domain_edit,
            autoDefault=False
        )
        gui.rubber(box)
        self.apply_button = gui.button(
            box, self, "Apply", callback=self.apply_domain_edit)
        self.apply_button.setEnabled(False)
        self.apply_button.setFixedWidth(170)
        self.editor_model.dataChanged.connect(
            lambda: self.apply_button.setEnabled(True))

        hBox = gui.hBox(self.controlArea)
        gui.rubber(hBox)
        gui.button(
            hBox, self, "Browse documentation datasets",
            callback=lambda: self.browse_file(True), autoDefault=False)
        gui.rubber(hBox)

        self.set_file_list()
        # Must not call open_file from within __init__. open_file
        # explicitly re-enters the event loop (by a progress bar)

        self.setAcceptDrops(True)

        if self.source == self.LOCAL_FILE:
            last_path = self.last_path()
            if last_path and os.path.exists(last_path) and \
                    os.path.getsize(last_path) > self.SIZE_LIMIT:
                self.Warning.file_too_big()
                return

        QTimer.singleShot(0, self.load_data)

    @staticmethod
    def sizeHint():
        return QSize(600, 550)

    def select_file(self, n):
        assert n < len(self.recent_paths)
        super().select_file(n)
        if self.recent_paths:
            self.source = self.LOCAL_FILE
            self.load_data()
            self.set_file_list()

    def select_sheet(self):
        self.recent_paths[0].sheet = self.sheet_combo.currentText()
        self.load_data()

    def select_reader(self, n):
        if self.source != self.LOCAL_FILE:
            return  # ignore for URL's

        if self.recent_paths:
            path = self.recent_paths[0]
            if n == 0:  # default
                path.file_format = None
                self.load_data()
            elif n <= len(self.available_readers):
                reader = self.available_readers[n - 1]
                path.file_format = reader.qualified_name()
                self.load_data()
            else:  # the rest include just qualified names
                path.file_format = self.reader_combo.itemText(n)
                self.load_data()

    def _url_set(self):
        url = self.url_combo.currentText()
        pos = self.recent_urls.index(url)
        url = url.strip()

        if not urlparse(url).scheme:
            url = 'http://' + url
            self.url_combo.setItemText(pos, url)
            self.recent_urls[pos] = url

        self.source = self.URL
        self.load_data()

    def browse_file(self, in_demos=False):
        if in_demos:
            start_file = get_sample_datasets_dir()
            if not os.path.exists(start_file):
                QMessageBox.information(
                    None, "File",
                    "Cannot find the directory with documentation datasets")
                return
        else:
            start_file = self.last_path() or os.path.expanduser("~/")

        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)
        if not filename:
            return
        self.add_path(filename)
        if reader is not None:
            self.recent_paths[0].file_format = reader.qualified_name()

        self.source = self.LOCAL_FILE
        self.load_data()

    # Open a file, create data from it and send it over the data channel
    def load_data(self):
        # We need to catch any exception type since anything can happen in
        # file readers
        self.closeContext()
        self.domain_editor.set_domain(None)
        self.apply_button.setEnabled(False)
        self.clear_messages()
        self.set_file_list()

        error = self._try_load()
        if error:
            error()
            self.data = None
            self.sheet_box.hide()
            self.Outputs.data.send(None)
            self.infolabel.setText("No data.")

    def _try_load(self):
        self._initialize_reader_combo()

        # pylint: disable=broad-except
        if self.source == self.LOCAL_FILE:
            if self.last_path() is None:
                return self.Information.no_file_selected
            elif not os.path.exists(self.last_path()):
                return self.Error.file_not_found
        else:
            url = self.url_combo.currentText().strip()
            if not url:
                return self.Information.no_file_selected

        def mark_problematic_reader():
            self.reader_combo.setItemData(self.reader_combo.currentIndex(),
                                          QBrush(Qt.red), Qt.ForegroundRole)

        try:
            self.reader = self._get_reader()  # also sets current reader index
            assert self.reader is not None
        except MissingReaderException:
            mark_problematic_reader()
            return self.Error.missing_reader
        except Exception as ex:
            mark_problematic_reader()
            log.exception(ex)
            return lambda x=ex: self.Error.unknown(str(x))

        try:
            self._update_sheet_combo()
        except Exception:
            return self.Error.sheet_error

        with log_warnings() as warnings:
            try:
                data = self.reader.read()
            except Exception as ex:
                mark_problematic_reader()
                log.exception(ex)
                return lambda x=ex: self.Error.unknown(str(x))
            if warnings:
                self.Warning.load_warning(warnings[-1].message.args[0])

        self.infolabel.setText(self._describe(data))

        self.loaded_file = self.last_path()
        add_origin(data, self.loaded_file)
        self.data = data
        self.openContext(data.domain)
        self.apply_domain_edit()  # sends data
        return None

    def _get_reader(self) -> FileFormat:
        if self.source == self.LOCAL_FILE:
            path = self.last_path()
            self.reader_combo.setEnabled(True)
            if self.recent_paths and self.recent_paths[0].file_format:
                qname = self.recent_paths[0].file_format
                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}
                if qname in qname_index:
                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)
                else:
                    # reader may be accessible, but not in self.available_readers
                    # (perhaps its code was moved)
                    self.reader_combo.addItem(qname)
                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)
                try:
                    reader_class = class_from_qualified_name(qname)
                except Exception as ex:
                    raise MissingReaderException(f'Can not find reader "{qname}"') from ex
                reader = reader_class(path)
            else:
                self.reader_combo.setCurrentIndex(0)
                reader = FileFormat.get_reader(path)
            if self.recent_paths and self.recent_paths[0].sheet:
                reader.select_sheet(self.recent_paths[0].sheet)
            return reader
        else:
            url = self.url_combo.currentText().strip()
            return UrlReader(url)

    def _update_sheet_combo(self):
        if len(self.reader.sheets) < 2:
            self.sheet_box.hide()
            self.reader.select_sheet(None)
            return

        self.sheet_combo.clear()
        self.sheet_combo.addItems(self.reader.sheets)
        self._select_active_sheet()
        self.sheet_box.show()

    def _select_active_sheet(self):
        try:
            idx = self.reader.sheets.index(self.reader.sheet)
            self.sheet_combo.setCurrentIndex(idx)
        except ValueError:
            # Requested sheet does not exist in this file
            self.reader.select_sheet(None)
            self.sheet_combo.setCurrentIndex(0)

    def _initialize_reader_combo(self):
        self.reader_combo.clear()
        filters = [format_filter(f) for f in self.available_readers]
        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)
        self.reader_combo.setCurrentIndex(0)
        self.reader_combo.setDisabled(True)
        # additional readers may be added in self._get_reader()

    @staticmethod
    def _describe(table):
        def missing_prop(prop):
            if prop:
                return f"({prop * 100:.1f}% missing values)"
            else:
                return "(no missing values)"

        domain = table.domain
        text = ""

        attrs = getattr(table, "attributes", {})
        descs = [attrs[desc]
                 for desc in ("Name", "Description") if desc in attrs]
        if len(descs) == 2:
            descs[0] = f"<b>{descs[0]}</b>"
        if descs:
            text += f"<p>{'<br/>'.join(descs)}</p>"

        text += f"<p>{len(table)} {pl(len(table), 'instance')}"

        missing_in_attr = missing_in_class = ""
        if table.X.size < OWFile.SIZE_LIMIT:
            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())
            missing_in_class = missing_prop(table.get_nan_frequency_class())
        nattrs = len(domain.attributes)
        text += f"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}"
        if domain.has_continuous_class:
            text += f"<br/>Regression; numerical class {missing_in_class}"
        elif domain.has_discrete_class:
            nvals = len(domain.class_var.values)
            text += "<br/>Classification; categorical class " \
                f"with {nvals} {pl(nvals, 'value')} {missing_in_class}"
        elif table.domain.class_vars:
            ntargets = len(table.domain.class_vars)
            text += "<br/>Multi-target; " \
                f"{ntargets} target {pl(ntargets, 'variable')} " \
                f"{missing_in_class}"
        else:
            text += "<br/>Data has no target variable."
        nmetas = len(domain.metas)
        text += f"<br/>{nmetas} {pl(nmetas, 'meta attribute')}"
        text += "</p>"

        if 'Timestamp' in table.domain:
            # Google Forms uses this header to timestamp responses
            text += f"<p>First entry: {table[0, 'Timestamp']}<br/>" \
                f"Last entry: {table[-1, 'Timestamp']}</p>"
        return text

    def storeSpecificSettings(self):
        self.current_context.modified_variables = self.variables[:]

    def retrieveSpecificSettings(self):
        if hasattr(self.current_context, "modified_variables"):
            self.variables[:] = self.current_context.modified_variables

    def reset_domain_edit(self):
        self.domain_editor.reset_domain()
        self.apply_domain_edit()

    def _inspect_discrete_variables(self, domain):
        for var in chain(domain.variables, domain.metas):
            if var.is_discrete and len(var.values) > 100:
                self.Warning.performance_warning()

    def apply_domain_edit(self):
        self.Warning.performance_warning.clear()
        self.Warning.renamed_vars.clear()
        if self.data is None:
            table = None
        else:
            domain, cols, renamed = \
                self.domain_editor.get_domain(self.data.domain, self.data,
                                              deduplicate=True)
            if not (domain.variables or domain.metas):
                table = None
            elif domain is self.data.domain:
                table = self.data
            else:
                X, y, m = cols
                table = Table.from_numpy(domain, X, y, m, self.data.W)
                table.name = self.data.name
                table.ids = np.array(self.data.ids)
                table.attributes = getattr(self.data, 'attributes', {})
                self._inspect_discrete_variables(domain)
            if renamed:
                self.Warning.renamed_vars(f"Renamed: {', '.join(renamed)}")

        self.Warning.multiple_targets(
            shown=table is not None and len(table.domain.class_vars) > 1)
        self.Outputs.data.send(table)
        self.apply_button.setEnabled(False)

    def get_widget_name_extension(self):
        _, name = os.path.split(self.loaded_file)
        return os.path.splitext(name)[0]

    def send_report(self):
        def get_ext_name(filename):
            try:
                return FileFormat.names[os.path.splitext(filename)[1]]
            except KeyError:
                return "unknown"

        if self.data is None:
            self.report_paragraph("File", "No file.")
            return

        if self.source == self.LOCAL_FILE:
            home = os.path.expanduser("~")
            if self.loaded_file.startswith(home):
                # os.path.join does not like ~
                name = "~" + os.path.sep + \
                       self.loaded_file[len(home):].lstrip("/").lstrip("\\")
            else:
                name = self.loaded_file
            if self.sheet_combo.isVisible():
                name += f" ({self.sheet_combo.currentText()})"
            self.report_items("File", [("File name", name),
                                       ("Format", get_ext_name(name))])
        else:
            self.report_items("Data", [("Resource", self.url),
                                       ("Format", get_ext_name(self.url))])

        self.report_data("Data", self.data)

    @staticmethod
    def dragEnterEvent(event):
        """Accept drops of valid file urls"""
        urls = event.mimeData().urls()
        if urls:
            try:
                FileFormat.get_reader(urls[0].toLocalFile())
                event.acceptProposedAction()
            except MissingReaderException:
                pass

    def dropEvent(self, event):
        """Handle file drops"""
        urls = event.mimeData().urls()
        if urls:
            self.add_path(urls[0].toLocalFile())  # add first file
            self.source = self.LOCAL_FILE
            self.load_data()

    def workflowEnvChanged(self, key, value, oldvalue):
        """
        Function called when environment changes (e.g. while saving the scheme)
        It make sure that all environment connected values are modified
        (e.g. relative file paths are changed)
        """
        self.update_file_list(key, value, oldvalue)


class OWFileDropHandler(SingleUrlDropHandler):
    WIDGET = OWFile

    def canDropUrl(self, url: QUrl) -> bool:
        if url.isLocalFile():
            try:
                FileFormat.get_reader(url.toLocalFile())
                return True
            except Exception:  # noqa # pylint:disable=broad-except
                return False
        else:
            return url.scheme().lower() in ("http", "https", "ftp")

    def parametersFromUrl(self, url: QUrl) -> Dict[str, Any]:
        if url.isLocalFile():
            path = url.toLocalFile()
            r = RecentPath(os.path.abspath(path), None, None,
                           os.path.basename(path))
            return {
                "recent_paths": stored_recent_paths_prepend(self.WIDGET, r),
                "source": OWFile.LOCAL_FILE,
            }
        else:
            return {
                "recent_urls": [url.toString()],
                "source": OWFile.URL,
            }


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWFile).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:** Recent URLs Not Reordered When Re-entered

**Description:**
When a user re-enters an existing URL into the recent URLs list, the URL should move to the top of the list to indicate it was recently used. However, currently, re-entering a URL does not change its position in the list.

**Example Code:**
```python
# Add initial URLs to the recent list
widget.url_combo.insertItem(0, "https://example.com/test.tab")
widget.url_combo.insertItem(1, "https://example.com/test1.tab")
widget.source = OWFile.URL

# Serialize the settings
settings = widget.settingsHandler.pack_data(widget)
print(settings["recent_urls"])
# Output: ["https://example.com/test.tab", "https://example.com/test1.tab"]

# Re-enter an existing URL
widget.url_combo.lineEdit().clear()
QTest.keyClicks(widget.url_combo, "https://example.com/test1.tab")
QTest.keyClick(widget.url_combo, Qt.Key_Enter)

# Serialize the settings again
settings = widget.settingsHandler.pack_data(widget)
print(settings["recent_urls"])
# Expected Output: ["https://example.com/test1.tab", "https://example.com/test.tab"]
# Actual Output: ["https://example.com/test.tab", "https://example.com/test1.tab"]
```

**Expected Behavior:**
When an existing URL is re-entered, it should automatically move to the top of the recent URLs list, indicating it as the most recently used.

**Actual Behavior:**
Re-entering an existing URL does not change its position in the recent URLs list. The URL remains in its original position, failing to reflect its recent usage.

[/ISSUE]
{
    "TestOWFile.test_add_new_format": "PASSED",
    "TestOWFile.test_call_deprecated_dialog_formats": "PASSED",
    "TestOWFile.test_check_column_noname": "PASSED",
    "TestOWFile.test_check_datetime_disabled": "PASSED",
    "TestOWFile.test_check_file_size": "PASSED",
    "TestOWFile.test_context_match_includes_variable_values": "PASSED",
    "TestOWFile.test_describe_call_get_nans": "PASSED",
    "TestOWFile.test_domain_changes_are_stored": "PASSED",
    "TestOWFile.test_domain_edit_no_changes": "PASSED",
    "TestOWFile.test_domain_edit_on_sparse_data": "PASSED",
    "TestOWFile.test_domain_editor_conversions": "PASSED",
    "TestOWFile.test_domaineditor_continuous_to_string": "PASSED",
    "TestOWFile.test_domaineditor_makes_variables": "PASSED",
    "TestOWFile.test_dragEnterEvent_accepts_urls": "PASSED",
    "TestOWFile.test_dragEnterEvent_skips_osx_file_references": "PASSED",
    "TestOWFile.test_dragEnterEvent_skips_usupported_files": "PASSED",
    "TestOWFile.test_dropEvent_selects_file": "PASSED",
    "TestOWFile.test_drop_data_when_everything_skipped": "PASSED",
    "TestOWFile.test_fail": "PASSED",
    "TestOWFile.test_fail_sheets": "PASSED",
    "TestOWFile.test_file_not_found": "PASSED",
    "TestOWFile.test_files_relocated": "PASSED",
    "TestOWFile.test_image_export": "PASSED",
    "TestOWFile.test_invalid_role_mode": "PASSED",
    "TestOWFile.test_msg_base_class": "PASSED",
    "TestOWFile.test_no_last_path": "PASSED",
    "TestOWFile.test_no_reader_extension": "PASSED",
    "TestOWFile.test_no_specified_reader": "PASSED",
    "TestOWFile.test_nothing_selected": "PASSED",
    "TestOWFile.test_open_moved_workflow": "PASSED",
    "TestOWFile.test_read_format": "PASSED",
    "TestOWFile.test_reader_custom_tab": "PASSED",
    "TestOWFile.test_recent_url_serialization": "PASSED",
    "TestOWFile.test_rename_duplicates": "PASSED",
    "TestOWFile.test_select_reader": "PASSED",
    "TestOWFile.test_select_reader_errors": "PASSED",
    "TestOWFile.test_url_no_scheme": "PASSED",
    "TestOWFile.test_variable_name_change": "PASSED",
    "TestOWFile.test_warning_from_another_thread": "PASSED",
    "TestOWFileDropHandler.test_canDropUrl": "PASSED",
    "TestOWFileDropHandler.test_parametersFromUrl": "PASSED",
    "TestOWFile.test_adds_origin": "FAILED",
    "TestOWFile.test_minimum_size": "FAILED",
    "TestOWFile.test_sheets": "FAILED",
    "TestOWFile.test_warning_from_this_thread": "FAILED",
    "TestOWFile.test_with_warnings": "FAILED"
}
diff --git a/Orange/widgets/data/owfile.py b/Orange/widgets/data/owfile.py
index fb3ae2dda..35fc2691b 100644
--- a/Orange/widgets/data/owfile.py
+++ b/Orange/widgets/data/owfile.py
@@ -28,6 +28,8 @@ from Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \
     open_filename_dialog, stored_recent_paths_prepend
 from Orange.widgets.utils.widgetpreview import WidgetPreview
 from Orange.widgets.widget import Output, Msg
+from Orange.widgets.utils.combobox import TextEditCombo
+
 
 # Backward compatibility: class RecentPath used to be defined in this module,
 # and it is used in saved (pickled) settings. It must be imported into the
@@ -232,13 +234,12 @@ class OWFile(widget.OWWidget, RecentPathsWComboMixin):
         rb_button = gui.appendRadioButton(vbox, "URL:", addToLayout=False)
         layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)
 
-        self.url_combo = url_combo = QComboBox()
+        self.url_combo = url_combo = TextEditCombo()
         url_model = NamedURLModel(self.sheet_names)
         url_model.wrap(self.recent_urls)
         url_combo.setLineEdit(LineEditSelectOnFocus())
         url_combo.setModel(url_model)
         url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)
-        url_combo.setEditable(True)
         url_combo.setInsertPolicy(url_combo.InsertAtTop)
         url_edit = url_combo.lineEdit()
         margins = url_edit.textMargins()
@@ -343,14 +344,19 @@ class OWFile(widget.OWWidget, RecentPathsWComboMixin):
                 self.load_data()
 
     def _url_set(self):
+        index = self.url_combo.currentIndex()
         url = self.url_combo.currentText()
-        pos = self.recent_urls.index(url)
         url = url.strip()
 
         if not urlparse(url).scheme:
             url = 'http://' + url
-            self.url_combo.setItemText(pos, url)
-            self.recent_urls[pos] = url
+            self.url_combo.setItemText(index, url)
+
+        if index != 0:
+            model = self.url_combo.model()
+            root = self.url_combo.rootModelIndex()
+            model.moveRow(root, index, root, 0)
+            assert self.url_combo.currentIndex() == 0
 
         self.source = self.URL
         self.load_data()

{"Orange/widgets/data/owfile.py": "import os\nimport logging\nfrom itertools import chain\nfrom urllib.parse import urlparse\nfrom typing import List, Dict, Any\n\nimport numpy as np\nfrom AnyQt.QtWidgets import \\\n    QStyle, QComboBox, QMessageBox, QGridLayout, QLabel, \\\n    QLineEdit, QSizePolicy as Policy, QCompleter\nfrom AnyQt.QtCore import Qt, QTimer, QSize, QUrl\nfrom AnyQt.QtGui import QBrush\n\nfrom orangewidget.utils.filedialogs import format_filter\nfrom orangewidget.workflow.drophandler import SingleUrlDropHandler\n\nfrom Orange.data.table import Table, get_sample_datasets_dir\nfrom Orange.data.io import FileFormat, UrlReader, class_from_qualified_name\nfrom Orange.data.io_base import MissingReaderException\nfrom Orange.util import log_warnings\nfrom Orange.widgets import widget, gui\nfrom Orange.widgets.utils.localization import pl\nfrom Orange.widgets.settings import Setting, ContextSetting, \\\n    PerfectDomainContextHandler, SettingProvider\nfrom Orange.widgets.utils.domaineditor import DomainEditor\nfrom Orange.widgets.utils.itemmodels import PyListModel\nfrom Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \\\n    open_filename_dialog, stored_recent_paths_prepend\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Output, Msg\n\n# Backward compatibility: class RecentPath used to be defined in this module,\n# and it is used in saved (pickled) settings. It must be imported into the\n# module's namespace so that old saved settings still work\nfrom Orange.widgets.utils.filedialogs import RecentPath\n\nDEFAULT_READER_TEXT = \"Automatically detect type\"\n\nlog = logging.getLogger(__name__)\n\n\ndef add_origin(examples, filename):\n    \"\"\"\n    Adds attribute with file location to each string variable\n    Used for relative filenames stored in string variables (e.g. pictures)\n    TODO: we should consider a cleaner solution (special variable type, ...)\n    \"\"\"\n    if not filename:\n        return\n    strings = [var\n               for var in examples.domain.variables + examples.domain.metas\n               if var.is_string]\n    dir_name, _ = os.path.split(filename)\n    for var in strings:\n        if \"type\" in var.attributes and \"origin\" not in var.attributes:\n            var.attributes[\"origin\"] = dir_name\n\n\nclass NamedURLModel(PyListModel):\n    def __init__(self, mapping):\n        self.mapping = mapping\n        super().__init__()\n\n    def data(self, index, role=Qt.DisplayRole):\n        data = super().data(index, role)\n        if role == Qt.DisplayRole:\n            return self.mapping.get(data, data)\n        return data\n\n    def add_name(self, url, name):\n        self.mapping[url] = name\n        self.modelReset.emit()\n\n\nclass LineEditSelectOnFocus(QLineEdit):\n    def focusInEvent(self, event):\n        super().focusInEvent(event)\n        # If selectAll is called directly, placing the cursor unselects the text\n        QTimer.singleShot(0, self.selectAll)\n\n\nclass OWFile(widget.OWWidget, RecentPathsWComboMixin):\n    name = \"File\"\n    id = \"orange.widgets.data.file\"\n    description = \"Read data from an input file or network \" \\\n                  \"and send a data table to the output.\"\n    icon = \"icons/File.svg\"\n    priority = 10\n    category = \"Data\"\n    keywords = [\"file\", \"load\", \"read\", \"open\"]\n\n    class Outputs:\n        data = Output(\"Data\", Table,\n                      doc=\"Attribute-valued dataset read from the input file.\")\n\n    want_main_area = False\n    buttons_area_orientation = None\n\n    SEARCH_PATHS = [(\"sample-datasets\", get_sample_datasets_dir())]\n    SIZE_LIMIT = 1e7\n    LOCAL_FILE, URL = range(2)\n\n    settingsHandler = PerfectDomainContextHandler(\n        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL\n    )\n\n    # pylint seems to want declarations separated from definitions\n    recent_paths: List[RecentPath]\n    recent_urls: List[str]\n    variables: list\n\n    # Overload RecentPathsWidgetMixin.recent_paths to set defaults\n    recent_paths = Setting([\n        RecentPath(\"\", \"sample-datasets\", \"iris.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"titanic.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"housing.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"heart_disease.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"brown-selected.tab\"),\n        RecentPath(\"\", \"sample-datasets\", \"zoo.tab\"),\n    ])\n    recent_urls = Setting([])\n    source = Setting(LOCAL_FILE)\n    sheet_names = Setting({})\n    url = Setting(\"\")\n\n    variables = ContextSetting([])\n\n    domain_editor = SettingProvider(DomainEditor)\n\n    class Information(widget.OWWidget.Information):\n        no_file_selected = Msg(\"No file selected.\")\n\n    class Warning(widget.OWWidget.Warning):\n        file_too_big = Msg(\"The file is too large to load automatically.\"\n                           \" Press Reload to load.\")\n        load_warning = Msg(\"Read warning:\\n{}\")\n        performance_warning = Msg(\n            \"Categorical variables with >100 values may decrease performance.\")\n        renamed_vars = Msg(\"Some variables have been renamed \"\n                           \"to avoid duplicates.\\n{}\")\n        multiple_targets = Msg(\"Most widgets do not support multiple targets\")\n\n    class Error(widget.OWWidget.Error):\n        file_not_found = Msg(\"File not found.\")\n        missing_reader = Msg(\"Missing reader.\")\n        sheet_error = Msg(\"Error listing available sheets.\")\n        unknown = Msg(\"Read error:\\n{}\")\n\n    UserAdviceMessages = [\n        widget.Message(\n            \"Use CSV File Import widget for advanced options \"\n            \"for comma-separated files\",\n            \"use-csv-file-import\"),\n        widget.Message(\n            \"This widget loads only tabular data. Use other widgets to load \"\n            \"other data types like models, distance matrices and networks.\",\n            \"other-data-types\"\n        )\n    ]\n\n    def __init__(self):\n        super().__init__()\n        RecentPathsWComboMixin.__init__(self)\n        self.domain = None\n        self.data = None\n        self.loaded_file = \"\"\n        self.reader = None\n\n        readers = [f for f in FileFormat.formats\n                   if getattr(f, 'read', None)\n                   and getattr(f, \"EXTENSIONS\", None)]\n\n        def group_readers_per_addon_key(w):\n            # readers from Orange.data.io should go first\n            def package(w):\n                package = w.qualified_name().split(\".\")[:-1]\n                package = package[:2]\n                if \".\".join(package) == \"Orange.data\":\n                    return [\"0\"]  # force \"Orange\" to come first\n                return package\n            return package(w), w.DESCRIPTION\n\n        self.available_readers = sorted(set(readers),\n                                        key=group_readers_per_addon_key)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='Source')\n        vbox = gui.radioButtons(None, self, \"source\", box=True,\n                                callback=self.load_data, addToLayout=False)\n\n        rb_button = gui.appendRadioButton(vbox, \"File:\", addToLayout=False)\n        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.file_combo.setMinimumSize(QSize(100, 1))\n        self.file_combo.activated[int].connect(self.select_file)\n        box.layout().addWidget(self.file_combo)\n        layout.addWidget(box, 0, 1)\n\n        file_button = gui.button(\n            None, self, '...', callback=self.browse_file, autoDefault=False)\n        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))\n        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)\n        layout.addWidget(file_button, 0, 2)\n\n        reload_button = gui.button(\n            None, self, \"Reload\", callback=self.load_data, autoDefault=False)\n        reload_button.setIcon(self.style().standardIcon(\n            QStyle.SP_BrowserReload))\n        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)\n        layout.addWidget(reload_button, 0, 3)\n\n        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)\n        self.sheet_combo = QComboBox()\n        self.sheet_combo.textActivated.connect(self.select_sheet)\n        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.sheet_combo.setMinimumSize(QSize(50, 1))\n        self.sheet_label = QLabel()\n        self.sheet_label.setText('Sheet')\n        self.sheet_label.setSizePolicy(\n            Policy.MinimumExpanding, Policy.Fixed)\n        self.sheet_box.layout().addWidget(\n            self.sheet_label, Qt.AlignLeft)\n        self.sheet_box.layout().addWidget(\n            self.sheet_combo, Qt.AlignVCenter)\n        layout.addWidget(self.sheet_box, 2, 1)\n        self.sheet_box.hide()\n\n        rb_button = gui.appendRadioButton(vbox, \"URL:\", addToLayout=False)\n        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)\n\n        self.url_combo = url_combo = QComboBox()\n        url_model = NamedURLModel(self.sheet_names)\n        url_model.wrap(self.recent_urls)\n        url_combo.setLineEdit(LineEditSelectOnFocus())\n        url_combo.setModel(url_model)\n        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)\n        url_combo.setEditable(True)\n        url_combo.setInsertPolicy(url_combo.InsertAtTop)\n        url_edit = url_combo.lineEdit()\n        margins = url_edit.textMargins()\n        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()\n        url_edit.setTextMargins(l + 5, t, r, b)\n        layout.addWidget(url_combo, 3, 1, 1, 3)\n        url_combo.activated.connect(self._url_set)\n        # whit completer we set that combo box is case sensitive when\n        # matching the history\n        completer = QCompleter()\n        completer.setCaseSensitivity(Qt.CaseSensitive)\n        url_combo.setCompleter(completer)\n\n        layout = QGridLayout()\n        layout.setSpacing(4)\n        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')\n\n        box = gui.hBox(None, addToLayout=False, margin=0)\n        box.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo = QComboBox(self)\n        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)\n        self.reader_combo.setMinimumSize(QSize(100, 1))\n        self.reader_combo.activated[int].connect(self.select_reader)\n\n        box.layout().addWidget(self.reader_combo)\n        layout.addWidget(box, 0, 1)\n\n        box = gui.vBox(self.controlArea, \"Info\")\n        self.infolabel = gui.widgetLabel(box, 'No data loaded.')\n\n        box = gui.widgetBox(self.controlArea, \"Columns (Double click to edit)\")\n        self.domain_editor = DomainEditor(self)\n        self.editor_model = self.domain_editor.model()\n        box.layout().addWidget(self.domain_editor)\n\n        box = gui.hBox(box)\n        gui.button(\n            box, self, \"Reset\", callback=self.reset_domain_edit,\n            autoDefault=False\n        )\n        gui.rubber(box)\n        self.apply_button = gui.button(\n            box, self, \"Apply\", callback=self.apply_domain_edit)\n        self.apply_button.setEnabled(False)\n        self.apply_button.setFixedWidth(170)\n        self.editor_model.dataChanged.connect(\n            lambda: self.apply_button.setEnabled(True))\n\n        hBox = gui.hBox(self.controlArea)\n        gui.rubber(hBox)\n        gui.button(\n            hBox, self, \"Browse documentation datasets\",\n            callback=lambda: self.browse_file(True), autoDefault=False)\n        gui.rubber(hBox)\n\n        self.set_file_list()\n        # Must not call open_file from within __init__. open_file\n        # explicitly re-enters the event loop (by a progress bar)\n\n        self.setAcceptDrops(True)\n\n        if self.source == self.LOCAL_FILE:\n            last_path = self.last_path()\n            if last_path and os.path.exists(last_path) and \\\n                    os.path.getsize(last_path) > self.SIZE_LIMIT:\n                self.Warning.file_too_big()\n                return\n\n        QTimer.singleShot(0, self.load_data)\n\n    @staticmethod\n    def sizeHint():\n        return QSize(600, 550)\n\n    def select_file(self, n):\n        assert n < len(self.recent_paths)\n        super().select_file(n)\n        if self.recent_paths:\n            self.source = self.LOCAL_FILE\n            self.load_data()\n            self.set_file_list()\n\n    def select_sheet(self):\n        self.recent_paths[0].sheet = self.sheet_combo.currentText()\n        self.load_data()\n\n    def select_reader(self, n):\n        if self.source != self.LOCAL_FILE:\n            return  # ignore for URL's\n\n        if self.recent_paths:\n            path = self.recent_paths[0]\n            if n == 0:  # default\n                path.file_format = None\n                self.load_data()\n            elif n <= len(self.available_readers):\n                reader = self.available_readers[n - 1]\n                path.file_format = reader.qualified_name()\n                self.load_data()\n            else:  # the rest include just qualified names\n                path.file_format = self.reader_combo.itemText(n)\n                self.load_data()\n\n    def _url_set(self):\n        url = self.url_combo.currentText()\n        pos = self.recent_urls.index(url)\n        url = url.strip()\n\n        if not urlparse(url).scheme:\n            url = 'http://' + url\n            self.url_combo.setItemText(pos, url)\n            self.recent_urls[pos] = url\n\n        self.source = self.URL\n        self.load_data()\n\n    def browse_file(self, in_demos=False):\n        if in_demos:\n            start_file = get_sample_datasets_dir()\n            if not os.path.exists(start_file):\n                QMessageBox.information(\n                    None, \"File\",\n                    \"Cannot find the directory with documentation datasets\")\n                return\n        else:\n            start_file = self.last_path() or os.path.expanduser(\"~/\")\n\n        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)\n        if not filename:\n            return\n        self.add_path(filename)\n        if reader is not None:\n            self.recent_paths[0].file_format = reader.qualified_name()\n\n        self.source = self.LOCAL_FILE\n        self.load_data()\n\n    # Open a file, create data from it and send it over the data channel\n    def load_data(self):\n        # We need to catch any exception type since anything can happen in\n        # file readers\n        self.closeContext()\n        self.domain_editor.set_domain(None)\n        self.apply_button.setEnabled(False)\n        self.clear_messages()\n        self.set_file_list()\n\n        error = self._try_load()\n        if error:\n            error()\n            self.data = None\n            self.sheet_box.hide()\n            self.Outputs.data.send(None)\n            self.infolabel.setText(\"No data.\")\n\n    def _try_load(self):\n        self._initialize_reader_combo()\n\n        # pylint: disable=broad-except\n        if self.source == self.LOCAL_FILE:\n            if self.last_path() is None:\n                return self.Information.no_file_selected\n            elif not os.path.exists(self.last_path()):\n                return self.Error.file_not_found\n        else:\n            url = self.url_combo.currentText().strip()\n            if not url:\n                return self.Information.no_file_selected\n\n        def mark_problematic_reader():\n            self.reader_combo.setItemData(self.reader_combo.currentIndex(),\n                                          QBrush(Qt.red), Qt.ForegroundRole)\n\n        try:\n            self.reader = self._get_reader()  # also sets current reader index\n            assert self.reader is not None\n        except MissingReaderException:\n            mark_problematic_reader()\n            return self.Error.missing_reader\n        except Exception as ex:\n            mark_problematic_reader()\n            log.exception(ex)\n            return lambda x=ex: self.Error.unknown(str(x))\n\n        try:\n            self._update_sheet_combo()\n        except Exception:\n            return self.Error.sheet_error\n\n        with log_warnings() as warnings:\n            try:\n                data = self.reader.read()\n            except Exception as ex:\n                mark_problematic_reader()\n                log.exception(ex)\n                return lambda x=ex: self.Error.unknown(str(x))\n            if warnings:\n                self.Warning.load_warning(warnings[-1].message.args[0])\n\n        self.infolabel.setText(self._describe(data))\n\n        self.loaded_file = self.last_path()\n        add_origin(data, self.loaded_file)\n        self.data = data\n        self.openContext(data.domain)\n        self.apply_domain_edit()  # sends data\n        return None\n\n    def _get_reader(self) -> FileFormat:\n        if self.source == self.LOCAL_FILE:\n            path = self.last_path()\n            self.reader_combo.setEnabled(True)\n            if self.recent_paths and self.recent_paths[0].file_format:\n                qname = self.recent_paths[0].file_format\n                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}\n                if qname in qname_index:\n                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)\n                else:\n                    # reader may be accessible, but not in self.available_readers\n                    # (perhaps its code was moved)\n                    self.reader_combo.addItem(qname)\n                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)\n                try:\n                    reader_class = class_from_qualified_name(qname)\n                except Exception as ex:\n                    raise MissingReaderException(f'Can not find reader \"{qname}\"') from ex\n                reader = reader_class(path)\n            else:\n                self.reader_combo.setCurrentIndex(0)\n                reader = FileFormat.get_reader(path)\n            if self.recent_paths and self.recent_paths[0].sheet:\n                reader.select_sheet(self.recent_paths[0].sheet)\n            return reader\n        else:\n            url = self.url_combo.currentText().strip()\n            return UrlReader(url)\n\n    def _update_sheet_combo(self):\n        if len(self.reader.sheets) < 2:\n            self.sheet_box.hide()\n            self.reader.select_sheet(None)\n            return\n\n        self.sheet_combo.clear()\n        self.sheet_combo.addItems(self.reader.sheets)\n        self._select_active_sheet()\n        self.sheet_box.show()\n\n    def _select_active_sheet(self):\n        try:\n            idx = self.reader.sheets.index(self.reader.sheet)\n            self.sheet_combo.setCurrentIndex(idx)\n        except ValueError:\n            # Requested sheet does not exist in this file\n            self.reader.select_sheet(None)\n            self.sheet_combo.setCurrentIndex(0)\n\n    def _initialize_reader_combo(self):\n        self.reader_combo.clear()\n        filters = [format_filter(f) for f in self.available_readers]\n        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)\n        self.reader_combo.setCurrentIndex(0)\n        self.reader_combo.setDisabled(True)\n        # additional readers may be added in self._get_reader()\n\n    @staticmethod\n    def _describe(table):\n        def missing_prop(prop):\n            if prop:\n                return f\"({prop * 100:.1f}% missing values)\"\n            else:\n                return \"(no missing values)\"\n\n        domain = table.domain\n        text = \"\"\n\n        attrs = getattr(table, \"attributes\", {})\n        descs = [attrs[desc]\n                 for desc in (\"Name\", \"Description\") if desc in attrs]\n        if len(descs) == 2:\n            descs[0] = f\"<b>{descs[0]}</b>\"\n        if descs:\n            text += f\"<p>{'<br/>'.join(descs)}</p>\"\n\n        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"\n\n        missing_in_attr = missing_in_class = \"\"\n        if table.X.size < OWFile.SIZE_LIMIT:\n            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n            missing_in_class = missing_prop(table.get_nan_frequency_class())\n        nattrs = len(domain.attributes)\n        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"\n        if domain.has_continuous_class:\n            text += f\"<br/>Regression; numerical class {missing_in_class}\"\n        elif domain.has_discrete_class:\n            nvals = len(domain.class_var.values)\n            text += \"<br/>Classification; categorical class \" \\\n                f\"with {nvals} {pl(nvals, 'value')} {missing_in_class}\"\n        elif table.domain.class_vars:\n            ntargets = len(table.domain.class_vars)\n            text += \"<br/>Multi-target; \" \\\n                f\"{ntargets} target {pl(ntargets, 'variable')} \" \\\n                f\"{missing_in_class}\"\n        else:\n            text += \"<br/>Data has no target variable.\"\n        nmetas = len(domain.metas)\n        text += f\"<br/>{nmetas} {pl(nmetas, 'meta attribute')}\"\n        text += \"</p>\"\n\n        if 'Timestamp' in table.domain:\n            # Google Forms uses this header to timestamp responses\n            text += f\"<p>First entry: {table[0, 'Timestamp']}<br/>\" \\\n                f\"Last entry: {table[-1, 'Timestamp']}</p>\"\n        return text\n\n    def storeSpecificSettings(self):\n        self.current_context.modified_variables = self.variables[:]\n\n    def retrieveSpecificSettings(self):\n        if hasattr(self.current_context, \"modified_variables\"):\n            self.variables[:] = self.current_context.modified_variables\n\n    def reset_domain_edit(self):\n        self.domain_editor.reset_domain()\n        self.apply_domain_edit()\n\n    def _inspect_discrete_variables(self, domain):\n        for var in chain(domain.variables, domain.metas):\n            if var.is_discrete and len(var.values) > 100:\n                self.Warning.performance_warning()\n\n    def apply_domain_edit(self):\n        self.Warning.performance_warning.clear()\n        self.Warning.renamed_vars.clear()\n        if self.data is None:\n            table = None\n        else:\n            domain, cols, renamed = \\\n                self.domain_editor.get_domain(self.data.domain, self.data,\n                                              deduplicate=True)\n            if not (domain.variables or domain.metas):\n                table = None\n            elif domain is self.data.domain:\n                table = self.data\n            else:\n                X, y, m = cols\n                table = Table.from_numpy(domain, X, y, m, self.data.W)\n                table.name = self.data.name\n                table.ids = np.array(self.data.ids)\n                table.attributes = getattr(self.data, 'attributes', {})\n                self._inspect_discrete_variables(domain)\n            if renamed:\n                self.Warning.renamed_vars(f\"Renamed: {', '.join(renamed)}\")\n\n        self.Warning.multiple_targets(\n            shown=table is not None and len(table.domain.class_vars) > 1)\n        self.Outputs.data.send(table)\n        self.apply_button.setEnabled(False)\n\n    def get_widget_name_extension(self):\n        _, name = os.path.split(self.loaded_file)\n        return os.path.splitext(name)[0]\n\n    def send_report(self):\n        def get_ext_name(filename):\n            try:\n                return FileFormat.names[os.path.splitext(filename)[1]]\n            except KeyError:\n                return \"unknown\"\n\n        if self.data is None:\n            self.report_paragraph(\"File\", \"No file.\")\n            return\n\n        if self.source == self.LOCAL_FILE:\n            home = os.path.expanduser(\"~\")\n            if self.loaded_file.startswith(home):\n                # os.path.join does not like ~\n                name = \"~\" + os.path.sep + \\\n                       self.loaded_file[len(home):].lstrip(\"/\").lstrip(\"\\\\\")\n            else:\n                name = self.loaded_file\n            if self.sheet_combo.isVisible():\n                name += f\" ({self.sheet_combo.currentText()})\"\n            self.report_items(\"File\", [(\"File name\", name),\n                                       (\"Format\", get_ext_name(name))])\n        else:\n            self.report_items(\"Data\", [(\"Resource\", self.url),\n                                       (\"Format\", get_ext_name(self.url))])\n\n        self.report_data(\"Data\", self.data)\n\n    @staticmethod\n    def dragEnterEvent(event):\n        \"\"\"Accept drops of valid file urls\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            try:\n                FileFormat.get_reader(urls[0].toLocalFile())\n                event.acceptProposedAction()\n            except MissingReaderException:\n                pass\n\n    def dropEvent(self, event):\n        \"\"\"Handle file drops\"\"\"\n        urls = event.mimeData().urls()\n        if urls:\n            self.add_path(urls[0].toLocalFile())  # add first file\n            self.source = self.LOCAL_FILE\n            self.load_data()\n\n    def workflowEnvChanged(self, key, value, oldvalue):\n        \"\"\"\n        Function called when environment changes (e.g. while saving the scheme)\n        It make sure that all environment connected values are modified\n        (e.g. relative file paths are changed)\n        \"\"\"\n        self.update_file_list(key, value, oldvalue)\n\n\nclass OWFileDropHandler(SingleUrlDropHandler):\n    WIDGET = OWFile\n\n    def canDropUrl(self, url: QUrl) -> bool:\n        if url.isLocalFile():\n            try:\n                FileFormat.get_reader(url.toLocalFile())\n                return True\n            except Exception:  # noqa # pylint:disable=broad-except\n                return False\n        else:\n            return url.scheme().lower() in (\"http\", \"https\", \"ftp\")\n\n    def parametersFromUrl(self, url: QUrl) -> Dict[str, Any]:\n        if url.isLocalFile():\n            path = url.toLocalFile()\n            r = RecentPath(os.path.abspath(path), None, None,\n                           os.path.basename(path))\n            return {\n                \"recent_paths\": stored_recent_paths_prepend(self.WIDGET, r),\n                \"source\": OWFile.LOCAL_FILE,\n            }\n        else:\n            return {\n                \"recent_urls\": [url.toString()],\n                \"source\": OWFile.URL,\n            }\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWFile).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:** Recent URLs Not Reordered When Re-entered

**Description:**
When a user re-enters an existing URL into the recent URLs list, the URL should move to the top of the list to indicate it was recently used. However, currently, re-entering a URL does not change its position in the list.

**Example Code:**
```python
# Add initial URLs to the recent list
widget.url_combo.insertItem(0, "https://example.com/test.tab")
widget.url_combo.insertItem(1, "https://example.com/test1.tab")
widget.source = OWFile.URL

# Serialize the settings
settings = widget.settingsHandler.pack_data(widget)
print(settings["recent_urls"])
# Output: ["https://example.com/test.tab", "https://example.com/test1.tab"]

# Re-enter an existing URL
widget.url_combo.lineEdit().clear()
QTest.keyClicks(widget.url_combo, "https://example.com/test1.tab")
QTest.keyClick(widget.url_combo, Qt.Key_Enter)

# Serialize the settings again
settings = widget.settingsHandler.pack_data(widget)
print(settings["recent_urls"])
# Expected Output: ["https://example.com/test1.tab", "https://example.com/test.tab"]
# Actual Output: ["https://example.com/test.tab", "https://example.com/test1.tab"]
```

**Expected Behavior:**
When an existing URL is re-entered, it should automatically move to the top of the recent URLs list, indicating it as the most recently used.

**Actual Behavior:**
Re-entering an existing URL does not change its position in the recent URLs list. The URL remains in its original position, failing to reflect its recent usage.

[/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/owfile.py
import os
import logging
from itertools import chain
from urllib.parse import urlparse
from typing import List, Dict, Any

import numpy as np
from AnyQt.QtWidgets import \
    QStyle, QComboBox, QMessageBox, QGridLayout, QLabel, \
    QLineEdit, QSizePolicy as Policy, QCompleter
from AnyQt.QtCore import Qt, QTimer, QSize, QUrl
from AnyQt.QtGui import QBrush

from orangewidget.utils.filedialogs import format_filter
from orangewidget.workflow.drophandler import SingleUrlDropHandler

from Orange.data.table import Table, get_sample_datasets_dir
from Orange.data.io import FileFormat, UrlReader, class_from_qualified_name
from Orange.data.io_base import MissingReaderException
from Orange.util import log_warnings
from Orange.widgets import widget, gui
from Orange.widgets.utils.localization import pl
from Orange.widgets.settings import Setting, ContextSetting, \
    PerfectDomainContextHandler, SettingProvider
from Orange.widgets.utils.domaineditor import DomainEditor
from Orange.widgets.utils.itemmodels import PyListModel
from Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \
    open_filename_dialog, stored_recent_paths_prepend
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Output, Msg

# Backward compatibility: class RecentPath used to be defined in this module,
# and it is used in saved (pickled) settings. It must be imported into the
# module's namespace so that old saved settings still work
from Orange.widgets.utils.filedialogs import RecentPath

DEFAULT_READER_TEXT = "Automatically detect type"

log = logging.getLogger(__name__)


def add_origin(examples, filename):
    """
    Adds attribute with file location to each string variable
    Used for relative filenames stored in string variables (e.g. pictures)
    TODO: we should consider a cleaner solution (special variable type, ...)
    """
    if not filename:
        return
    strings = [var
               for var in examples.domain.variables + examples.domain.metas
               if var.is_string]
    dir_name, _ = os.path.split(filename)
    for var in strings:
        if "type" in var.attributes and "origin" not in var.attributes:
            var.attributes["origin"] = dir_name


class NamedURLModel(PyListModel):
    def __init__(self, mapping):
        self.mapping = mapping
        super().__init__()

    def data(self, index, role=Qt.DisplayRole):
        data = super().data(index, role)
        if role == Qt.DisplayRole:
            return self.mapping.get(data, data)
        return data

    def add_name(self, url, name):
        self.mapping[url] = name
        self.modelReset.emit()


class LineEditSelectOnFocus(QLineEdit):
    def focusInEvent(self, event):
        super().focusInEvent(event)
        # If selectAll is called directly, placing the cursor unselects the text
        QTimer.singleShot(0, self.selectAll)


class OWFile(widget.OWWidget, RecentPathsWComboMixin):
    name = "File"
    id = "orange.widgets.data.file"
    description = "Read data from an input file or network " \
                  "and send a data table to the output."
    icon = "icons/File.svg"
    priority = 10
    category = "Data"
    keywords = ["file", "load", "read", "open"]

    class Outputs:
        data = Output("Data", Table,
                      doc="Attribute-valued dataset read from the input file.")

    want_main_area = False
    buttons_area_orientation = None

    SEARCH_PATHS = [("sample-datasets", get_sample_datasets_dir())]
    SIZE_LIMIT = 1e7
    LOCAL_FILE, URL = range(2)

    settingsHandler = PerfectDomainContextHandler(
        match_values=PerfectDomainContextHandler.MATCH_VALUES_ALL
    )

    # pylint seems to want declarations separated from definitions
    recent_paths: List[RecentPath]
    recent_urls: List[str]
    variables: list

    # Overload RecentPathsWidgetMixin.recent_paths to set defaults
    recent_paths = Setting([
        RecentPath("", "sample-datasets", "iris.tab"),
        RecentPath("", "sample-datasets", "titanic.tab"),
        RecentPath("", "sample-datasets", "housing.tab"),
        RecentPath("", "sample-datasets", "heart_disease.tab"),
        RecentPath("", "sample-datasets", "brown-selected.tab"),
        RecentPath("", "sample-datasets", "zoo.tab"),
    ])
    recent_urls = Setting([])
    source = Setting(LOCAL_FILE)
    sheet_names = Setting({})
    url = Setting("")

    variables = ContextSetting([])

    domain_editor = SettingProvider(DomainEditor)

    class Information(widget.OWWidget.Information):
        no_file_selected = Msg("No file selected.")

    class Warning(widget.OWWidget.Warning):
        file_too_big = Msg("The file is too large to load automatically."
                           " Press Reload to load.")
        load_warning = Msg("Read warning:\n{}")
        performance_warning = Msg(
            "Categorical variables with >100 values may decrease performance.")
        renamed_vars = Msg("Some variables have been renamed "
                           "to avoid duplicates.\n{}")
        multiple_targets = Msg("Most widgets do not support multiple targets")

    class Error(widget.OWWidget.Error):
        file_not_found = Msg("File not found.")
        missing_reader = Msg("Missing reader.")
        sheet_error = Msg("Error listing available sheets.")
        unknown = Msg("Read error:\n{}")

    UserAdviceMessages = [
        widget.Message(
            "Use CSV File Import widget for advanced options "
            "for comma-separated files",
            "use-csv-file-import"),
        widget.Message(
            "This widget loads only tabular data. Use other widgets to load "
            "other data types like models, distance matrices and networks.",
            "other-data-types"
        )
    ]

    def __init__(self):
        super().__init__()
        RecentPathsWComboMixin.__init__(self)
        self.domain = None
        self.data = None
        self.loaded_file = ""
        self.reader = None

        readers = [f for f in FileFormat.formats
                   if getattr(f, 'read', None)
                   and getattr(f, "EXTENSIONS", None)]

        def group_readers_per_addon_key(w):
            # readers from Orange.data.io should go first
            def package(w):
                package = w.qualified_name().split(".")[:-1]
                package = package[:2]
                if ".".join(package) == "Orange.data":
                    return ["0"]  # force "Orange" to come first
                return package
            return package(w), w.DESCRIPTION

        self.available_readers = sorted(set(readers),
                                        key=group_readers_per_addon_key)

        layout = QGridLayout()
        layout.setSpacing(4)
        gui.widgetBox(self.controlArea, orientation=layout, box='Source')
        vbox = gui.radioButtons(None, self, "source", box=True,
                                callback=self.load_data, addToLayout=False)

        rb_button = gui.appendRadioButton(vbox, "File:", addToLayout=False)
        layout.addWidget(rb_button, 0, 0, Qt.AlignVCenter)

        box = gui.hBox(None, addToLayout=False, margin=0)
        box.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.file_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.file_combo.setMinimumSize(QSize(100, 1))
        self.file_combo.activated[int].connect(self.select_file)
        box.layout().addWidget(self.file_combo)
        layout.addWidget(box, 0, 1)

        file_button = gui.button(
            None, self, '...', callback=self.browse_file, autoDefault=False)
        file_button.setIcon(self.style().standardIcon(QStyle.SP_DirOpenIcon))
        file_button.setSizePolicy(Policy.Maximum, Policy.Fixed)
        layout.addWidget(file_button, 0, 2)

        reload_button = gui.button(
            None, self, "Reload", callback=self.load_data, autoDefault=False)
        reload_button.setIcon(self.style().standardIcon(
            QStyle.SP_BrowserReload))
        reload_button.setSizePolicy(Policy.Fixed, Policy.Fixed)
        layout.addWidget(reload_button, 0, 3)

        self.sheet_box = gui.hBox(None, addToLayout=False, margin=0)
        self.sheet_combo = QComboBox()
        self.sheet_combo.textActivated.connect(self.select_sheet)
        self.sheet_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.sheet_combo.setMinimumSize(QSize(50, 1))
        self.sheet_label = QLabel()
        self.sheet_label.setText('Sheet')
        self.sheet_label.setSizePolicy(
            Policy.MinimumExpanding, Policy.Fixed)
        self.sheet_box.layout().addWidget(
            self.sheet_label, Qt.AlignLeft)
        self.sheet_box.layout().addWidget(
            self.sheet_combo, Qt.AlignVCenter)
        layout.addWidget(self.sheet_box, 2, 1)
        self.sheet_box.hide()

        rb_button = gui.appendRadioButton(vbox, "URL:", addToLayout=False)
        layout.addWidget(rb_button, 3, 0, Qt.AlignVCenter)

        self.url_combo = url_combo = QComboBox()
        url_model = NamedURLModel(self.sheet_names)
        url_model.wrap(self.recent_urls)
        url_combo.setLineEdit(LineEditSelectOnFocus())
        url_combo.setModel(url_model)
        url_combo.setSizePolicy(Policy.Ignored, Policy.Fixed)
        url_combo.setEditable(True)
        url_combo.setInsertPolicy(url_combo.InsertAtTop)
        url_edit = url_combo.lineEdit()
        margins = url_edit.textMargins()
        l, t, r, b = margins.left(), margins.top(), margins.right(), margins.bottom()
        url_edit.setTextMargins(l + 5, t, r, b)
        layout.addWidget(url_combo, 3, 1, 1, 3)
        url_combo.activated.connect(self._url_set)
        # whit completer we set that combo box is case sensitive when
        # matching the history
        completer = QCompleter()
        completer.setCaseSensitivity(Qt.CaseSensitive)
        url_combo.setCompleter(completer)

        layout = QGridLayout()
        layout.setSpacing(4)
        gui.widgetBox(self.controlArea, orientation=layout, box='File Type')

        box = gui.hBox(None, addToLayout=False, margin=0)
        box.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.reader_combo = QComboBox(self)
        self.reader_combo.setSizePolicy(Policy.Expanding, Policy.Fixed)
        self.reader_combo.setMinimumSize(QSize(100, 1))
        self.reader_combo.activated[int].connect(self.select_reader)

        box.layout().addWidget(self.reader_combo)
        layout.addWidget(box, 0, 1)

        box = gui.vBox(self.controlArea, "Info")
        self.infolabel = gui.widgetLabel(box, 'No data loaded.')

        box = gui.widgetBox(self.controlArea, "Columns (Double click to edit)")
        self.domain_editor = DomainEditor(self)
        self.editor_model = self.domain_editor.model()
        box.layout().addWidget(self.domain_editor)

        box = gui.hBox(box)
        gui.button(
            box, self, "Reset", callback=self.reset_domain_edit,
            autoDefault=False
        )
        gui.rubber(box)
        self.apply_button = gui.button(
            box, self, "Apply", callback=self.apply_domain_edit)
        self.apply_button.setEnabled(False)
        self.apply_button.setFixedWidth(170)
        self.editor_model.dataChanged.connect(
            lambda: self.apply_button.setEnabled(True))

        hBox = gui.hBox(self.controlArea)
        gui.rubber(hBox)
        gui.button(
            hBox, self, "Browse documentation datasets",
            callback=lambda: self.browse_file(True), autoDefault=False)
        gui.rubber(hBox)

        self.set_file_list()
        # Must not call open_file from within __init__. open_file
        # explicitly re-enters the event loop (by a progress bar)

        self.setAcceptDrops(True)

        if self.source == self.LOCAL_FILE:
            last_path = self.last_path()
            if last_path and os.path.exists(last_path) and \
                    os.path.getsize(last_path) > self.SIZE_LIMIT:
                self.Warning.file_too_big()
                return

        QTimer.singleShot(0, self.load_data)

    @staticmethod
    def sizeHint():
        return QSize(600, 550)

    def select_file(self, n):
        assert n < len(self.recent_paths)
        super().select_file(n)
        if self.recent_paths:
            self.source = self.LOCAL_FILE
            self.load_data()
            self.set_file_list()

    def select_sheet(self):
        self.recent_paths[0].sheet = self.sheet_combo.currentText()
        self.load_data()

    def select_reader(self, n):
        if self.source != self.LOCAL_FILE:
            return  # ignore for URL's

        if self.recent_paths:
            path = self.recent_paths[0]
            if n == 0:  # default
                path.file_format = None
                self.load_data()
            elif n <= len(self.available_readers):
                reader = self.available_readers[n - 1]
                path.file_format = reader.qualified_name()
                self.load_data()
            else:  # the rest include just qualified names
                path.file_format = self.reader_combo.itemText(n)
                self.load_data()

    def _url_set(self):
        url = self.url_combo.currentText()
        pos = self.recent_urls.index(url)
        url = url.strip()

        if not urlparse(url).scheme:
            url = 'http://' + url
            self.url_combo.setItemText(pos, url)
            self.recent_urls[pos] = url

        self.source = self.URL
        self.load_data()

    def browse_file(self, in_demos=False):
        if in_demos:
            start_file = get_sample_datasets_dir()
            if not os.path.exists(start_file):
                QMessageBox.information(
                    None, "File",
                    "Cannot find the directory with documentation datasets")
                return
        else:
            start_file = self.last_path() or os.path.expanduser("~/")

        filename, reader, _ = open_filename_dialog(start_file, None, self.available_readers)
        if not filename:
            return
        self.add_path(filename)
        if reader is not None:
            self.recent_paths[0].file_format = reader.qualified_name()

        self.source = self.LOCAL_FILE
        self.load_data()

    # Open a file, create data from it and send it over the data channel
    def load_data(self):
        # We need to catch any exception type since anything can happen in
        # file readers
        self.closeContext()
        self.domain_editor.set_domain(None)
        self.apply_button.setEnabled(False)
        self.clear_messages()
        self.set_file_list()

        error = self._try_load()
        if error:
            error()
            self.data = None
            self.sheet_box.hide()
            self.Outputs.data.send(None)
            self.infolabel.setText("No data.")

    def _try_load(self):
        self._initialize_reader_combo()

        # pylint: disable=broad-except
        if self.source == self.LOCAL_FILE:
            if self.last_path() is None:
                return self.Information.no_file_selected
            elif not os.path.exists(self.last_path()):
                return self.Error.file_not_found
        else:
            url = self.url_combo.currentText().strip()
            if not url:
                return self.Information.no_file_selected

        def mark_problematic_reader():
            self.reader_combo.setItemData(self.reader_combo.currentIndex(),
                                          QBrush(Qt.red), Qt.ForegroundRole)

        try:
            self.reader = self._get_reader()  # also sets current reader index
            assert self.reader is not None
        except MissingReaderException:
            mark_problematic_reader()
            return self.Error.missing_reader
        except Exception as ex:
            mark_problematic_reader()
            log.exception(ex)
            return lambda x=ex: self.Error.unknown(str(x))

        try:
            self._update_sheet_combo()
        except Exception:
            return self.Error.sheet_error

        with log_warnings() as warnings:
            try:
                data = self.reader.read()
            except Exception as ex:
                mark_problematic_reader()
                log.exception(ex)
                return lambda x=ex: self.Error.unknown(str(x))
            if warnings:
                self.Warning.load_warning(warnings[-1].message.args[0])

        self.infolabel.setText(self._describe(data))

        self.loaded_file = self.last_path()
        add_origin(data, self.loaded_file)
        self.data = data
        self.openContext(data.domain)
        self.apply_domain_edit()  # sends data
        return None

    def _get_reader(self) -> FileFormat:
        if self.source == self.LOCAL_FILE:
            path = self.last_path()
            self.reader_combo.setEnabled(True)
            if self.recent_paths and self.recent_paths[0].file_format:
                qname = self.recent_paths[0].file_format
                qname_index = {r.qualified_name(): i for i, r in enumerate(self.available_readers)}
                if qname in qname_index:
                    self.reader_combo.setCurrentIndex(qname_index[qname] + 1)
                else:
                    # reader may be accessible, but not in self.available_readers
                    # (perhaps its code was moved)
                    self.reader_combo.addItem(qname)
                    self.reader_combo.setCurrentIndex(len(self.reader_combo) - 1)
                try:
                    reader_class = class_from_qualified_name(qname)
                except Exception as ex:
                    raise MissingReaderException(f'Can not find reader "{qname}"') from ex
                reader = reader_class(path)
            else:
                self.reader_combo.setCurrentIndex(0)
                reader = FileFormat.get_reader(path)
            if self.recent_paths and self.recent_paths[0].sheet:
                reader.select_sheet(self.recent_paths[0].sheet)
            return reader
        else:
            url = self.url_combo.currentText().strip()
            return UrlReader(url)

    def _update_sheet_combo(self):
        if len(self.reader.sheets) < 2:
            self.sheet_box.hide()
            self.reader.select_sheet(None)
            return

        self.sheet_combo.clear()
        self.sheet_combo.addItems(self.reader.sheets)
        self._select_active_sheet()
        self.sheet_box.show()

    def _select_active_sheet(self):
        try:
            idx = self.reader.sheets.index(self.reader.sheet)
            self.sheet_combo.setCurrentIndex(idx)
        except ValueError:
            # Requested sheet does not exist in this file
            self.reader.select_sheet(None)
            self.sheet_combo.setCurrentIndex(0)

    def _initialize_reader_combo(self):
        self.reader_combo.clear()
        filters = [format_filter(f) for f in self.available_readers]
        self.reader_combo.addItems([DEFAULT_READER_TEXT] + filters)
        self.reader_combo.setCurrentIndex(0)
        self.reader_combo.setDisabled(True)
        # additional readers may be added in self._get_reader()

    @staticmethod
    def _describe(table):
        def missing_prop(prop):
            if prop:
                return f"({prop * 100:.1f}% missing values)"
            else:
                return "(no missing values)"

        domain = table.domain
        text = ""

        attrs = getattr(table, "attributes", {})
        descs = [attrs[desc]
                 for desc in ("Name", "Description") if desc in attrs]
        if len(descs) == 2:
            descs[0] = f"<b>{descs[0]}</b>"
        if descs:
            text += f"<p>{'<br/>'.join(descs)}</p>"

        text += f"<p>{len(table)} {pl(len(table), 'instance')}"

        missing_in_attr = missing_in_class = ""
        if table.X.size < OWFile.SIZE_LIMIT:
            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())
            missing_in_class = missing_prop(table.get_nan_frequency_class())
        nattrs = len(domain.attributes)
        text += f"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}"
        if domain.has_continuous_class:
            text += f"<br/>Regression; numerical class {missing_in_class}"
        elif domain.has_discrete_class:
            nvals = len(domain.class_var.values)
            text += "<br/>Classification; categorical class " \
                f"with {nvals} {pl(nvals, 'value')} {missing_in_class}"
        elif table.domain.class_vars:
            ntargets = len(table.domain.class_vars)
            text += "<br/>Multi-target; " \
                f"{ntargets} target {pl(ntargets, 'variable')} " \
                f"{missing_in_class}"
        else:
            text += "<br/>Data has no target variable."
        nmetas = len(domain.metas)
        text += f"<br/>{nmetas} {pl(nmetas, 'meta attribute')}"
        text += "</p>"

        if 'Timestamp' in table.domain:
            # Google Forms uses this header to timestamp responses
            text += f"<p>First entry: {table[0, 'Timestamp']}<br/>" \
                f"Last entry: {table[-1, 'Timestamp']}</p>"
        return text

    def storeSpecificSettings(self):
        self.current_context.modified_variables = self.variables[:]

    def retrieveSpecificSettings(self):
        if hasattr(self.current_context, "modified_variables"):
            self.variables[:] = self.current_context.modified_variables

    def reset_domain_edit(self):
        self.domain_editor.reset_domain()
        self.apply_domain_edit()

    def _inspect_discrete_variables(self, domain):
        for var in chain(domain.variables, domain.metas):
            if var.is_discrete and len(var.values) > 100:
                self.Warning.performance_warning()

    def apply_domain_edit(self):
        self.Warning.performance_warning.clear()
        self.Warning.renamed_vars.clear()
        if self.data is None:
            table = None
        else:
            domain, cols, renamed = \
                self.domain_editor.get_domain(self.data.domain, self.data,
                                              deduplicate=True)
            if not (domain.variables or domain.metas):
                table = None
            elif domain is self.data.domain:
                table = self.data
            else:
                X, y, m = cols
                table = Table.from_numpy(domain, X, y, m, self.data.W)
                table.name = self.data.name
                table.ids = np.array(self.data.ids)
                table.attributes = getattr(self.data, 'attributes', {})
                self._inspect_discrete_variables(domain)
            if renamed:
                self.Warning.renamed_vars(f"Renamed: {', '.join(renamed)}")

        self.Warning.multiple_targets(
            shown=table is not None and len(table.domain.class_vars) > 1)
        self.Outputs.data.send(table)
        self.apply_button.setEnabled(False)

    def get_widget_name_extension(self):
        _, name = os.path.split(self.loaded_file)
        return os.path.splitext(name)[0]

    def send_report(self):
        def get_ext_name(filename):
            try:
                return FileFormat.names[os.path.splitext(filename)[1]]
            except KeyError:
                return "unknown"

        if self.data is None:
            self.report_paragraph("File", "No file.")
            return

        if self.source == self.LOCAL_FILE:
            home = os.path.expanduser("~")
            if self.loaded_file.startswith(home):
                # os.path.join does not like ~
                name = "~" + os.path.sep + \
                       self.loaded_file[len(home):].lstrip("/").lstrip("\\")
            else:
                name = self.loaded_file
            if self.sheet_combo.isVisible():
                name += f" ({self.sheet_combo.currentText()})"
            self.report_items("File", [("File name", name),
                                       ("Format", get_ext_name(name))])
        else:
            self.report_items("Data", [("Resource", self.url),
                                       ("Format", get_ext_name(self.url))])

        self.report_data("Data", self.data)

    @staticmethod
    def dragEnterEvent(event):
        """Accept drops of valid file urls"""
        urls = event.mimeData().urls()
        if urls:
            try:
                FileFormat.get_reader(urls[0].toLocalFile())
                event.acceptProposedAction()
            except MissingReaderException:
                pass

    def dropEvent(self, event):
        """Handle file drops"""
        urls = event.mimeData().urls()
        if urls:
            self.add_path(urls[0].toLocalFile())  # add first file
            self.source = self.LOCAL_FILE
            self.load_data()

    def workflowEnvChanged(self, key, value, oldvalue):
        """
        Function called when environment changes (e.g. while saving the scheme)
        It make sure that all environment connected values are modified
        (e.g. relative file paths are changed)
        """
        self.update_file_list(key, value, oldvalue)


class OWFileDropHandler(SingleUrlDropHandler):
    WIDGET = OWFile

    def canDropUrl(self, url: QUrl) -> bool:
        if url.isLocalFile():
            try:
                FileFormat.get_reader(url.toLocalFile())
                return True
            except Exception:  # noqa # pylint:disable=broad-except
                return False
        else:
            return url.scheme().lower() in ("http", "https", "ftp")

    def parametersFromUrl(self, url: QUrl) -> Dict[str, Any]:
        if url.isLocalFile():
            path = url.toLocalFile()
            r = RecentPath(os.path.abspath(path), None, None,
                           os.path.basename(path))
            return {
                "recent_paths": stored_recent_paths_prepend(self.WIDGET, r),
                "source": OWFile.LOCAL_FILE,
            }
        else:
            return {
                "recent_urls": [url.toString()],
                "source": OWFile.URL,
            }


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWFile).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