{
    "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_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\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",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/owfile.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "85d9b567f",
                "new_commit_hash": "fb3ae2dda",
                "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": 525,
                            "length": 8
                        },
                        "new_range": {
                            "start": 525,
                            "length": 10
                        },
                        "section": "class OWFile(widget.OWWidget, RecentPathsWComboMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        text += f\"<p>{len(table)} {pl(len(table), 'instance')}\"",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        missing_in_attr = missing_prop(table.get_nan_frequency_attribute())",
                                "type": "deleted"
                            },
                            {
                                "content": "        missing_in_class = missing_prop(table.get_nan_frequency_class())",
                                "type": "deleted"
                            },
                            {
                                "content": "        missing_in_attr = missing_in_class = \"\"",
                                "type": "added"
                            },
                            {
                                "content": "        if table.X.size < OWFile.SIZE_LIMIT:",
                                "type": "added"
                            },
                            {
                                "content": "            missing_in_attr = missing_prop(table.get_nan_frequency_attribute())",
                                "type": "added"
                            },
                            {
                                "content": "            missing_in_class = missing_prop(table.get_nan_frequency_class())",
                                "type": "added"
                            },
                            {
                                "content": "        nattrs = len(domain.attributes)",
                                "type": "context"
                            },
                            {
                                "content": "        text += f\"<br/>{nattrs} {pl(nattrs, 'feature')} {missing_in_attr}\"",
                                "type": "context"
                            },
                            {
                                "content": "        if domain.has_continuous_class:",
                                "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_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": 657,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owfile.py",
                            "type": "method",
                            "name": "OWFile._describe",
                            "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_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": 508,
                            "end_lineno": 553,
                            "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_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": 657,
                                "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_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.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(self):\n        table = Table(\"iris\")\n        description = f\"<p><b>Iris flower dataset</b><br/>\" \\\n                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\\n                      f\"<p>150 instance(s)<br/>\" \\\n                      f\"4 feature(s) (no missing values)<br/>\" \\\n                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        description = f\"<p>10000 instance(s)<br/>\" \\\n                      f\"1000 feature(s) <br/>\" \\\n                      f\"Data has no target variable.<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\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",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/tests/test_owfile.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "ded88b37e",
                "new_commit_hash": "9bbe6708b",
                "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": 76,
                            "length": 6
                        },
                        "new_range": {
                            "start": 76,
                            "length": 23
                        },
                        "section": "class TestOWFile(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    def tearDown(self):",
                                "type": "context"
                            },
                            {
                                "content": "        dataset_dirs.pop()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_describe(self):",
                                "type": "added"
                            },
                            {
                                "content": "        table = Table(\"iris\")",
                                "type": "added"
                            },
                            {
                                "content": "        description = f\"<p><b>Iris flower dataset</b><br/>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"<p>150 instance(s)<br/>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"4 feature(s) (no missing values)<br/>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"0 meta attribute(s)</p>\"",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(description, self.widget._describe(table))",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))",
                                "type": "added"
                            },
                            {
                                "content": "        description = f\"<p>10000 instance(s)<br/>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"1000 feature(s) <br/>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"Data has no target variable.<br/>\" \\",
                                "type": "added"
                            },
                            {
                                "content": "                      f\"0 meta attribute(s)</p>\"",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(description, self.widget._describe(table))",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_dragEnterEvent_accepts_urls(self):",
                                "type": "context"
                            },
                            {
                                "content": "        event = self._drag_enter_event(QUrl.fromLocalFile(TITANIC_PATH))",
                                "type": "context"
                            },
                            {
                                "content": "        self.widget.dragEnterEvent(event)",
                                "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(self):\n        table = Table(\"iris\")\n        description = f\"<p><b>Iris flower dataset</b><br/>\" \\\n                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\\n                      f\"<p>150 instance(s)<br/>\" \\\n                      f\"4 feature(s) (no missing values)<br/>\" \\\n                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        description = f\"<p>10000 instance(s)<br/>\" \\\n                      f\"1000 feature(s) <br/>\" \\\n                      f\"Data has no target variable.<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\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))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 67,
                            "end_lineno": 720,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owfile.py",
                            "type": "method",
                            "name": "TestOWFile.test_describe",
                            "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(self):\n        table = Table(\"iris\")\n        description = f\"<p><b>Iris flower dataset</b><br/>\" \\\n                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\\n                      f\"<p>150 instance(s)<br/>\" \\\n                      f\"4 feature(s) (no missing values)<br/>\" \\\n                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        description = f\"<p>10000 instance(s)<br/>\" \\\n                      f\"1000 feature(s) <br/>\" \\\n                      f\"Data has no target variable.<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\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))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 79,
                            "end_lineno": 94,
                            "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(self):\n        table = Table(\"iris\")\n        description = f\"<p><b>Iris flower dataset</b><br/>\" \\\n                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\\n                      f\"<p>150 instance(s)<br/>\" \\\n                      f\"4 feature(s) (no missing values)<br/>\" \\\n                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        description = f\"<p>10000 instance(s)<br/>\" \\\n                      f\"1000 feature(s) <br/>\" \\\n                      f\"Data has no target variable.<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\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))",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 67,
                                "end_lineno": 720,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "from datetime import date\nfrom html import escape\n\nfrom AnyQt.QtCore import Qt\n\nfrom orangewidget.utils.signals import summarize, PartialSummary\nfrom Orange.widgets.utils.itemmodels import TableModel\nfrom Orange.widgets.utils.tableview import TableView\n\nfrom Orange.data import (\n    StringVariable, DiscreteVariable, ContinuousVariable, TimeVariable,\n    Table\n)\n\nfrom Orange.evaluation import Results\nfrom Orange.misc import DistMatrix\nfrom Orange.preprocess import Preprocess, PreprocessorList\nfrom Orange.preprocess.score import Scorer\nfrom Orange.widgets.utils.signals import AttributeList\nfrom Orange.base import Model, Learner\n\n\ndef format_variables_string(variables):\n    \"\"\"\n    A function that formats the descriptive part of the input/output summary for\n    either features, targets or metas of the input dataset.\n\n    :param variables: Features, targets or metas of the input dataset\n    :return: A formatted string\n    \"\"\"\n    if not variables:\n        return '—'\n\n    agg = []\n    for var_type_name, var_type in [('categorical', DiscreteVariable),\n                                    ('numeric', ContinuousVariable),\n                                    ('time', TimeVariable),\n                                    ('string', StringVariable)]:\n        # Disable pylint here because a `TimeVariable` is also a\n        # `ContinuousVariable`, and should be labelled as such. That is why\n        # it is necessary to check the type this way instead of using\n        # `isinstance`, which would fail in the above case\n        var_type_list = [v for v in variables if type(v) is var_type]  # pylint: disable=unidiomatic-typecheck\n        if var_type_list:\n            agg.append((var_type_name, len(var_type_list)))\n\n    attrs, counts = list(zip(*agg))\n    if len(attrs) > 1:\n        var_string = [f'{i} {j}' for i, j in zip(counts, attrs)]\n        var_string = f'{sum(counts)} ({\", \".join(var_string)})'\n    elif counts[0] == 1:\n        var_string = attrs[0]\n    else:\n        var_string = f'{counts[0]} {attrs[0]}'\n    return var_string\n\n\ndef _plural(number):\n    return 's' * (number % 100 != 1)\n\n\n# `format` is a good name for the argument, pylint: disable=redefined-builtin\ndef format_summary_details(data, format=Qt.PlainText):\n    \"\"\"\n    A function that forms the entire descriptive part of the input/output\n    summary.\n\n    :param data: A dataset\n    :type data: Orange.data.Table\n    :return: A formatted string\n    \"\"\"\n    if data is None:\n        return \"\"\n\n    if format == Qt.PlainText:\n        def b(s):\n            return s\n    else:\n        def b(s):\n            return f\"<b>{s}</b>\"\n\n    features = format_variables_string(data.domain.attributes)\n    targets = format_variables_string(data.domain.class_vars)\n    metas = format_variables_string(data.domain.metas)\n\n    features_missing = missing_values(data.get_nan_frequency_attribute())\n    n_features = len(data.domain.variables) + len(data.domain.metas)\n    name = getattr(data, \"name\", None)\n    if name == \"untitled\":\n        name = None\n    basic = f'{len(data):n} instance{_plural(len(data))}, ' \\\n            f'{n_features} variable{_plural(n_features)}'\n\n    if format == Qt.PlainText:\n        details = \\\n            (f\"{name}: \" if name else \"\") + basic \\\n            + f'\\nFeatures: {features} {features_missing}' \\\n            + f'\\nTarget: {targets}'\n        if data.domain.metas:\n            details += f'\\nMetas: {metas}'\n    else:\n        descs = []\n        if name:\n            descs.append(_nobr(f\"<b><u>{escape(name)}</u></b>: {basic}\"))\n        else:\n            descs.append(_nobr(f'{basic}'))\n\n        if data.domain.variables:\n            descs.append(_nobr(f'Features: {features} {features_missing}'))\n        if data.domain.class_vars:\n            descs.append(_nobr(f\"Target: {targets}\"))\n        if data.domain.metas:\n            descs.append(_nobr(f\"Metas: {metas}\"))\n\n        details = '<br/>'.join(descs)\n\n    return details\n\n\ndef missing_values(value):\n    if value:\n        return f'({value*100:.1f}% missing values)'\n    else:\n        return '(no missing values)'\n\n\ndef format_multiple_summaries(data_list, type_io='input'):\n    \"\"\"\n    A function that forms the entire descriptive part of the input/output\n    summary for widgets that have more than one input/output.\n\n    :param data_list: A list of tuples for each input/output dataset where the\n    first element of the tuple is the name of the dataset (can be omitted)\n    and the second is the dataset\n    :type data_list: list(tuple(str, Orange.data.Table))\n    :param type_io: A string that indicates weather the input or output data\n    is being formatted\n    :type type_io: str\n\n    :return A formatted summary\n    :rtype str\n    \"\"\"\n\n    def new_line(text):\n        return text.replace('\\n', '<br>')\n\n    full_details = []\n    for (name, data) in data_list:\n        if data:\n            details = new_line(format_summary_details(data))\n        else:\n            details = f'No data on {type_io}.'\n        full_details.append(details if not name else f'{name}:<br>{details}')\n    return '<hr>'.join(full_details)\n\n\ndef _name_of(object):\n    return _nobr(getattr(object, 'name', type(object).__name__))\n\n\ndef _nobr(s):\n    return f\"<nobr>{s}</nobr>\"\n\n\n@summarize.register\ndef summarize_(data: Table):\n    def previewer():\n        view = TableView(selectionMode=TableView.NoSelection)\n        view.setModel(TableModel(data))\n        return view\n\n    return PartialSummary(\n        data.approx_len(),\n        format_summary_details(data, format=Qt.RichText),\n        previewer)\n\n\n@summarize.register\ndef summarize_(matrix: DistMatrix):  # pylint: disable=function-redefined\n    n, m = matrix.shape\n    return PartialSummary(f\"{n}×{m}\", _nobr(f\"{n}×{m} distance matrix\"))\n\n\n@summarize.register\ndef summarize_(results: Results):  # pylint: disable=function-redefined\n    nmethods, ninstances = results.predicted.shape\n    summary = f\"{nmethods}×{ninstances}\"\n    details = f\"{nmethods} method{_plural(nmethods)} \" \\\n              f\"on {ninstances} test instance{_plural(ninstances)}\"\n    return PartialSummary(summary, _nobr(details))\n\n\n@summarize.register\ndef summarize_(attributes: AttributeList):  # pylint: disable=function-redefined\n    n = len(attributes)\n    if n == 0:\n        details = \"empty list\"\n    elif n <= 3:\n        details = _nobr(\", \".join(var.name for var in attributes))\n    else:\n        details = _nobr(\", \".join(var.name for var in attributes[:2]) +\n                       f\" and {n - 2} others\")\n    return PartialSummary(n, details)\n\n\n@summarize.register\ndef summarize_(preprocessor: Preprocess):\n    if isinstance(preprocessor, PreprocessorList):\n        if preprocessor.preprocessors:\n            details = \"<br/>\".join(map(_name_of, preprocessor.preprocessors))\n        else:\n            details = _nobr(f\"{_name_of(preprocessor)} (empty)\")\n    else:\n        details = _name_of(preprocessor)\n    return PartialSummary(\"🄿\", details)\n\n\ndef summarize_by_name(type_, symbol):\n    @summarize.register\n    def summarize_(model: type_):\n        return PartialSummary(symbol, _name_of(model))\n\n\nsummarize_by_name(Model, \"&#9924;\" if date.today().month == 12 else \"🄼\")\nsummarize_by_name(Learner, \"🄻\")\nsummarize_by_name(Scorer, \"🅂\")\n",
            "new_file_content": "from datetime import date\nfrom html import escape\n\nfrom AnyQt.QtCore import Qt\n\nfrom orangewidget.utils.signals import summarize, PartialSummary\nfrom Orange.widgets.utils.itemmodels import TableModel\nfrom Orange.widgets.utils.tableview import TableView\n\nfrom Orange.data import (\n    StringVariable, DiscreteVariable, ContinuousVariable, TimeVariable,\n    Table\n)\n\nfrom Orange.evaluation import Results\nfrom Orange.misc import DistMatrix\nfrom Orange.preprocess import Preprocess, PreprocessorList\nfrom Orange.preprocess.score import Scorer\nfrom Orange.widgets.utils.signals import AttributeList\nfrom Orange.base import Model, Learner\n\n\nSIZE_LIMIT = 1e7\n\n\ndef format_variables_string(variables):\n    \"\"\"\n    A function that formats the descriptive part of the input/output summary for\n    either features, targets or metas of the input dataset.\n\n    :param variables: Features, targets or metas of the input dataset\n    :return: A formatted string\n    \"\"\"\n    if not variables:\n        return '—'\n\n    agg = []\n    for var_type_name, var_type in [('categorical', DiscreteVariable),\n                                    ('numeric', ContinuousVariable),\n                                    ('time', TimeVariable),\n                                    ('string', StringVariable)]:\n        # Disable pylint here because a `TimeVariable` is also a\n        # `ContinuousVariable`, and should be labelled as such. That is why\n        # it is necessary to check the type this way instead of using\n        # `isinstance`, which would fail in the above case\n        var_type_list = [v for v in variables if type(v) is var_type]  # pylint: disable=unidiomatic-typecheck\n        if var_type_list:\n            agg.append((var_type_name, len(var_type_list)))\n\n    attrs, counts = list(zip(*agg))\n    if len(attrs) > 1:\n        var_string = [f'{i} {j}' for i, j in zip(counts, attrs)]\n        var_string = f'{sum(counts)} ({\", \".join(var_string)})'\n    elif counts[0] == 1:\n        var_string = attrs[0]\n    else:\n        var_string = f'{counts[0]} {attrs[0]}'\n    return var_string\n\n\ndef _plural(number):\n    return 's' * (number % 100 != 1)\n\n\n# `format` is a good name for the argument, pylint: disable=redefined-builtin\ndef format_summary_details(data, format=Qt.PlainText):\n    \"\"\"\n    A function that forms the entire descriptive part of the input/output\n    summary.\n\n    :param data: A dataset\n    :type data: Orange.data.Table\n    :return: A formatted string\n    \"\"\"\n    if data is None:\n        return \"\"\n\n    if format == Qt.PlainText:\n        def b(s):\n            return s\n    else:\n        def b(s):\n            return f\"<b>{s}</b>\"\n\n    features = format_variables_string(data.domain.attributes)\n    targets = format_variables_string(data.domain.class_vars)\n    metas = format_variables_string(data.domain.metas)\n\n    features_missing = \"\"\n    if data.X.size < SIZE_LIMIT:\n        features_missing = missing_values(data.get_nan_frequency_attribute())\n    n_features = len(data.domain.variables) + len(data.domain.metas)\n    name = getattr(data, \"name\", None)\n    if name == \"untitled\":\n        name = None\n    basic = f'{len(data):n} instance{_plural(len(data))}, ' \\\n            f'{n_features} variable{_plural(n_features)}'\n\n    if format == Qt.PlainText:\n        details = \\\n            (f\"{name}: \" if name else \"\") + basic \\\n            + f'\\nFeatures: {features} {features_missing}' \\\n            + f'\\nTarget: {targets}'\n        if data.domain.metas:\n            details += f'\\nMetas: {metas}'\n    else:\n        descs = []\n        if name:\n            descs.append(_nobr(f\"<b><u>{escape(name)}</u></b>: {basic}\"))\n        else:\n            descs.append(_nobr(f'{basic}'))\n\n        if data.domain.variables:\n            descs.append(_nobr(f'Features: {features} {features_missing}'))\n        if data.domain.class_vars:\n            descs.append(_nobr(f\"Target: {targets}\"))\n        if data.domain.metas:\n            descs.append(_nobr(f\"Metas: {metas}\"))\n\n        details = '<br/>'.join(descs)\n\n    return details\n\n\ndef missing_values(value):\n    if value:\n        return f'({value*100:.1f}% missing values)'\n    else:\n        return '(no missing values)'\n\n\ndef format_multiple_summaries(data_list, type_io='input'):\n    \"\"\"\n    A function that forms the entire descriptive part of the input/output\n    summary for widgets that have more than one input/output.\n\n    :param data_list: A list of tuples for each input/output dataset where the\n    first element of the tuple is the name of the dataset (can be omitted)\n    and the second is the dataset\n    :type data_list: list(tuple(str, Orange.data.Table))\n    :param type_io: A string that indicates weather the input or output data\n    is being formatted\n    :type type_io: str\n\n    :return A formatted summary\n    :rtype str\n    \"\"\"\n\n    def new_line(text):\n        return text.replace('\\n', '<br>')\n\n    full_details = []\n    for (name, data) in data_list:\n        if data:\n            details = new_line(format_summary_details(data))\n        else:\n            details = f'No data on {type_io}.'\n        full_details.append(details if not name else f'{name}:<br>{details}')\n    return '<hr>'.join(full_details)\n\n\ndef _name_of(object):\n    return _nobr(getattr(object, 'name', type(object).__name__))\n\n\ndef _nobr(s):\n    return f\"<nobr>{s}</nobr>\"\n\n\n@summarize.register\ndef summarize_(data: Table):\n    def previewer():\n        view = TableView(selectionMode=TableView.NoSelection)\n        view.setModel(TableModel(data))\n        return view\n\n    return PartialSummary(\n        data.approx_len(),\n        format_summary_details(data, format=Qt.RichText),\n        previewer)\n\n\n@summarize.register\ndef summarize_(matrix: DistMatrix):  # pylint: disable=function-redefined\n    n, m = matrix.shape\n    return PartialSummary(f\"{n}×{m}\", _nobr(f\"{n}×{m} distance matrix\"))\n\n\n@summarize.register\ndef summarize_(results: Results):  # pylint: disable=function-redefined\n    nmethods, ninstances = results.predicted.shape\n    summary = f\"{nmethods}×{ninstances}\"\n    details = f\"{nmethods} method{_plural(nmethods)} \" \\\n              f\"on {ninstances} test instance{_plural(ninstances)}\"\n    return PartialSummary(summary, _nobr(details))\n\n\n@summarize.register\ndef summarize_(attributes: AttributeList):  # pylint: disable=function-redefined\n    n = len(attributes)\n    if n == 0:\n        details = \"empty list\"\n    elif n <= 3:\n        details = _nobr(\", \".join(var.name for var in attributes))\n    else:\n        details = _nobr(\", \".join(var.name for var in attributes[:2]) +\n                       f\" and {n - 2} others\")\n    return PartialSummary(n, details)\n\n\n@summarize.register\ndef summarize_(preprocessor: Preprocess):\n    if isinstance(preprocessor, PreprocessorList):\n        if preprocessor.preprocessors:\n            details = \"<br/>\".join(map(_name_of, preprocessor.preprocessors))\n        else:\n            details = _nobr(f\"{_name_of(preprocessor)} (empty)\")\n    else:\n        details = _name_of(preprocessor)\n    return PartialSummary(\"🄿\", details)\n\n\ndef summarize_by_name(type_, symbol):\n    @summarize.register\n    def summarize_(model: type_):\n        return PartialSummary(symbol, _name_of(model))\n\n\nsummarize_by_name(Model, \"&#9924;\" if date.today().month == 12 else \"🄼\")\nsummarize_by_name(Learner, \"🄻\")\nsummarize_by_name(Scorer, \"🅂\")\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/utils/state_summary.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "7f100c13e",
                "new_commit_hash": "372f58f17",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/utils/state_summary.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/utils/state_summary.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 20,
                            "length": 6
                        },
                        "new_range": {
                            "start": 20,
                            "length": 9
                        },
                        "section": "from Orange.widgets.utils.signals import AttributeList"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from Orange.base import Model, Learner",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "SIZE_LIMIT = 1e7",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "def format_variables_string(variables):",
                                "type": "context"
                            },
                            {
                                "content": "    \"\"\"",
                                "type": "context"
                            },
                            {
                                "content": "    A function that formats the descriptive part of the input/output summary for",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/utils/state_summary.py",
                            "type": "statement",
                            "name": "",
                            "content": "SIZE_LIMIT = 1e7",
                            "ast_type_str": "Assign",
                            "start_lineno": 23,
                            "end_lineno": 23,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 83,
                            "length": 7
                        },
                        "new_range": {
                            "start": 86,
                            "length": 9
                        },
                        "section": "def format_summary_details(data, format=Qt.PlainText):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    targets = format_variables_string(data.domain.class_vars)",
                                "type": "context"
                            },
                            {
                                "content": "    metas = format_variables_string(data.domain.metas)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    features_missing = missing_values(data.get_nan_frequency_attribute())",
                                "type": "deleted"
                            },
                            {
                                "content": "    features_missing = \"\"",
                                "type": "added"
                            },
                            {
                                "content": "    if data.X.size < SIZE_LIMIT:",
                                "type": "added"
                            },
                            {
                                "content": "        features_missing = missing_values(data.get_nan_frequency_attribute())",
                                "type": "added"
                            },
                            {
                                "content": "    n_features = len(data.domain.variables) + len(data.domain.metas)",
                                "type": "context"
                            },
                            {
                                "content": "    name = getattr(data, \"name\", None)",
                                "type": "context"
                            },
                            {
                                "content": "    if name == \"untitled\":",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/utils/state_summary.py",
                            "type": "function",
                            "name": "format_summary_details",
                            "content": "def format_summary_details(data, format=Qt.PlainText):\n    \"\"\"\n    A function that forms the entire descriptive part of the input/output\n    summary.\n\n    :param data: A dataset\n    :type data: Orange.data.Table\n    :return: A formatted string\n    \"\"\"\n    if data is None:\n        return \"\"\n\n    if format == Qt.PlainText:\n        def b(s):\n            return s\n    else:\n        def b(s):\n            return f\"<b>{s}</b>\"\n\n    features = format_variables_string(data.domain.attributes)\n    targets = format_variables_string(data.domain.class_vars)\n    metas = format_variables_string(data.domain.metas)\n\n    features_missing = missing_values(data.get_nan_frequency_attribute())\n    n_features = len(data.domain.variables) + len(data.domain.metas)\n    name = getattr(data, \"name\", None)\n    if name == \"untitled\":\n        name = None\n    basic = f'{len(data):n} instance{_plural(len(data))}, ' \\\n            f'{n_features} variable{_plural(n_features)}'\n\n    if format == Qt.PlainText:\n        details = \\\n            (f\"{name}: \" if name else \"\") + basic \\\n            + f'\\nFeatures: {features} {features_missing}' \\\n            + f'\\nTarget: {targets}'\n        if data.domain.metas:\n            details += f'\\nMetas: {metas}'\n    else:\n        descs = []\n        if name:\n            descs.append(_nobr(f\"<b><u>{escape(name)}</u></b>: {basic}\"))\n        else:\n            descs.append(_nobr(f'{basic}'))\n\n        if data.domain.variables:\n            descs.append(_nobr(f'Features: {features} {features_missing}'))\n        if data.domain.class_vars:\n            descs.append(_nobr(f\"Target: {targets}\"))\n        if data.domain.metas:\n            descs.append(_nobr(f\"Metas: {metas}\"))\n\n        details = '<br/>'.join(descs)\n\n    return details",
                            "ast_type_str": "FunctionDef",
                            "start_lineno": 63,
                            "end_lineno": 117,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import unittest\nimport datetime\nfrom collections import namedtuple\n\nimport numpy as np\n\nfrom Orange.data import Table, Domain, StringVariable, ContinuousVariable, \\\n    DiscreteVariable, TimeVariable\nfrom Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries\n\nVarDataPair = namedtuple('VarDataPair', ['variable', 'data'])\n\n# Continuous variable variations\ncontinuous_full = VarDataPair(\n    ContinuousVariable('continuous_full'),\n    np.array([0, 1, 2, 3, 4], dtype=float),\n)\ncontinuous_missing = VarDataPair(\n    ContinuousVariable('continuous_missing'),\n    np.array([0, 1, 2, np.nan, 4], dtype=float),\n)\n\n# Unordered discrete variable variations\nrgb_full = VarDataPair(\n    DiscreteVariable('rgb_full', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nrgb_missing = VarDataPair(\n    DiscreteVariable('rgb_missing', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n# Ordered discrete variable variations\nints_full = VarDataPair(\n    DiscreteVariable('ints_full', values=('2', '3', '4')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nints_missing = VarDataPair(\n    DiscreteVariable('ints_missing', values=('2', '3', '4')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n\ndef _to_timestamps(years):\n    return [datetime.datetime(year, 1, 1).timestamp() if not np.isnan(year)\n            else np.nan for year in years]\n\n\ntime_full = VarDataPair(\n    TimeVariable('time_full'),\n    np.array(_to_timestamps([2000, 2001, 2002, 2003, 2004]), dtype=float),\n)\ntime_missing = VarDataPair(\n    TimeVariable('time_missing'),\n    np.array(_to_timestamps([2000, np.nan, 2001, 2003, 2004]), dtype=float),\n)\n\n# String variable variations\nstring_full = VarDataPair(\n    StringVariable('string_full'),\n    np.array(['a', 'b', 'c', 'd', 'e'], dtype=object),\n)\nstring_missing = VarDataPair(\n    StringVariable('string_missing'),\n    np.array(['a', 'b', 'c', StringVariable.Unknown, 'e'], dtype=object),\n)\n\n\ndef make_table(attributes, target=None, metas=None):\n    \"\"\"Build an instance of a table given various variables.\n\n    Parameters\n    ----------\n    attributes : Iterable[Tuple[Variable, np.array]\n    target : Optional[Iterable[Tuple[Variable, np.array]]\n    metas : Optional[Iterable[Tuple[Variable, np.array]]\n\n    Returns\n    -------\n    Table\n\n    \"\"\"\n    attribute_vars, attribute_vals = list(zip(*attributes))\n    attribute_vals = np.array(attribute_vals).T\n\n    target_vars, target_vals = None, None\n    if target is not None:\n        target_vars, target_vals = list(zip(*target))\n        target_vals = np.array(target_vals).T\n\n    meta_vars, meta_vals = None, None\n    if metas is not None:\n        meta_vars, meta_vals = list(zip(*metas))\n        meta_vals = np.array(meta_vals).T\n\n    return Table.from_numpy(\n        Domain(attribute_vars, class_vars=target_vars, metas=meta_vars),\n        X=attribute_vals, Y=target_vals, metas=meta_vals,\n    )\n\n\nclass TestUtils(unittest.TestCase):\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "import unittest\nfrom unittest.mock import patch\nimport datetime\nfrom collections import namedtuple\n\nimport numpy as np\n\nfrom Orange.data import Table, Domain, StringVariable, ContinuousVariable, \\\n    DiscreteVariable, TimeVariable\nfrom Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries\n\nVarDataPair = namedtuple('VarDataPair', ['variable', 'data'])\n\n# Continuous variable variations\ncontinuous_full = VarDataPair(\n    ContinuousVariable('continuous_full'),\n    np.array([0, 1, 2, 3, 4], dtype=float),\n)\ncontinuous_missing = VarDataPair(\n    ContinuousVariable('continuous_missing'),\n    np.array([0, 1, 2, np.nan, 4], dtype=float),\n)\n\n# Unordered discrete variable variations\nrgb_full = VarDataPair(\n    DiscreteVariable('rgb_full', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nrgb_missing = VarDataPair(\n    DiscreteVariable('rgb_missing', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n# Ordered discrete variable variations\nints_full = VarDataPair(\n    DiscreteVariable('ints_full', values=('2', '3', '4')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nints_missing = VarDataPair(\n    DiscreteVariable('ints_missing', values=('2', '3', '4')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n\ndef _to_timestamps(years):\n    return [datetime.datetime(year, 1, 1).timestamp() if not np.isnan(year)\n            else np.nan for year in years]\n\n\ntime_full = VarDataPair(\n    TimeVariable('time_full'),\n    np.array(_to_timestamps([2000, 2001, 2002, 2003, 2004]), dtype=float),\n)\ntime_missing = VarDataPair(\n    TimeVariable('time_missing'),\n    np.array(_to_timestamps([2000, np.nan, 2001, 2003, 2004]), dtype=float),\n)\n\n# String variable variations\nstring_full = VarDataPair(\n    StringVariable('string_full'),\n    np.array(['a', 'b', 'c', 'd', 'e'], dtype=object),\n)\nstring_missing = VarDataPair(\n    StringVariable('string_missing'),\n    np.array(['a', 'b', 'c', StringVariable.Unknown, 'e'], dtype=object),\n)\n\n\ndef make_table(attributes, target=None, metas=None):\n    \"\"\"Build an instance of a table given various variables.\n\n    Parameters\n    ----------\n    attributes : Iterable[Tuple[Variable, np.array]\n    target : Optional[Iterable[Tuple[Variable, np.array]]\n    metas : Optional[Iterable[Tuple[Variable, np.array]]\n\n    Returns\n    -------\n    Table\n\n    \"\"\"\n    attribute_vars, attribute_vals = list(zip(*attributes))\n    attribute_vals = np.array(attribute_vals).T\n\n    target_vars, target_vals = None, None\n    if target is not None:\n        target_vars, target_vals = list(zip(*target))\n        target_vals = np.array(target_vals).T\n\n    meta_vars, meta_vals = None, None\n    if metas is not None:\n        meta_vars, meta_vals = list(zip(*metas))\n        meta_vals = np.array(meta_vals).T\n\n    return Table.from_numpy(\n        Domain(attribute_vars, class_vars=target_vars, metas=meta_vars),\n        X=attribute_vals, Y=target_vals, metas=meta_vals,\n    )\n\n\nclass TestUtils(unittest.TestCase):\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric \\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            self.assertFalse(mock.called)\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/utils/tests/test_state_summary.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "50abe2b97",
                "new_commit_hash": "fd28c463b",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/utils/tests/test_state_summary.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/utils/tests/test_state_summary.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 1,
                            "length": 4
                        },
                        "new_range": {
                            "start": 1,
                            "length": 5
                        },
                        "section": ""
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "import unittest",
                                "type": "context"
                            },
                            {
                                "content": "from unittest.mock import patch",
                                "type": "added"
                            },
                            {
                                "content": "import datetime",
                                "type": "context"
                            },
                            {
                                "content": "from collections import namedtuple",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "statement",
                            "name": "",
                            "content": "from unittest.mock import patch",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 2,
                            "end_lineno": 2,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 183,
                            "length": 6
                        },
                        "new_range": {
                            "start": 184,
                            "length": 15
                        },
                        "section": "class TestUtils(unittest.TestCase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "                  f'Target: —'",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(details, format_summary_details(data))",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))",
                                "type": "added"
                            },
                            {
                                "content": "        details = f'{len(data)} instances, ' \\",
                                "type": "added"
                            },
                            {
                                "content": "                  f'{len(data.domain.variables)} variables\\n' \\",
                                "type": "added"
                            },
                            {
                                "content": "                  f'Features: {len(data.domain.variables)} numeric \\n' \\",
                                "type": "added"
                            },
                            {
                                "content": "                  f'Target: —'",
                                "type": "added"
                            },
                            {
                                "content": "        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:",
                                "type": "added"
                            },
                            {
                                "content": "            self.assertEqual(details, format_summary_details(data))",
                                "type": "added"
                            },
                            {
                                "content": "            self.assertFalse(mock.called)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        data = None",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual('', format_summary_details(data))",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "method",
                            "name": "TestUtils.test_details",
                            "content": "class TestUtils(unittest.TestCase):\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric \\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            self.assertFalse(mock.called)\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 105,
                            "end_lineno": 197,
                            "parent": {
                                "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                                "type": "class",
                                "name": "TestUtils",
                                "content": "class TestUtils(unittest.TestCase):\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric \\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            self.assertFalse(mock.called)\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 104,
                                "end_lineno": 245,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/utils/tests/test_state_summary.py",
                            "type": "class",
                            "name": "TestUtils",
                            "content": "class TestUtils(unittest.TestCase):\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric \\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            self.assertFalse(mock.called)\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 104,
                            "end_lineno": 245,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "6cce7c50277af9c0eedd2c934bed609071de18b4^",
    "new_commit_hash": "6cce7c50277af9c0eedd2c934bed609071de18b4",
    "commit_message": "fix table descriptions for big tables",
    "commit_date": "2022-11-14T13:26:05+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "6cce7c50277af9c0eedd2c934bed609071de18b4",
    "test_file_codes": [
        "import unittest\nfrom unittest.mock import patch\nimport datetime\nfrom collections import namedtuple\n\nimport numpy as np\n\nfrom Orange.data import Table, Domain, StringVariable, ContinuousVariable, \\\n    DiscreteVariable, TimeVariable\nfrom Orange.widgets.utils.state_summary import format_summary_details, \\\n    format_multiple_summaries\n\nVarDataPair = namedtuple('VarDataPair', ['variable', 'data'])\n\n# Continuous variable variations\ncontinuous_full = VarDataPair(\n    ContinuousVariable('continuous_full'),\n    np.array([0, 1, 2, 3, 4], dtype=float),\n)\ncontinuous_missing = VarDataPair(\n    ContinuousVariable('continuous_missing'),\n    np.array([0, 1, 2, np.nan, 4], dtype=float),\n)\n\n# Unordered discrete variable variations\nrgb_full = VarDataPair(\n    DiscreteVariable('rgb_full', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nrgb_missing = VarDataPair(\n    DiscreteVariable('rgb_missing', values=('r', 'g', 'b')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n# Ordered discrete variable variations\nints_full = VarDataPair(\n    DiscreteVariable('ints_full', values=('2', '3', '4')),\n    np.array([0, 1, 1, 1, 2], dtype=float),\n)\nints_missing = VarDataPair(\n    DiscreteVariable('ints_missing', values=('2', '3', '4')),\n    np.array([0, 1, 1, np.nan, 2], dtype=float),\n)\n\n\ndef _to_timestamps(years):\n    return [datetime.datetime(year, 1, 1).timestamp() if not np.isnan(year)\n            else np.nan for year in years]\n\n\ntime_full = VarDataPair(\n    TimeVariable('time_full'),\n    np.array(_to_timestamps([2000, 2001, 2002, 2003, 2004]), dtype=float),\n)\ntime_missing = VarDataPair(\n    TimeVariable('time_missing'),\n    np.array(_to_timestamps([2000, np.nan, 2001, 2003, 2004]), dtype=float),\n)\n\n# String variable variations\nstring_full = VarDataPair(\n    StringVariable('string_full'),\n    np.array(['a', 'b', 'c', 'd', 'e'], dtype=object),\n)\nstring_missing = VarDataPair(\n    StringVariable('string_missing'),\n    np.array(['a', 'b', 'c', StringVariable.Unknown, 'e'], dtype=object),\n)\n\n\ndef make_table(attributes, target=None, metas=None):\n    \"\"\"Build an instance of a table given various variables.\n\n    Parameters\n    ----------\n    attributes : Iterable[Tuple[Variable, np.array]\n    target : Optional[Iterable[Tuple[Variable, np.array]]\n    metas : Optional[Iterable[Tuple[Variable, np.array]]\n\n    Returns\n    -------\n    Table\n\n    \"\"\"\n    attribute_vars, attribute_vals = list(zip(*attributes))\n    attribute_vals = np.array(attribute_vals).T\n\n    target_vars, target_vals = None, None\n    if target is not None:\n        target_vars, target_vals = list(zip(*target))\n        target_vals = np.array(target_vals).T\n\n    meta_vars, meta_vals = None, None\n    if metas is not None:\n        meta_vars, meta_vals = list(zip(*metas))\n        meta_vals = np.array(meta_vals).T\n\n    return Table.from_numpy(\n        Domain(attribute_vars, class_vars=target_vars, metas=meta_vars),\n        X=attribute_vals, Y=target_vals, metas=meta_vals,\n    )\n\n\nclass TestUtils(unittest.TestCase):\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n\n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric \\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n            self.assertEqual(details, format_summary_details(data))\n            self.assertFalse(mock.called)\n\n        data = None\n        self.assertEqual('', format_summary_details(data))\n\n    def test_multiple_summaries(self):\n        data = Table('zoo')\n        extra_data = Table('zoo')[20:]\n        n_features_data = len(data.domain.variables) + len(data.domain.metas)\n        n_features_extra_data = len(extra_data.domain.variables) + \\\n                                len(extra_data.domain.metas)\n        details = f'Data:<br>zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'Extra Data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('Data', data), ('Extra Data', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features_data} variables<br>' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string'\n        inputs = [('', data), ('', extra_data)]\n        self.assertEqual(details, format_multiple_summaries(inputs))\n\n        details = f'No data on output.<hr>' \\\n                  f'Extra data:<br>zoo: {len(extra_data)} instances, ' \\\n                  f'{n_features_extra_data} variables<br>' \\\n                  f'Features: {len(extra_data.domain.attributes)} ' \\\n                  f'categorical (no missing values)<br>' \\\n                  f'Target: categorical<br>' \\\n                  f'Metas: string<hr>'\\\n                  f'No data on output.'\n        outputs = [('', None), ('Extra data', extra_data), ('', None)]\n        self.assertEqual(details,\n                         format_multiple_summaries(outputs, type_io='output'))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
        "# 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(self):\n        table = Table(\"iris\")\n        description = f\"<p><b>Iris flower dataset</b><br/>\" \\\n                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\\n                      f\"<p>150 instance(s)<br/>\" \\\n                      f\"4 feature(s) (no missing values)<br/>\" \\\n                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\n\n        table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        description = f\"<p>10000 instance(s)<br/>\" \\\n                      f\"1000 feature(s) <br/>\" \\\n                      f\"Data has no target variable.<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n        self.assertEqual(description, self.widget._describe(table))\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"
    ],
    "test_file_names": [
        "test_1.py",
        "test_2.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.34.0.dev0+6cce7c5 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4\nProcessing dependencies for Orange3==3.34.0.dev0+6cce7c5\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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for setuptools==59.8.0\nBest match: setuptools 59.8.0\nAdding setuptools 59.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for scipy==1.7.3\nBest match: scipy 1.7.3\nAdding scipy 1.7.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==1.0.2\nBest match: scikit-learn 1.0.2\nAdding scikit-learn 1.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for requests==2.31.0\nBest match: requests 2.31.0\nAdding requests 2.31.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for qtconsole==5.4.4\nBest match: qtconsole 5.4.4\nAdding qtconsole 5.4.4 to easy-install.pth file\nInstalling jupyter-qtconsole script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for PyYAML==6.0.1\nBest match: PyYAML 6.0.1\nAdding PyYAML 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.3\nBest match: pyqtgraph 0.12.3\nAdding pyqtgraph 0.12.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for pygments==2.17.2\nBest match: pygments 2.17.2\nAdding pygments 2.17.2 to easy-install.pth file\nInstalling pygmentize script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for pip==24.0\nBest match: pip 24.0\nAdding pip 24.0 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for pandas==1.3.5\nBest match: pandas 1.3.5\nAdding pandas 1.3.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for openpyxl==3.1.3\nBest match: openpyxl 3.1.3\nAdding openpyxl 3.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for numpy==1.17.5\nBest match: numpy 1.17.5\nAdding numpy 1.17.5 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for networkx==2.6.3\nBest match: networkx 2.6.3\nAdding networkx 2.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for matplotlib==3.5.3\nBest match: matplotlib 3.5.3\nAdding matplotlib 3.5.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for keyrings.alt==4.2.0\nBest match: keyrings.alt 4.2.0\nAdding keyrings.alt 4.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for keyring==24.1.1\nBest match: keyring 24.1.1\nAdding keyring 24.1.1 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for joblib==1.3.2\nBest match: joblib 1.3.2\nAdding joblib 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for httpx==0.24.1\nBest match: httpx 0.24.1\nAdding httpx 0.24.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine==5.15.6\nBest match: PyQtWebEngine 5.15.6\nAdding PyQtWebEngine 5.15.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for PyQt5==5.15.10\nBest match: PyQt5 5.15.10\nAdding PyQt5 5.15.10 to easy-install.pth file\nInstalling pylupdate5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling pyrcc5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling pyuic5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for threadpoolctl==3.1.0\nBest match: threadpoolctl 3.1.0\nAdding threadpoolctl 3.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for urllib3==2.0.7\nBest match: urllib3 2.0.7\nAdding urllib3 2.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for jupyter-client==7.4.9\nBest match: jupyter-client 7.4.9\nAdding jupyter-client 7.4.9 to easy-install.pth file\nInstalling jupyter-kernel script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for ipython-genutils==0.2.0\nBest match: ipython-genutils 0.2.0\nAdding ipython-genutils 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for packaging==24.0\nBest match: packaging 24.0\nAdding packaging 24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for ipykernel==6.16.2\nBest match: ipykernel 6.16.2\nAdding ipykernel 6.16.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for jupyter-core==4.12.0\nBest match: jupyter-core 4.12.0\nAdding jupyter-core 4.12.0 to easy-install.pth file\nInstalling jupyter script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for traitlets==5.9.0\nBest match: traitlets 5.9.0\nAdding traitlets 5.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for typing-extensions==4.7.1\nBest match: typing-extensions 4.7.1\nAdding typing-extensions 4.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for requests-cache==1.1.1\nBest match: requests-cache 1.1.1\nAdding requests-cache 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for qasync==0.25.0\nBest match: qasync 0.25.0\nAdding qasync 0.25.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for importlib-metadata==6.7.0\nBest match: importlib-metadata 6.7.0\nAdding importlib-metadata 6.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for et-xmlfile==1.1.0\nBest match: et-xmlfile 1.1.0\nAdding et-xmlfile 1.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for Pillow==9.5.0\nBest match: Pillow 9.5.0\nAdding Pillow 9.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for kiwisolver==1.4.5\nBest match: kiwisolver 1.4.5\nAdding kiwisolver 1.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for fonttools==4.38.0\nBest match: fonttools 4.38.0\nAdding fonttools 4.38.0 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for cycler==0.11.0\nBest match: cycler 0.11.0\nAdding cycler 0.11.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for jaraco.classes==3.2.3\nBest match: jaraco.classes 3.2.3\nAdding jaraco.classes 3.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for importlib-resources==5.12.0\nBest match: importlib-resources 5.12.0\nAdding importlib-resources 5.12.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.17.3\nBest match: httpcore 0.17.3\nAdding httpcore 0.17.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for PyQt5-sip==12.13.0\nBest match: PyQt5-sip 12.13.0\nAdding PyQt5-sip 12.13.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine-Qt5==5.15.16\nBest match: PyQtWebEngine-Qt5 5.15.16\nAdding PyQtWebEngine-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for PyQt5-Qt5==5.15.16\nBest match: PyQt5-Qt5 5.15.16\nAdding PyQt5-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for entrypoints==0.4\nBest match: entrypoints 0.4\nAdding entrypoints 0.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for tornado==6.2\nBest match: tornado 6.2\nAdding tornado 6.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for matplotlib-inline==0.1.6\nBest match: matplotlib-inline 0.1.6\nAdding matplotlib-inline 0.1.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for debugpy==1.7.0\nBest match: debugpy 1.7.0\nAdding debugpy 1.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for ipython==7.34.0\nBest match: ipython 7.34.0\nAdding ipython 7.34.0 to easy-install.pth file\nInstalling iptest script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling iptest3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling ipython script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for cattrs==23.1.2\nBest match: cattrs 23.1.2\nAdding cattrs 23.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for attrs==24.2.0\nBest match: attrs 24.2.0\nAdding attrs 24.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for platformdirs==4.0.0\nBest match: platformdirs 4.0.0\nAdding platformdirs 4.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for zipp==3.15.0\nBest match: zipp 3.15.0\nAdding zipp 3.15.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for more-itertools==9.1.0\nBest match: more-itertools 9.1.0\nAdding more-itertools 9.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for anyio==3.7.1\nBest match: anyio 3.7.1\nAdding anyio 3.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for cffi==1.15.1\nBest match: cffi 1.15.1\nAdding cffi 1.15.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nSearching for pycparser==2.21\nBest match: pycparser 2.21\nAdding pycparser 2.21 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.34.0.dev0+6cce7c5\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.7\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 47ms\nPrepared 18 packages in 30ms\nInstalled 18 packages in 172ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 54 packages in 345ms\nInstalled 47 packages in 675ms\n + anyio==3.7.1\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + h11==0.14.0\n + httpcore==0.17.3\n + httpx==0.24.1\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 59 packages in 316ms\nInstalled 38 packages in 697ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + backcall==0.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\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 + 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 + 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 + 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 + pyqtgraph==0.12.3\n + pyzmq==26.2.0\n + qasync==0.25.0\n + qtconsole==5.4.4\n + qtpy==2.4.2\n + requests-cache==1.1.1\n + tornado==6.2\n + traitlets==5.9.0\n + url-normalize==1.4.3\n + wcwidth==0.2.13\nResolved 2 packages in 4ms\nInstalled 2 packages in 28ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 35ms\nInstalled 5 packages in 1.28s\n + catboost==1.2.7\n + graphviz==0.20.1\n + plotly==5.18.0\n + tenacity==8.2.3\n + xgboost==1.6.2\nAudited 2 packages in 1ms\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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_6cce7c50277af9c0eedd2c934bed609071de18b4/.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",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4\nplugins: anyio-3.7.1\ncollected 50 items\n\nr2e_tests/test_1.py ..                                                   [  4%]\nr2e_tests/test_2.py sss.F.....F..F..............F...........F...FF..     [100%]\n\n=================================== FAILURES ===================================\n_________________________ TestOWFile.test_adds_origin __________________________\n\nself = <r2e_tests.test_2.TestOWFile testMethod=test_adds_origin>\n\n    def test_adds_origin(self):\n>       self.open_dataset(\"origin1/images\")\n\nr2e_tests/test_2.py:598: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_2.py:232: 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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_describe ___________________________\n\nself = <r2e_tests.test_2.TestOWFile testMethod=test_describe>\n\n    def test_describe(self):\n        table = Table(\"iris\")\n        description = f\"<p><b>Iris flower dataset</b><br/>\" \\\n                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\\n                      f\"<p>150 instance(s)<br/>\" \\\n                      f\"4 feature(s) (no missing values)<br/>\" \\\n                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n>       self.assertEqual(description, self.widget._describe(table))\nE       AssertionError: '<p><[132 chars]tance(s)<br/>4 feature(s) (no missing values)<[95 chars]</p>' != '<p><[132 chars]tances<br/>4 features (no missing values)<br/>[89 chars]</p>'\nE       - <p><b>Iris flower dataset</b><br/>Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p><p>150 instance(s)<br/>4 feature(s) (no missing values)<br/>Classification; categorical class with 3 values (no missing values)<br/>0 meta attribute(s)</p>\nE       + <p><b>Iris flower dataset</b><br/>Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p><p>150 instances<br/>4 features (no missing values)<br/>Classification; categorical class with 3 values (no missing values)<br/>0 meta attributes</p>\n\nr2e_tests/test_2.py:87: AssertionError\n__________________ TestOWFile.test_domain_edit_on_sparse_data __________________\n\nself = <r2e_tests.test_2.TestOWFile testMethod=test_domain_edit_on_sparse_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\nr2e_tests/test_2.py:483: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/data/owfile.py:389: in load_data\n    error = self._try_load()\nOrange/widgets/data/owfile.py:441: in _try_load\n    self.infolabel.setText(self._describe(data))\nOrange/widgets/data/owfile.py:530: in _describe\n    missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = [[sepal length=5.1, sepal width=3.5, petal length=1.4, petal width=0.2 | Iris-setosa],\n [sepal length=4.9, sepal width...width=0.2 | Iris-setosa],\n [sepal length=5.0, sepal width=3.6, petal length=1.4, petal width=0.2 | Iris-setosa],\n ...\n]\n\n    def get_nan_frequency_attribute(self):\n        if self.X.size == 0:\n            return 0\n>       return np.isnan(self.X).sum() / self.X.size\nE       TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''\n\nOrange/data/table.py:1538: TypeError\n_________________________ TestOWFile.test_minimum_size _________________________\n\nself = <r2e_tests.test_2.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.7/site-packages/orangewidget/tests/base.py:242: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.7/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_2.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_2.py:675: AssertionError\n___________________ TestOWFile.test_warning_from_this_thread ___________________\n\nself = <r2e_tests.test_2.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_2.py:719: AssertionError\n________________________ TestOWFile.test_with_warnings _________________________\n\nself = <r2e_tests.test_2.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_2.py:382: 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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/Orange/data/io.py\", line 296, in workbook\n    data_only=True)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/openpyxl/reader/excel.py\", line 347, in load_workbook\n    data_only, keep_links, rich_text)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/Orange/data/io.py\", line 296, in workbook\n    data_only=True)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/openpyxl/reader/excel.py\", line 347, in load_workbook\n    data_only, keep_links, rich_text)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/Orange/widgets/data/owfile.py\", line 477, in _get_reader\n    return UrlReader(url)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py\", line 1016, in __call__\n    return _mock_self._mock_call(*args, **kwargs)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py\", line 1076, in _mock_call\n    raise effect\nValueError\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestUtils::test_details\nPASSED r2e_tests/test_1.py::TestUtils::test_multiple_summaries\nPASSED r2e_tests/test_2.py::TestOWFile::test_add_new_format\nPASSED r2e_tests/test_2.py::TestOWFile::test_call_deprecated_dialog_formats\nPASSED r2e_tests/test_2.py::TestOWFile::test_check_column_noname\nPASSED r2e_tests/test_2.py::TestOWFile::test_check_datetime_disabled\nPASSED r2e_tests/test_2.py::TestOWFile::test_check_file_size\nPASSED r2e_tests/test_2.py::TestOWFile::test_context_match_includes_variable_values\nPASSED r2e_tests/test_2.py::TestOWFile::test_domain_changes_are_stored\nPASSED r2e_tests/test_2.py::TestOWFile::test_domain_edit_no_changes\nPASSED r2e_tests/test_2.py::TestOWFile::test_domain_editor_conversions\nPASSED r2e_tests/test_2.py::TestOWFile::test_domaineditor_continuous_to_string\nPASSED r2e_tests/test_2.py::TestOWFile::test_domaineditor_makes_variables\nPASSED r2e_tests/test_2.py::TestOWFile::test_dragEnterEvent_accepts_urls\nPASSED r2e_tests/test_2.py::TestOWFile::test_dragEnterEvent_skips_osx_file_references\nPASSED r2e_tests/test_2.py::TestOWFile::test_dragEnterEvent_skips_usupported_files\nPASSED r2e_tests/test_2.py::TestOWFile::test_dropEvent_selects_file\nPASSED r2e_tests/test_2.py::TestOWFile::test_drop_data_when_everything_skipped\nPASSED r2e_tests/test_2.py::TestOWFile::test_fail\nPASSED r2e_tests/test_2.py::TestOWFile::test_fail_sheets\nPASSED r2e_tests/test_2.py::TestOWFile::test_file_not_found\nPASSED r2e_tests/test_2.py::TestOWFile::test_files_relocated\nPASSED r2e_tests/test_2.py::TestOWFile::test_image_export\nPASSED r2e_tests/test_2.py::TestOWFile::test_invalid_role_mode\nPASSED r2e_tests/test_2.py::TestOWFile::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWFile::test_no_last_path\nPASSED r2e_tests/test_2.py::TestOWFile::test_no_reader_extension\nPASSED r2e_tests/test_2.py::TestOWFile::test_no_specified_reader\nPASSED r2e_tests/test_2.py::TestOWFile::test_nothing_selected\nPASSED r2e_tests/test_2.py::TestOWFile::test_open_moved_workflow\nPASSED r2e_tests/test_2.py::TestOWFile::test_read_format\nPASSED r2e_tests/test_2.py::TestOWFile::test_reader_custom_tab\nPASSED r2e_tests/test_2.py::TestOWFile::test_rename_duplicates\nPASSED r2e_tests/test_2.py::TestOWFile::test_select_reader\nPASSED r2e_tests/test_2.py::TestOWFile::test_select_reader_errors\nPASSED r2e_tests/test_2.py::TestOWFile::test_url_no_scheme\nPASSED r2e_tests/test_2.py::TestOWFile::test_variable_name_change\nPASSED r2e_tests/test_2.py::TestOWFile::test_warning_from_another_thread\nPASSED r2e_tests/test_2.py::TestOWFileDropHandler::test_canDropUrl\nPASSED r2e_tests/test_2.py::TestOWFileDropHandler::test_parametersFromUrl\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_2.py::TestOWFile::test_adds_origin - OSError: File \"ori...\nFAILED r2e_tests/test_2.py::TestOWFile::test_describe - AssertionError: '<p><...\nFAILED r2e_tests/test_2.py::TestOWFile::test_domain_edit_on_sparse_data - Typ...\nFAILED r2e_tests/test_2.py::TestOWFile::test_minimum_size - AssertionError: 1...\nFAILED r2e_tests/test_2.py::TestOWFile::test_sheets - AssertionError: '' != '...\nFAILED r2e_tests/test_2.py::TestOWFile::test_warning_from_this_thread - Asser...\nFAILED r2e_tests/test_2.py::TestOWFile::test_with_warnings - AssertionError: ...\n=================== 7 failed, 40 passed, 3 skipped in 7.97s ====================\nWidgets left: 0    Max widgets: 4470 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4\nplugins: anyio-3.7.1\ncollected 50 items\n\nr2e_tests/test_1.py F.                                                   [  4%]\nr2e_tests/test_2.py sss.F.....F..F..............F...........F...FF..     [100%]\n\n=================================== FAILURES ===================================\n____________________________ TestUtils.test_details ____________________________\n\nself = <r2e_tests.test_1.TestUtils testMethod=test_details>\n\n    def test_details(self):\n        \"\"\"Check if details part of the summary is formatted correctly\"\"\"\n        data = Table('zoo')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'zoo: {len(data)} instance, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: categorical\\n' \\\n                  f'Metas: string'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = Table('housing')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'housing: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: numeric'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = Table('heart_disease')\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'heart_disease: {len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(7 categorical, 6 numeric) (0.2% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = make_table(\n            [continuous_full, continuous_missing],\n            target=[rgb_full, rgb_missing], metas=[ints_full, ints_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} numeric ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} categorical\\n' \\\n                  f'Metas: {len(data.domain.metas)} categorical'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = make_table(\n            [continuous_full, time_full, ints_full, rgb_missing],\n            target=[rgb_full, continuous_missing],\n            metas=[string_full, string_missing]\n        )\n        n_features = len(data.domain.variables) + len(data.domain.metas)\n        details = f'{len(data)} instances, ' \\\n                  f'{n_features} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} ' \\\n                  f'(2 categorical, 1 numeric, 1 time) (5.0% missing values)\\n' \\\n                  f'Target: {len(data.domain.class_vars)} ' \\\n                  f'(1 categorical, 1 numeric)\\n' \\\n                  f'Metas: {len(data.domain.metas)} string'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = make_table([time_full, time_missing], target=[ints_missing],\n                          metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.attributes)} time ' \\\n                  f'(10.0% missing values)\\n' \\\n                  f'Target: categorical'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = make_table([rgb_full, ints_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} categorical ' \\\n                  f'(no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = make_table([rgb_full], target=None, metas=None)\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variable\\n' \\\n                  f'Features: categorical (no missing values)\\n' \\\n                  f'Target: —'\n        self.assertEqual(details, format_summary_details(data))\n    \n        data = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))\n        details = f'{len(data)} instances, ' \\\n                  f'{len(data.domain.variables)} variables\\n' \\\n                  f'Features: {len(data.domain.variables)} numeric \\n' \\\n                  f'Target: —'\n        with patch.object(Table, \"get_nan_frequency_attribute\") as mock:\n>           self.assertEqual(details, format_summary_details(data))\n\nr2e_tests/test_1.py:193: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/utils/state_summary.py:86: in format_summary_details\n    features_missing = missing_values(data.get_nan_frequency_attribute())\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nvalue = <MagicMock name='get_nan_frequency_attribute()' id='135582757402320'>\n\n    def missing_values(value):\n        if value:\n>           return f'({value*100:.1f}% missing values)'\nE           TypeError: unsupported format string passed to MagicMock.__format__\n\nOrange/widgets/utils/state_summary.py:122: TypeError\n_________________________ TestOWFile.test_adds_origin __________________________\n\nself = <r2e_tests.test_2.TestOWFile testMethod=test_adds_origin>\n\n    def test_adds_origin(self):\n>       self.open_dataset(\"origin1/images\")\n\nr2e_tests/test_2.py:598: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_2.py:232: 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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_describe ___________________________\n\nself = <r2e_tests.test_2.TestOWFile testMethod=test_describe>\n\n    def test_describe(self):\n        table = Table(\"iris\")\n        description = f\"<p><b>Iris flower dataset</b><br/>\" \\\n                      f\"Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p>\" \\\n                      f\"<p>150 instance(s)<br/>\" \\\n                      f\"4 feature(s) (no missing values)<br/>\" \\\n                      f\"Classification; categorical class with 3 values (no missing values)<br/>\" \\\n                      f\"0 meta attribute(s)</p>\"\n>       self.assertEqual(description, self.widget._describe(table))\nE       AssertionError: '<p><[132 chars]tance(s)<br/>4 feature(s) (no missing values)<[95 chars]</p>' != '<p><[132 chars]tances<br/>4 features (no missing values)<br/>[89 chars]</p>'\nE       - <p><b>Iris flower dataset</b><br/>Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p><p>150 instance(s)<br/>4 feature(s) (no missing values)<br/>Classification; categorical class with 3 values (no missing values)<br/>0 meta attribute(s)</p>\nE       + <p><b>Iris flower dataset</b><br/>Classical dataset with 150 instances of Iris setosa, Iris virginica and Iris versicolor.</p><p>150 instances<br/>4 features (no missing values)<br/>Classification; categorical class with 3 values (no missing values)<br/>0 meta attributes</p>\n\nr2e_tests/test_2.py:87: AssertionError\n__________________ TestOWFile.test_domain_edit_on_sparse_data __________________\n\nself = <r2e_tests.test_2.TestOWFile testMethod=test_domain_edit_on_sparse_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\nr2e_tests/test_2.py:483: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/data/owfile.py:389: in load_data\n    error = self._try_load()\nOrange/widgets/data/owfile.py:441: in _try_load\n    self.infolabel.setText(self._describe(data))\nOrange/widgets/data/owfile.py:528: in _describe\n    missing_in_attr = missing_prop(table.get_nan_frequency_attribute())\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = [[sepal length=5.1, sepal width=3.5, petal length=1.4, petal width=0.2 | Iris-setosa],\n [sepal length=4.9, sepal width...width=0.2 | Iris-setosa],\n [sepal length=5.0, sepal width=3.6, petal length=1.4, petal width=0.2 | Iris-setosa],\n ...\n]\n\n    def get_nan_frequency_attribute(self):\n        if self.X.size == 0:\n            return 0\n>       return np.isnan(self.X).sum() / self.X.size\nE       TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''\n\nOrange/data/table.py:1538: TypeError\n_________________________ TestOWFile.test_minimum_size _________________________\n\nself = <r2e_tests.test_2.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.7/site-packages/orangewidget/tests/base.py:242: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.7/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_2.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_2.py:675: AssertionError\n___________________ TestOWFile.test_warning_from_this_thread ___________________\n\nself = <r2e_tests.test_2.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_2.py:719: AssertionError\n________________________ TestOWFile.test_with_warnings _________________________\n\nself = <r2e_tests.test_2.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_2.py:382: 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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/Orange/data/io.py\", line 296, in workbook\n    data_only=True)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/openpyxl/reader/excel.py\", line 347, in load_workbook\n    data_only, keep_links, rich_text)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/Orange/data/io.py\", line 296, in workbook\n    data_only=True)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/site-packages/openpyxl/reader/excel.py\", line 347, in load_workbook\n    data_only, keep_links, rich_text)\n  File \"/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/.venv/lib/python3.7/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_6cce7c50277af9c0eedd2c934bed609071de18b4/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_6cce7c50277af9c0eedd2c934bed609071de18b4/Orange/widgets/data/owfile.py\", line 477, in _get_reader\n    return UrlReader(url)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py\", line 1016, in __call__\n    return _mock_self._mock_call(*args, **kwargs)\n  File \"/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py\", line 1076, in _mock_call\n    raise effect\nValueError\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestUtils::test_multiple_summaries\nPASSED r2e_tests/test_2.py::TestOWFile::test_add_new_format\nPASSED r2e_tests/test_2.py::TestOWFile::test_call_deprecated_dialog_formats\nPASSED r2e_tests/test_2.py::TestOWFile::test_check_column_noname\nPASSED r2e_tests/test_2.py::TestOWFile::test_check_datetime_disabled\nPASSED r2e_tests/test_2.py::TestOWFile::test_check_file_size\nPASSED r2e_tests/test_2.py::TestOWFile::test_context_match_includes_variable_values\nPASSED r2e_tests/test_2.py::TestOWFile::test_domain_changes_are_stored\nPASSED r2e_tests/test_2.py::TestOWFile::test_domain_edit_no_changes\nPASSED r2e_tests/test_2.py::TestOWFile::test_domain_editor_conversions\nPASSED r2e_tests/test_2.py::TestOWFile::test_domaineditor_continuous_to_string\nPASSED r2e_tests/test_2.py::TestOWFile::test_domaineditor_makes_variables\nPASSED r2e_tests/test_2.py::TestOWFile::test_dragEnterEvent_accepts_urls\nPASSED r2e_tests/test_2.py::TestOWFile::test_dragEnterEvent_skips_osx_file_references\nPASSED r2e_tests/test_2.py::TestOWFile::test_dragEnterEvent_skips_usupported_files\nPASSED r2e_tests/test_2.py::TestOWFile::test_dropEvent_selects_file\nPASSED r2e_tests/test_2.py::TestOWFile::test_drop_data_when_everything_skipped\nPASSED r2e_tests/test_2.py::TestOWFile::test_fail\nPASSED r2e_tests/test_2.py::TestOWFile::test_fail_sheets\nPASSED r2e_tests/test_2.py::TestOWFile::test_file_not_found\nPASSED r2e_tests/test_2.py::TestOWFile::test_files_relocated\nPASSED r2e_tests/test_2.py::TestOWFile::test_image_export\nPASSED r2e_tests/test_2.py::TestOWFile::test_invalid_role_mode\nPASSED r2e_tests/test_2.py::TestOWFile::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWFile::test_no_last_path\nPASSED r2e_tests/test_2.py::TestOWFile::test_no_reader_extension\nPASSED r2e_tests/test_2.py::TestOWFile::test_no_specified_reader\nPASSED r2e_tests/test_2.py::TestOWFile::test_nothing_selected\nPASSED r2e_tests/test_2.py::TestOWFile::test_open_moved_workflow\nPASSED r2e_tests/test_2.py::TestOWFile::test_read_format\nPASSED r2e_tests/test_2.py::TestOWFile::test_reader_custom_tab\nPASSED r2e_tests/test_2.py::TestOWFile::test_rename_duplicates\nPASSED r2e_tests/test_2.py::TestOWFile::test_select_reader\nPASSED r2e_tests/test_2.py::TestOWFile::test_select_reader_errors\nPASSED r2e_tests/test_2.py::TestOWFile::test_url_no_scheme\nPASSED r2e_tests/test_2.py::TestOWFile::test_variable_name_change\nPASSED r2e_tests/test_2.py::TestOWFile::test_warning_from_another_thread\nPASSED r2e_tests/test_2.py::TestOWFileDropHandler::test_canDropUrl\nPASSED r2e_tests/test_2.py::TestOWFileDropHandler::test_parametersFromUrl\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestUtils::test_details - TypeError: unsupported ...\nFAILED r2e_tests/test_2.py::TestOWFile::test_adds_origin - OSError: File \"ori...\nFAILED r2e_tests/test_2.py::TestOWFile::test_describe - AssertionError: '<p><...\nFAILED r2e_tests/test_2.py::TestOWFile::test_domain_edit_on_sparse_data - Typ...\nFAILED r2e_tests/test_2.py::TestOWFile::test_minimum_size - AssertionError: 1...\nFAILED r2e_tests/test_2.py::TestOWFile::test_sheets - AssertionError: '' != '...\nFAILED r2e_tests/test_2.py::TestOWFile::test_warning_from_this_thread - Asser...\nFAILED r2e_tests/test_2.py::TestOWFile::test_with_warnings - AssertionError: ...\n=================== 8 failed, 39 passed, 3 skipped in 5.91s ====================\nWidgets left: 0    Max widgets: 4470 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/data/owfile.py Orange/widgets/data/tests/test_owfile.py Orange/widgets/utils/state_summary.py Orange/widgets/utils/tests/test_state_summary.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Description Formatting Fails for Large Tables Due to Missing Frequency Calculations

**Description:**
When generating descriptions for large tables, the system attempts to calculate the frequency of missing values regardless of the table size. This leads to errors and incorrect summaries when handling datasets that exceed the predefined size limit.

**Example Buggy Code:**
```python
table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))
description = format_summary_details(table)
# Raises TypeError: unsupported format string passed to MagicMock.__format__
```

**Expected Behavior:**
For tables larger than the size limit, the description function should skip calculating missing frequencies and provide a summary without attempting these computations, ensuring no errors occur.

**Actual Behavior:**
The description function tries to compute missing frequencies for large tables, resulting in a `TypeError` and preventing the generation of correct table descriptions.

[/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/utils/state_summary.py
from datetime import date
from html import escape

from AnyQt.QtCore import Qt

from orangewidget.utils.signals import summarize, PartialSummary
from Orange.widgets.utils.itemmodels import TableModel
from Orange.widgets.utils.tableview import TableView

from Orange.data import (
    StringVariable, DiscreteVariable, ContinuousVariable, TimeVariable,
    Table
)

from Orange.evaluation import Results
from Orange.misc import DistMatrix
from Orange.preprocess import Preprocess, PreprocessorList
from Orange.preprocess.score import Scorer
from Orange.widgets.utils.signals import AttributeList
from Orange.base import Model, Learner


def format_variables_string(variables):
    """
    A function that formats the descriptive part of the input/output summary for
    either features, targets or metas of the input dataset.

    :param variables: Features, targets or metas of the input dataset
    :return: A formatted string
    """
    if not variables:
        return '—'

    agg = []
    for var_type_name, var_type in [('categorical', DiscreteVariable),
                                    ('numeric', ContinuousVariable),
                                    ('time', TimeVariable),
                                    ('string', StringVariable)]:
        # Disable pylint here because a `TimeVariable` is also a
        # `ContinuousVariable`, and should be labelled as such. That is why
        # it is necessary to check the type this way instead of using
        # `isinstance`, which would fail in the above case
        var_type_list = [v for v in variables if type(v) is var_type]  # pylint: disable=unidiomatic-typecheck
        if var_type_list:
            agg.append((var_type_name, len(var_type_list)))

    attrs, counts = list(zip(*agg))
    if len(attrs) > 1:
        var_string = [f'{i} {j}' for i, j in zip(counts, attrs)]
        var_string = f'{sum(counts)} ({", ".join(var_string)})'
    elif counts[0] == 1:
        var_string = attrs[0]
    else:
        var_string = f'{counts[0]} {attrs[0]}'
    return var_string


def _plural(number):
    return 's' * (number % 100 != 1)


# `format` is a good name for the argument, pylint: disable=redefined-builtin
def format_summary_details(data, format=Qt.PlainText):
    """
    A function that forms the entire descriptive part of the input/output
    summary.

    :param data: A dataset
    :type data: Orange.data.Table
    :return: A formatted string
    """
    if data is None:
        return ""

    if format == Qt.PlainText:
        def b(s):
            return s
    else:
        def b(s):
            return f"<b>{s}</b>"

    features = format_variables_string(data.domain.attributes)
    targets = format_variables_string(data.domain.class_vars)
    metas = format_variables_string(data.domain.metas)

    features_missing = missing_values(data.get_nan_frequency_attribute())
    n_features = len(data.domain.variables) + len(data.domain.metas)
    name = getattr(data, "name", None)
    if name == "untitled":
        name = None
    basic = f'{len(data):n} instance{_plural(len(data))}, ' \
            f'{n_features} variable{_plural(n_features)}'

    if format == Qt.PlainText:
        details = \
            (f"{name}: " if name else "") + basic \
            + f'\nFeatures: {features} {features_missing}' \
            + f'\nTarget: {targets}'
        if data.domain.metas:
            details += f'\nMetas: {metas}'
    else:
        descs = []
        if name:
            descs.append(_nobr(f"<b><u>{escape(name)}</u></b>: {basic}"))
        else:
            descs.append(_nobr(f'{basic}'))

        if data.domain.variables:
            descs.append(_nobr(f'Features: {features} {features_missing}'))
        if data.domain.class_vars:
            descs.append(_nobr(f"Target: {targets}"))
        if data.domain.metas:
            descs.append(_nobr(f"Metas: {metas}"))

        details = '<br/>'.join(descs)

    return details


def missing_values(value):
    if value:
        return f'({value*100:.1f}% missing values)'
    else:
        return '(no missing values)'


def format_multiple_summaries(data_list, type_io='input'):
    """
    A function that forms the entire descriptive part of the input/output
    summary for widgets that have more than one input/output.

    :param data_list: A list of tuples for each input/output dataset where the
    first element of the tuple is the name of the dataset (can be omitted)
    and the second is the dataset
    :type data_list: list(tuple(str, Orange.data.Table))
    :param type_io: A string that indicates weather the input or output data
    is being formatted
    :type type_io: str

    :return A formatted summary
    :rtype str
    """

    def new_line(text):
        return text.replace('\n', '<br>')

    full_details = []
    for (name, data) in data_list:
        if data:
            details = new_line(format_summary_details(data))
        else:
            details = f'No data on {type_io}.'
        full_details.append(details if not name else f'{name}:<br>{details}')
    return '<hr>'.join(full_details)


def _name_of(object):
    return _nobr(getattr(object, 'name', type(object).__name__))


def _nobr(s):
    return f"<nobr>{s}</nobr>"


@summarize.register
def summarize_(data: Table):
    def previewer():
        view = TableView(selectionMode=TableView.NoSelection)
        view.setModel(TableModel(data))
        return view

    return PartialSummary(
        data.approx_len(),
        format_summary_details(data, format=Qt.RichText),
        previewer)


@summarize.register
def summarize_(matrix: DistMatrix):  # pylint: disable=function-redefined
    n, m = matrix.shape
    return PartialSummary(f"{n}×{m}", _nobr(f"{n}×{m} distance matrix"))


@summarize.register
def summarize_(results: Results):  # pylint: disable=function-redefined
    nmethods, ninstances = results.predicted.shape
    summary = f"{nmethods}×{ninstances}"
    details = f"{nmethods} method{_plural(nmethods)} " \
              f"on {ninstances} test instance{_plural(ninstances)}"
    return PartialSummary(summary, _nobr(details))


@summarize.register
def summarize_(attributes: AttributeList):  # pylint: disable=function-redefined
    n = len(attributes)
    if n == 0:
        details = "empty list"
    elif n <= 3:
        details = _nobr(", ".join(var.name for var in attributes))
    else:
        details = _nobr(", ".join(var.name for var in attributes[:2]) +
                       f" and {n - 2} others")
    return PartialSummary(n, details)


@summarize.register
def summarize_(preprocessor: Preprocess):
    if isinstance(preprocessor, PreprocessorList):
        if preprocessor.preprocessors:
            details = "<br/>".join(map(_name_of, preprocessor.preprocessors))
        else:
            details = _nobr(f"{_name_of(preprocessor)} (empty)")
    else:
        details = _name_of(preprocessor)
    return PartialSummary("🄿", details)


def summarize_by_name(type_, symbol):
    @summarize.register
    def summarize_(model: type_):
        return PartialSummary(symbol, _name_of(model))


summarize_by_name(Model, "&#9924;" if date.today().month == 12 else "🄼")
summarize_by_name(Learner, "🄻")
summarize_by_name(Scorer, "🅂")

```
--- 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:** Description Formatting Fails for Large Tables Due to Missing Frequency Calculations

**Description:**
When generating descriptions for large tables, the system attempts to calculate the frequency of missing values regardless of the table size. This leads to errors and incorrect summaries when handling datasets that exceed the predefined size limit.

**Example Buggy Code:**
```python
table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))
description = format_summary_details(table)
# Raises TypeError: unsupported format string passed to MagicMock.__format__
```

**Expected Behavior:**
For tables larger than the size limit, the description function should skip calculating missing frequencies and provide a summary without attempting these computations, ensuring no errors occur.

**Actual Behavior:**
The description function tries to compute missing frequencies for large tables, resulting in a `TypeError` and preventing the generation of correct table descriptions.

[/ISSUE]
{
    "TestUtils.test_details": "PASSED",
    "TestUtils.test_multiple_summaries": "PASSED",
    "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_domain_changes_are_stored": "PASSED",
    "TestOWFile.test_domain_edit_no_changes": "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_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_describe": "FAILED",
    "TestOWFile.test_domain_edit_on_sparse_data": "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 85d9b567f..fb3ae2dda 100644
--- a/Orange/widgets/data/owfile.py
+++ b/Orange/widgets/data/owfile.py
@@ -525,8 +525,10 @@ class OWFile(widget.OWWidget, RecentPathsWComboMixin):
 
         text += f"<p>{len(table)} {pl(len(table), 'instance')}"
 
-        missing_in_attr = missing_prop(table.get_nan_frequency_attribute())
-        missing_in_class = missing_prop(table.get_nan_frequency_class())
+        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:
diff --git a/Orange/widgets/utils/state_summary.py b/Orange/widgets/utils/state_summary.py
index 7f100c13e..372f58f17 100644
--- a/Orange/widgets/utils/state_summary.py
+++ b/Orange/widgets/utils/state_summary.py
@@ -20,6 +20,9 @@ from Orange.widgets.utils.signals import AttributeList
 from Orange.base import Model, Learner
 
 
+SIZE_LIMIT = 1e7
+
+
 def format_variables_string(variables):
     """
     A function that formats the descriptive part of the input/output summary for
@@ -83,7 +86,9 @@ def format_summary_details(data, format=Qt.PlainText):
     targets = format_variables_string(data.domain.class_vars)
     metas = format_variables_string(data.domain.metas)
 
-    features_missing = missing_values(data.get_nan_frequency_attribute())
+    features_missing = ""
+    if data.X.size < SIZE_LIMIT:
+        features_missing = missing_values(data.get_nan_frequency_attribute())
     n_features = len(data.domain.variables) + len(data.domain.metas)
     name = getattr(data, "name", None)
     if name == "untitled":

{"Orange/widgets/utils/state_summary.py": "from datetime import date\nfrom html import escape\n\nfrom AnyQt.QtCore import Qt\n\nfrom orangewidget.utils.signals import summarize, PartialSummary\nfrom Orange.widgets.utils.itemmodels import TableModel\nfrom Orange.widgets.utils.tableview import TableView\n\nfrom Orange.data import (\n    StringVariable, DiscreteVariable, ContinuousVariable, TimeVariable,\n    Table\n)\n\nfrom Orange.evaluation import Results\nfrom Orange.misc import DistMatrix\nfrom Orange.preprocess import Preprocess, PreprocessorList\nfrom Orange.preprocess.score import Scorer\nfrom Orange.widgets.utils.signals import AttributeList\nfrom Orange.base import Model, Learner\n\n\ndef format_variables_string(variables):\n    \"\"\"\n    A function that formats the descriptive part of the input/output summary for\n    either features, targets or metas of the input dataset.\n\n    :param variables: Features, targets or metas of the input dataset\n    :return: A formatted string\n    \"\"\"\n    if not variables:\n        return '\u2014'\n\n    agg = []\n    for var_type_name, var_type in [('categorical', DiscreteVariable),\n                                    ('numeric', ContinuousVariable),\n                                    ('time', TimeVariable),\n                                    ('string', StringVariable)]:\n        # Disable pylint here because a `TimeVariable` is also a\n        # `ContinuousVariable`, and should be labelled as such. That is why\n        # it is necessary to check the type this way instead of using\n        # `isinstance`, which would fail in the above case\n        var_type_list = [v for v in variables if type(v) is var_type]  # pylint: disable=unidiomatic-typecheck\n        if var_type_list:\n            agg.append((var_type_name, len(var_type_list)))\n\n    attrs, counts = list(zip(*agg))\n    if len(attrs) > 1:\n        var_string = [f'{i} {j}' for i, j in zip(counts, attrs)]\n        var_string = f'{sum(counts)} ({\", \".join(var_string)})'\n    elif counts[0] == 1:\n        var_string = attrs[0]\n    else:\n        var_string = f'{counts[0]} {attrs[0]}'\n    return var_string\n\n\ndef _plural(number):\n    return 's' * (number % 100 != 1)\n\n\n# `format` is a good name for the argument, pylint: disable=redefined-builtin\ndef format_summary_details(data, format=Qt.PlainText):\n    \"\"\"\n    A function that forms the entire descriptive part of the input/output\n    summary.\n\n    :param data: A dataset\n    :type data: Orange.data.Table\n    :return: A formatted string\n    \"\"\"\n    if data is None:\n        return \"\"\n\n    if format == Qt.PlainText:\n        def b(s):\n            return s\n    else:\n        def b(s):\n            return f\"<b>{s}</b>\"\n\n    features = format_variables_string(data.domain.attributes)\n    targets = format_variables_string(data.domain.class_vars)\n    metas = format_variables_string(data.domain.metas)\n\n    features_missing = missing_values(data.get_nan_frequency_attribute())\n    n_features = len(data.domain.variables) + len(data.domain.metas)\n    name = getattr(data, \"name\", None)\n    if name == \"untitled\":\n        name = None\n    basic = f'{len(data):n} instance{_plural(len(data))}, ' \\\n            f'{n_features} variable{_plural(n_features)}'\n\n    if format == Qt.PlainText:\n        details = \\\n            (f\"{name}: \" if name else \"\") + basic \\\n            + f'\\nFeatures: {features} {features_missing}' \\\n            + f'\\nTarget: {targets}'\n        if data.domain.metas:\n            details += f'\\nMetas: {metas}'\n    else:\n        descs = []\n        if name:\n            descs.append(_nobr(f\"<b><u>{escape(name)}</u></b>: {basic}\"))\n        else:\n            descs.append(_nobr(f'{basic}'))\n\n        if data.domain.variables:\n            descs.append(_nobr(f'Features: {features} {features_missing}'))\n        if data.domain.class_vars:\n            descs.append(_nobr(f\"Target: {targets}\"))\n        if data.domain.metas:\n            descs.append(_nobr(f\"Metas: {metas}\"))\n\n        details = '<br/>'.join(descs)\n\n    return details\n\n\ndef missing_values(value):\n    if value:\n        return f'({value*100:.1f}% missing values)'\n    else:\n        return '(no missing values)'\n\n\ndef format_multiple_summaries(data_list, type_io='input'):\n    \"\"\"\n    A function that forms the entire descriptive part of the input/output\n    summary for widgets that have more than one input/output.\n\n    :param data_list: A list of tuples for each input/output dataset where the\n    first element of the tuple is the name of the dataset (can be omitted)\n    and the second is the dataset\n    :type data_list: list(tuple(str, Orange.data.Table))\n    :param type_io: A string that indicates weather the input or output data\n    is being formatted\n    :type type_io: str\n\n    :return A formatted summary\n    :rtype str\n    \"\"\"\n\n    def new_line(text):\n        return text.replace('\\n', '<br>')\n\n    full_details = []\n    for (name, data) in data_list:\n        if data:\n            details = new_line(format_summary_details(data))\n        else:\n            details = f'No data on {type_io}.'\n        full_details.append(details if not name else f'{name}:<br>{details}')\n    return '<hr>'.join(full_details)\n\n\ndef _name_of(object):\n    return _nobr(getattr(object, 'name', type(object).__name__))\n\n\ndef _nobr(s):\n    return f\"<nobr>{s}</nobr>\"\n\n\n@summarize.register\ndef summarize_(data: Table):\n    def previewer():\n        view = TableView(selectionMode=TableView.NoSelection)\n        view.setModel(TableModel(data))\n        return view\n\n    return PartialSummary(\n        data.approx_len(),\n        format_summary_details(data, format=Qt.RichText),\n        previewer)\n\n\n@summarize.register\ndef summarize_(matrix: DistMatrix):  # pylint: disable=function-redefined\n    n, m = matrix.shape\n    return PartialSummary(f\"{n}\u00d7{m}\", _nobr(f\"{n}\u00d7{m} distance matrix\"))\n\n\n@summarize.register\ndef summarize_(results: Results):  # pylint: disable=function-redefined\n    nmethods, ninstances = results.predicted.shape\n    summary = f\"{nmethods}\u00d7{ninstances}\"\n    details = f\"{nmethods} method{_plural(nmethods)} \" \\\n              f\"on {ninstances} test instance{_plural(ninstances)}\"\n    return PartialSummary(summary, _nobr(details))\n\n\n@summarize.register\ndef summarize_(attributes: AttributeList):  # pylint: disable=function-redefined\n    n = len(attributes)\n    if n == 0:\n        details = \"empty list\"\n    elif n <= 3:\n        details = _nobr(\", \".join(var.name for var in attributes))\n    else:\n        details = _nobr(\", \".join(var.name for var in attributes[:2]) +\n                       f\" and {n - 2} others\")\n    return PartialSummary(n, details)\n\n\n@summarize.register\ndef summarize_(preprocessor: Preprocess):\n    if isinstance(preprocessor, PreprocessorList):\n        if preprocessor.preprocessors:\n            details = \"<br/>\".join(map(_name_of, preprocessor.preprocessors))\n        else:\n            details = _nobr(f\"{_name_of(preprocessor)} (empty)\")\n    else:\n        details = _name_of(preprocessor)\n    return PartialSummary(\"\ud83c\udd3f\", details)\n\n\ndef summarize_by_name(type_, symbol):\n    @summarize.register\n    def summarize_(model: type_):\n        return PartialSummary(symbol, _name_of(model))\n\n\nsummarize_by_name(Model, \"&#9924;\" if date.today().month == 12 else \"\ud83c\udd3c\")\nsummarize_by_name(Learner, \"\ud83c\udd3b\")\nsummarize_by_name(Scorer, \"\ud83c\udd42\")\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:** Description Formatting Fails for Large Tables Due to Missing Frequency Calculations

**Description:**
When generating descriptions for large tables, the system attempts to calculate the frequency of missing values regardless of the table size. This leads to errors and incorrect summaries when handling datasets that exceed the predefined size limit.

**Example Buggy Code:**
```python
table = Table.from_numpy(domain=None, X=np.random.random((10000, 1000)))
description = format_summary_details(table)
# Raises TypeError: unsupported format string passed to MagicMock.__format__
```

**Expected Behavior:**
For tables larger than the size limit, the description function should skip calculating missing frequencies and provide a summary without attempting these computations, ensuring no errors occur.

**Actual Behavior:**
The description function tries to compute missing frequencies for large tables, resulting in a `TypeError` and preventing the generation of correct table descriptions.

[/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/utils/state_summary.py
from datetime import date
from html import escape

from AnyQt.QtCore import Qt

from orangewidget.utils.signals import summarize, PartialSummary
from Orange.widgets.utils.itemmodels import TableModel
from Orange.widgets.utils.tableview import TableView

from Orange.data import (
    StringVariable, DiscreteVariable, ContinuousVariable, TimeVariable,
    Table
)

from Orange.evaluation import Results
from Orange.misc import DistMatrix
from Orange.preprocess import Preprocess, PreprocessorList
from Orange.preprocess.score import Scorer
from Orange.widgets.utils.signals import AttributeList
from Orange.base import Model, Learner


def format_variables_string(variables):
    """
    A function that formats the descriptive part of the input/output summary for
    either features, targets or metas of the input dataset.

    :param variables: Features, targets or metas of the input dataset
    :return: A formatted string
    """
    if not variables:
        return '—'

    agg = []
    for var_type_name, var_type in [('categorical', DiscreteVariable),
                                    ('numeric', ContinuousVariable),
                                    ('time', TimeVariable),
                                    ('string', StringVariable)]:
        # Disable pylint here because a `TimeVariable` is also a
        # `ContinuousVariable`, and should be labelled as such. That is why
        # it is necessary to check the type this way instead of using
        # `isinstance`, which would fail in the above case
        var_type_list = [v for v in variables if type(v) is var_type]  # pylint: disable=unidiomatic-typecheck
        if var_type_list:
            agg.append((var_type_name, len(var_type_list)))

    attrs, counts = list(zip(*agg))
    if len(attrs) > 1:
        var_string = [f'{i} {j}' for i, j in zip(counts, attrs)]
        var_string = f'{sum(counts)} ({", ".join(var_string)})'
    elif counts[0] == 1:
        var_string = attrs[0]
    else:
        var_string = f'{counts[0]} {attrs[0]}'
    return var_string


def _plural(number):
    return 's' * (number % 100 != 1)


# `format` is a good name for the argument, pylint: disable=redefined-builtin
def format_summary_details(data, format=Qt.PlainText):
    """
    A function that forms the entire descriptive part of the input/output
    summary.

    :param data: A dataset
    :type data: Orange.data.Table
    :return: A formatted string
    """
    if data is None:
        return ""

    if format == Qt.PlainText:
        def b(s):
            return s
    else:
        def b(s):
            return f"<b>{s}</b>"

    features = format_variables_string(data.domain.attributes)
    targets = format_variables_string(data.domain.class_vars)
    metas = format_variables_string(data.domain.metas)

    features_missing = missing_values(data.get_nan_frequency_attribute())
    n_features = len(data.domain.variables) + len(data.domain.metas)
    name = getattr(data, "name", None)
    if name == "untitled":
        name = None
    basic = f'{len(data):n} instance{_plural(len(data))}, ' \
            f'{n_features} variable{_plural(n_features)}'

    if format == Qt.PlainText:
        details = \
            (f"{name}: " if name else "") + basic \
            + f'\nFeatures: {features} {features_missing}' \
            + f'\nTarget: {targets}'
        if data.domain.metas:
            details += f'\nMetas: {metas}'
    else:
        descs = []
        if name:
            descs.append(_nobr(f"<b><u>{escape(name)}</u></b>: {basic}"))
        else:
            descs.append(_nobr(f'{basic}'))

        if data.domain.variables:
            descs.append(_nobr(f'Features: {features} {features_missing}'))
        if data.domain.class_vars:
            descs.append(_nobr(f"Target: {targets}"))
        if data.domain.metas:
            descs.append(_nobr(f"Metas: {metas}"))

        details = '<br/>'.join(descs)

    return details


def missing_values(value):
    if value:
        return f'({value*100:.1f}% missing values)'
    else:
        return '(no missing values)'


def format_multiple_summaries(data_list, type_io='input'):
    """
    A function that forms the entire descriptive part of the input/output
    summary for widgets that have more than one input/output.

    :param data_list: A list of tuples for each input/output dataset where the
    first element of the tuple is the name of the dataset (can be omitted)
    and the second is the dataset
    :type data_list: list(tuple(str, Orange.data.Table))
    :param type_io: A string that indicates weather the input or output data
    is being formatted
    :type type_io: str

    :return A formatted summary
    :rtype str
    """

    def new_line(text):
        return text.replace('\n', '<br>')

    full_details = []
    for (name, data) in data_list:
        if data:
            details = new_line(format_summary_details(data))
        else:
            details = f'No data on {type_io}.'
        full_details.append(details if not name else f'{name}:<br>{details}')
    return '<hr>'.join(full_details)


def _name_of(object):
    return _nobr(getattr(object, 'name', type(object).__name__))


def _nobr(s):
    return f"<nobr>{s}</nobr>"


@summarize.register
def summarize_(data: Table):
    def previewer():
        view = TableView(selectionMode=TableView.NoSelection)
        view.setModel(TableModel(data))
        return view

    return PartialSummary(
        data.approx_len(),
        format_summary_details(data, format=Qt.RichText),
        previewer)


@summarize.register
def summarize_(matrix: DistMatrix):  # pylint: disable=function-redefined
    n, m = matrix.shape
    return PartialSummary(f"{n}×{m}", _nobr(f"{n}×{m} distance matrix"))


@summarize.register
def summarize_(results: Results):  # pylint: disable=function-redefined
    nmethods, ninstances = results.predicted.shape
    summary = f"{nmethods}×{ninstances}"
    details = f"{nmethods} method{_plural(nmethods)} " \
              f"on {ninstances} test instance{_plural(ninstances)}"
    return PartialSummary(summary, _nobr(details))


@summarize.register
def summarize_(attributes: AttributeList):  # pylint: disable=function-redefined
    n = len(attributes)
    if n == 0:
        details = "empty list"
    elif n <= 3:
        details = _nobr(", ".join(var.name for var in attributes))
    else:
        details = _nobr(", ".join(var.name for var in attributes[:2]) +
                       f" and {n - 2} others")
    return PartialSummary(n, details)


@summarize.register
def summarize_(preprocessor: Preprocess):
    if isinstance(preprocessor, PreprocessorList):
        if preprocessor.preprocessors:
            details = "<br/>".join(map(_name_of, preprocessor.preprocessors))
        else:
            details = _nobr(f"{_name_of(preprocessor)} (empty)")
    else:
        details = _name_of(preprocessor)
    return PartialSummary("🄿", details)


def summarize_by_name(type_, symbol):
    @summarize.register
    def summarize_(model: type_):
        return PartialSummary(symbol, _name_of(model))


summarize_by_name(Model, "&#9924;" if date.today().month == 12 else "🄼")
summarize_by_name(Learner, "🄻")
summarize_by_name(Scorer, "🅂")

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