{
    "file_diffs": [
        {
            "old_file_content": "import os.path\n\nfrom Orange.data.table import Table\nfrom Orange.data.io import \\\n    TabReader, CSVReader, PickleReader, ExcelReader, XlsReader, FileFormat\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.widget import Input\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils.save.owsavebase import OWSaveBase\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\n\n\n_userhome = os.path.expanduser(f\"~{os.sep}\")\n\n\nclass OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        if self.data is None:\n            self.info.set_input_summary(self.info.NoInput)\n        else:\n            self.info.set_input_summary(\n                str(len(self.data)),\n                f\"Data set {self.data.name or '(no name)'} \"\n                f\"with {len(self.data)} instances\")\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWSave).run(Table(\"iris\"))\n",
            "new_file_content": "import os.path\n\nfrom Orange.data.table import Table\nfrom Orange.data.io import \\\n    TabReader, CSVReader, PickleReader, ExcelReader, XlsReader, FileFormat\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.widget import Input\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils.save.owsavebase import OWSaveBase\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.utils.state_summary import format_summary_details\n\n\n_userhome = os.path.expanduser(f\"~{os.sep}\")\n\n\nclass OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWSave).run(Table(\"iris\"))\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/owsave.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "2a8446ab3",
                "new_commit_hash": "b3b55a4fa",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/owsave.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/owsave.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 8,
                            "length": 6
                        },
                        "new_range": {
                            "start": 8,
                            "length": 7
                        },
                        "section": "from Orange.widgets.widget import Input"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from Orange.widgets.settings import Setting",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.save.owsavebase import OWSaveBase",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.widgetpreview import WidgetPreview",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.state_summary import format_summary_details",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "_userhome = os.path.expanduser(f\"~{os.sep}\")",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/owsave.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.utils.state_summary import format_summary_details",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 11,
                            "end_lineno": 11,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 35,
                            "length": 6
                        },
                        "new_range": {
                            "start": 36,
                            "length": 8
                        },
                        "section": "class OWSave(OWSaveBase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    def __init__(self):",
                                "type": "context"
                            },
                            {
                                "content": "        super().__init__(2)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.info.set_input_summary(self.info.NoInput)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.grid.addWidget(",
                                "type": "context"
                            },
                            {
                                "content": "            gui.checkBox(",
                                "type": "context"
                            },
                            {
                                "content": "                None, self, \"add_type_annotations\",",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owsave.py",
                            "type": "class",
                            "name": "OWSave",
                            "content": "class OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 17,
                            "end_lineno": 150,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owsave.py",
                            "type": "method",
                            "name": "OWSave.__init__",
                            "content": "class OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 36,
                            "end_lineno": 51,
                            "parent": {
                                "file_name": "Orange/widgets/data/owsave.py",
                                "type": "class",
                                "name": "OWSave",
                                "content": "class OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 17,
                                "end_lineno": 150,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 79,
                            "length": 13
                        },
                        "new_range": {
                            "start": 82,
                            "length": 9
                        },
                        "section": "class OWSave(OWSaveBase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def update_status(self):",
                                "type": "context"
                            },
                            {
                                "content": "        if self.data is None:",
                                "type": "deleted"
                            },
                            {
                                "content": "            self.info.set_input_summary(self.info.NoInput)",
                                "type": "deleted"
                            },
                            {
                                "content": "        else:",
                                "type": "deleted"
                            },
                            {
                                "content": "            self.info.set_input_summary(",
                                "type": "deleted"
                            },
                            {
                                "content": "                str(len(self.data)),",
                                "type": "deleted"
                            },
                            {
                                "content": "                f\"Data set {self.data.name or '(no name)'} \"",
                                "type": "deleted"
                            },
                            {
                                "content": "                f\"with {len(self.data)} instances\")",
                                "type": "deleted"
                            },
                            {
                                "content": "        summary = len(self.data) if self.data else self.info.NoInput",
                                "type": "added"
                            },
                            {
                                "content": "        details = format_summary_details(self.data) if self.data else \"\"",
                                "type": "added"
                            },
                            {
                                "content": "        self.info.set_input_summary(summary, details)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def send_report(self):",
                                "type": "context"
                            },
                            {
                                "content": "        self.report_data_brief(self.data)",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owsave.py",
                            "type": "class",
                            "name": "OWSave",
                            "content": "class OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        if self.data is None:\n            self.info.set_input_summary(self.info.NoInput)\n        else:\n            self.info.set_input_summary(\n                str(len(self.data)),\n                f\"Data set {self.data.name or '(no name)'} \"\n                f\"with {len(self.data)} instances\")\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 16,
                            "end_lineno": 151,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owsave.py",
                            "type": "method",
                            "name": "OWSave.update_status",
                            "content": "class OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        if self.data is None:\n            self.info.set_input_summary(self.info.NoInput)\n        else:\n            self.info.set_input_summary(\n                str(len(self.data)),\n                f\"Data set {self.data.name or '(no name)'} \"\n                f\"with {len(self.data)} instances\")\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 81,
                            "end_lineno": 88,
                            "parent": {
                                "file_name": "Orange/widgets/data/owsave.py",
                                "type": "class",
                                "name": "OWSave",
                                "content": "class OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        if self.data is None:\n            self.info.set_input_summary(self.info.NoInput)\n        else:\n            self.info.set_input_summary(\n                str(len(self.data)),\n                f\"Data set {self.data.name or '(no name)'} \"\n                f\"with {len(self.data)} instances\")\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 16,
                                "end_lineno": 151,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# pylint: disable=missing-docstring, protected-access, unsubscriptable-object\nimport unittest\nfrom unittest.mock import patch, Mock\nimport os\nimport sys\n\nimport scipy.sparse as sp\nfrom AnyQt.QtWidgets import QFileDialog\n\nfrom Orange.data import Table\nfrom Orange.data.io import TabReader, PickleReader, ExcelReader, FileFormat\nfrom Orange.tests import named_file\nfrom Orange.widgets.data.owsave import OWSave, OWSaveBase\nfrom Orange.widgets.utils.save.tests.test_owsavebase import \\\n    SaveWidgetsTestBaseMixin\nfrom Orange.widgets.tests.base import WidgetTest, open_widget_classes\n\n\n# Yay, MS Windows!\n# This is not the proper general way to do it, but it's simplest and sufficient\n# Short name is suitable for the function's purpose\ndef _w(s):  # pylint: disable=invalid-name\n    return s.replace(\"/\", os.sep)\n\n\nclass MockFormat(FileFormat):\n    EXTENSIONS = ('.mock',)\n    DESCRIPTION = \"Mock file format\"\n\n    @staticmethod\n    def write_file(filename, data):\n        pass\n\n\nclass OWSaveTestBase(WidgetTest, SaveWidgetsTestBaseMixin):\n    def setUp(self):\n        with open_widget_classes():\n            class OWSaveMockWriter(OWSave):\n                writer = Mock()\n                writer.EXTENSIONS = [\".csv\"]\n                writer.SUPPORT_COMPRESSED = True\n                writer.SUPPORT_SPARSE_DATA = False\n                writer.OPTIONAL_TYPE_ANNOTATIONS = False\n\n        self.widget = self.create_widget(OWSaveMockWriter)  # type: OWSave\n        self.iris = Table(\"iris\")\n\n\nclass TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_called()\n\n        self.send_signal(datasig, None)\n        insum.assert_called_with(widget.info.NoInput)\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n\nclass TestFunctionalOWSave(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSave)  # type: OWSave\n        self.iris = Table(\"iris\")\n\n    def test_save_uncompressed(self):\n        widget = self.widget\n        widget.auto_save = False\n\n        spiris = Table(\"iris\")\n        spiris.X = sp.csr_matrix(spiris.X)\n\n        for selected_filter, writer in widget.get_filters().items():\n            widget.write = writer\n            ext = writer.EXTENSIONS[0]\n            with named_file(\"\", suffix=ext) as filename:\n                widget.get_save_filename = Mock(\n                    return_value=(filename, selected_filter))\n\n                self.send_signal(widget.Inputs.data, self.iris)\n                widget.save_file_as()\n                if hasattr(writer, \"read\"):\n                    self.assertEqual(len(Table(filename)), 150)\n\n                if writer.SUPPORT_SPARSE_DATA:\n                    self.send_signal(widget.Inputs.data, spiris)\n                    widget.save_file()\n                    if hasattr(writer, \"read\"):\n                        self.assertEqual(len(Table(filename)), 150)\n\n\n@unittest.skipUnless(sys.platform == \"linux\", \"Tests for dialog on Linux\")\nclass TestOWSaveLinuxDialog(OWSaveTestBase):\n    def test_get_save_filename_linux(self):\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        widget.get_filters = lambda: dict.fromkeys(\"abc\")\n        widget.filter = \"b\"\n        dlg = widget.SaveFileDialog = Mock()  # pylint: disable=invalid-name\n        instance = dlg.return_value\n        instance.selectedFiles.return_value = [\"foo\"]\n        instance.selectedNameFilter.return_value = \"bar\"\n        self.assertEqual(widget.get_save_filename(), (\"foo\", \"bar\"))\n        self.assertEqual(dlg.call_args[0][3], \"baz\")\n        self.assertEqual(dlg.call_args[0][4], \"a;;b;;c\")\n        instance.selectNameFilter.assert_called_with(\"b\")\n\n        instance.exec.return_value = QFileDialog.Rejected\n        self.assertEqual(widget.get_save_filename(), (\"\", \"\"))\n\n    @patch.object(OWSaveBase, \"filters\", OWSave.get_filters())\n    def test_save_file_dialog_enforces_extension_linux(self):\n        dialog = OWSave.SaveFileDialog(\n            OWSave, None, \"Save File\", \"foo.bar\",\n            \"Bar files (*.tab);;Low files (*.csv)\")\n\n        dialog.selectNameFilter(\"Low files (*.csv)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/foo.csv\"))\n\n        dialog.selectFile(\"high.bar\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.bar.csv\"))\n\n        dialog.selectNameFilter(\"Bar files (*.tab)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.bar.tab\"))\n\n        dialog.selectFile(\"middle.pkl\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/middle.tab\"))\n\n        dialog.filterSelected.emit(\"Low files (*.csv)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/middle.csv\"))\n\n        dialog.selectFile(\"high.tab.gz\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.csv\"))\n\n        dialog.selectFile(\"high.tab.gz.tab.tab.gz\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.csv\"))\n\n    def test_save_file_dialog_uses_valid_filters_linux(self):\n        widget = self.widget\n        widget.valid_filters = lambda: [\"a (*.a)\", \"b (*.b)\"]\n        widget.default_valid_filter = lambda: \"a (*.a)\"\n        dlg = widget.SaveFileDialog = Mock()  # pylint: disable=invalid-name\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        widget.get_save_filename()\n        self.assertEqual(dlg.call_args[0][4], \"a (*.a);;b (*.b)\")\n        instance.selectNameFilter.assert_called_with(\"a (*.a)\")\n\n\n@unittest.skipUnless(sys.platform in (\"darwin\", \"win32\"),\n                     \"Test for native dialog on Windows and macOS\")\nclass TestOWSaveDarwinDialog(OWSaveTestBase):  # pragma: no cover\n    if sys.platform == \"darwin\":\n        @staticmethod\n        def remove_star(filt):\n            return filt.replace(\" (*.\", \" (.\")\n    else:\n        @staticmethod\n        def remove_star(filt):\n            return filt\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_get_save_filename_darwin(self, dlg):\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        widget.get_filters = \\\n            lambda: dict.fromkeys((\"aa (*.a)\", \"bb (*.b)\", \"cc (*.c)\"))\n        widget.filter = \"bb (*.b)\"\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Accepted = QFileDialog.Accepted\n        instance.selectedFiles.return_value = [\"foo\"]\n        instance.selectedNameFilter.return_value = self.remove_star(\"aa (*.a)\")\n        self.assertEqual(widget.get_save_filename(), (\"foo.a\", \"aa (*.a)\"))\n        self.assertEqual(dlg.call_args[0][2], \"baz\")\n        self.assertEqual(\n            dlg.call_args[0][3],\n            self.remove_star(\"aa (*.a);;bb (*.b);;cc (*.c)\"))\n        instance.selectNameFilter.assert_called_with(\n            self.remove_star(\"bb (*.b)\"))\n\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        self.assertEqual(widget.get_save_filename(), (\"\", \"\"))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_save_file_dialog_enforces_extension_darwin(self, dlg):\n        widget = self.widget\n        filter1 = \"\"  # prevent pylint warning 'undefined-loop-variable'\n        for filter1 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter1) == \".tab\":\n                break\n        for filter2 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter2) == \".csv.gz\":\n                break\n\n        widget.filter = filter1\n        instance = dlg.return_value\n        instance.exec.return_value = QFileDialog.Accepted\n\n        instance.selectedNameFilter.return_value = self.remove_star(filter1)\n        instance.selectedFiles.return_value = [\"foo\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.pkl\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.tab.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.csv.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.bar\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.bar.tab\")\n\n        instance.selectedNameFilter.return_value = self.remove_star(filter2)\n        instance.selectedFiles.return_value = [\"foo\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.pkl\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.tab.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.csv.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.bar\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.bar.csv.gz\")\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    @patch(\"os.path.exists\", new=lambda x: x == \"old.tab\")\n    @patch(\"Orange.widgets.utils.save.owsavebase.QMessageBox\")\n    def test_save_file_dialog_asks_for_overwrite_darwin(self, msgbox, dlg):\n        def selected_files():\n            nonlocal attempts\n            attempts += 1\n            return [[\"old.tab\", \"new.tab\"][attempts]]\n\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        filter1 = \"\"  # prevent pylint warning 'undefined-loop-variable'\n        for filter1 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter1) == \".tab\":\n                break\n\n        widget.filter = filter1\n        instance = dlg.return_value\n        instance.exec.return_value = QFileDialog.Accepted\n        instance.selectedFiles = selected_files\n        instance.selectedNameFilter.return_value = self.remove_star(filter1)\n\n        attempts = -1\n        msgbox.question.return_value = msgbox.Yes = 1\n        self.assertEqual(widget.get_save_filename()[0], \"old.tab\")\n\n        attempts = -1\n        msgbox.question.return_value = msgbox.No = 0\n        self.assertEqual(widget.get_save_filename()[0], \"new.tab\")\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_save_file_dialog_uses_valid_filters_darwin(self, dlg):\n        widget = self.widget\n        widget.valid_filters = lambda: [\"aa (*.a)\", \"bb (*.b)\"]\n        widget.default_valid_filter = lambda: \"aa (*.a)\"\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        widget.get_save_filename()\n        self.assertEqual(\n            dlg.call_args[0][3], self.remove_star(\"aa (*.a);;bb (*.b)\"))\n        instance.selectNameFilter.assert_called_with(\n            self.remove_star(\"aa (*.a)\"))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "# pylint: disable=missing-docstring, protected-access, unsubscriptable-object\nimport unittest\nfrom unittest.mock import patch, Mock\nimport os\nimport sys\n\nimport scipy.sparse as sp\nfrom AnyQt.QtWidgets import QFileDialog\n\nfrom Orange.data import Table\nfrom Orange.data.io import TabReader, PickleReader, ExcelReader, FileFormat\nfrom Orange.tests import named_file\nfrom Orange.widgets.data.owsave import OWSave, OWSaveBase\nfrom Orange.widgets.utils.save.tests.test_owsavebase import \\\n    SaveWidgetsTestBaseMixin\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.tests.base import WidgetTest, open_widget_classes\n\n\n# Yay, MS Windows!\n# This is not the proper general way to do it, but it's simplest and sufficient\n# Short name is suitable for the function's purpose\ndef _w(s):  # pylint: disable=invalid-name\n    return s.replace(\"/\", os.sep)\n\n\nclass MockFormat(FileFormat):\n    EXTENSIONS = ('.mock',)\n    DESCRIPTION = \"Mock file format\"\n\n    @staticmethod\n    def write_file(filename, data):\n        pass\n\n\nclass OWSaveTestBase(WidgetTest, SaveWidgetsTestBaseMixin):\n    def setUp(self):\n        with open_widget_classes():\n            class OWSaveMockWriter(OWSave):\n                writer = Mock()\n                writer.EXTENSIONS = [\".csv\"]\n                writer.SUPPORT_COMPRESSED = True\n                writer.SUPPORT_SPARSE_DATA = False\n                writer.OPTIONAL_TYPE_ANNOTATIONS = False\n\n        self.widget = self.create_widget(OWSaveMockWriter)  # type: OWSave\n        self.iris = Table(\"iris\")\n\n\nclass TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))\n        savefile.assert_called()\n\n        insum.reset_mock()\n        self.send_signal(datasig, None)\n        insum.assert_called_once()\n        self.assertEqual(insum.call_args[0][0].brief, \"\")\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n\nclass TestFunctionalOWSave(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSave)  # type: OWSave\n        self.iris = Table(\"iris\")\n\n    def test_save_uncompressed(self):\n        widget = self.widget\n        widget.auto_save = False\n\n        spiris = Table(\"iris\")\n        spiris.X = sp.csr_matrix(spiris.X)\n\n        for selected_filter, writer in widget.get_filters().items():\n            widget.write = writer\n            ext = writer.EXTENSIONS[0]\n            with named_file(\"\", suffix=ext) as filename:\n                widget.get_save_filename = Mock(\n                    return_value=(filename, selected_filter))\n\n                self.send_signal(widget.Inputs.data, self.iris)\n                widget.save_file_as()\n                if hasattr(writer, \"read\"):\n                    self.assertEqual(len(Table(filename)), 150)\n\n                if writer.SUPPORT_SPARSE_DATA:\n                    self.send_signal(widget.Inputs.data, spiris)\n                    widget.save_file()\n                    if hasattr(writer, \"read\"):\n                        self.assertEqual(len(Table(filename)), 150)\n\n\n@unittest.skipUnless(sys.platform == \"linux\", \"Tests for dialog on Linux\")\nclass TestOWSaveLinuxDialog(OWSaveTestBase):\n    def test_get_save_filename_linux(self):\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        widget.get_filters = lambda: dict.fromkeys(\"abc\")\n        widget.filter = \"b\"\n        dlg = widget.SaveFileDialog = Mock()  # pylint: disable=invalid-name\n        instance = dlg.return_value\n        instance.selectedFiles.return_value = [\"foo\"]\n        instance.selectedNameFilter.return_value = \"bar\"\n        self.assertEqual(widget.get_save_filename(), (\"foo\", \"bar\"))\n        self.assertEqual(dlg.call_args[0][3], \"baz\")\n        self.assertEqual(dlg.call_args[0][4], \"a;;b;;c\")\n        instance.selectNameFilter.assert_called_with(\"b\")\n\n        instance.exec.return_value = QFileDialog.Rejected\n        self.assertEqual(widget.get_save_filename(), (\"\", \"\"))\n\n    @patch.object(OWSaveBase, \"filters\", OWSave.get_filters())\n    def test_save_file_dialog_enforces_extension_linux(self):\n        dialog = OWSave.SaveFileDialog(\n            OWSave, None, \"Save File\", \"foo.bar\",\n            \"Bar files (*.tab);;Low files (*.csv)\")\n\n        dialog.selectNameFilter(\"Low files (*.csv)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/foo.csv\"))\n\n        dialog.selectFile(\"high.bar\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.bar.csv\"))\n\n        dialog.selectNameFilter(\"Bar files (*.tab)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.bar.tab\"))\n\n        dialog.selectFile(\"middle.pkl\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/middle.tab\"))\n\n        dialog.filterSelected.emit(\"Low files (*.csv)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/middle.csv\"))\n\n        dialog.selectFile(\"high.tab.gz\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.csv\"))\n\n        dialog.selectFile(\"high.tab.gz.tab.tab.gz\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.csv\"))\n\n    def test_save_file_dialog_uses_valid_filters_linux(self):\n        widget = self.widget\n        widget.valid_filters = lambda: [\"a (*.a)\", \"b (*.b)\"]\n        widget.default_valid_filter = lambda: \"a (*.a)\"\n        dlg = widget.SaveFileDialog = Mock()  # pylint: disable=invalid-name\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        widget.get_save_filename()\n        self.assertEqual(dlg.call_args[0][4], \"a (*.a);;b (*.b)\")\n        instance.selectNameFilter.assert_called_with(\"a (*.a)\")\n\n\n@unittest.skipUnless(sys.platform in (\"darwin\", \"win32\"),\n                     \"Test for native dialog on Windows and macOS\")\nclass TestOWSaveDarwinDialog(OWSaveTestBase):  # pragma: no cover\n    if sys.platform == \"darwin\":\n        @staticmethod\n        def remove_star(filt):\n            return filt.replace(\" (*.\", \" (.\")\n    else:\n        @staticmethod\n        def remove_star(filt):\n            return filt\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_get_save_filename_darwin(self, dlg):\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        widget.get_filters = \\\n            lambda: dict.fromkeys((\"aa (*.a)\", \"bb (*.b)\", \"cc (*.c)\"))\n        widget.filter = \"bb (*.b)\"\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Accepted = QFileDialog.Accepted\n        instance.selectedFiles.return_value = [\"foo\"]\n        instance.selectedNameFilter.return_value = self.remove_star(\"aa (*.a)\")\n        self.assertEqual(widget.get_save_filename(), (\"foo.a\", \"aa (*.a)\"))\n        self.assertEqual(dlg.call_args[0][2], \"baz\")\n        self.assertEqual(\n            dlg.call_args[0][3],\n            self.remove_star(\"aa (*.a);;bb (*.b);;cc (*.c)\"))\n        instance.selectNameFilter.assert_called_with(\n            self.remove_star(\"bb (*.b)\"))\n\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        self.assertEqual(widget.get_save_filename(), (\"\", \"\"))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_save_file_dialog_enforces_extension_darwin(self, dlg):\n        widget = self.widget\n        filter1 = \"\"  # prevent pylint warning 'undefined-loop-variable'\n        for filter1 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter1) == \".tab\":\n                break\n        for filter2 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter2) == \".csv.gz\":\n                break\n\n        widget.filter = filter1\n        instance = dlg.return_value\n        instance.exec.return_value = QFileDialog.Accepted\n\n        instance.selectedNameFilter.return_value = self.remove_star(filter1)\n        instance.selectedFiles.return_value = [\"foo\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.pkl\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.tab.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.csv.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.bar\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.bar.tab\")\n\n        instance.selectedNameFilter.return_value = self.remove_star(filter2)\n        instance.selectedFiles.return_value = [\"foo\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.pkl\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.tab.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.csv.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.bar\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.bar.csv.gz\")\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    @patch(\"os.path.exists\", new=lambda x: x == \"old.tab\")\n    @patch(\"Orange.widgets.utils.save.owsavebase.QMessageBox\")\n    def test_save_file_dialog_asks_for_overwrite_darwin(self, msgbox, dlg):\n        def selected_files():\n            nonlocal attempts\n            attempts += 1\n            return [[\"old.tab\", \"new.tab\"][attempts]]\n\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        filter1 = \"\"  # prevent pylint warning 'undefined-loop-variable'\n        for filter1 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter1) == \".tab\":\n                break\n\n        widget.filter = filter1\n        instance = dlg.return_value\n        instance.exec.return_value = QFileDialog.Accepted\n        instance.selectedFiles = selected_files\n        instance.selectedNameFilter.return_value = self.remove_star(filter1)\n\n        attempts = -1\n        msgbox.question.return_value = msgbox.Yes = 1\n        self.assertEqual(widget.get_save_filename()[0], \"old.tab\")\n\n        attempts = -1\n        msgbox.question.return_value = msgbox.No = 0\n        self.assertEqual(widget.get_save_filename()[0], \"new.tab\")\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_save_file_dialog_uses_valid_filters_darwin(self, dlg):\n        widget = self.widget\n        widget.valid_filters = lambda: [\"aa (*.a)\", \"bb (*.b)\"]\n        widget.default_valid_filter = lambda: \"aa (*.a)\"\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        widget.get_save_filename()\n        self.assertEqual(\n            dlg.call_args[0][3], self.remove_star(\"aa (*.a);;bb (*.b)\"))\n        instance.selectNameFilter.assert_called_with(\n            self.remove_star(\"aa (*.a)\"))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/tests/test_owsave.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "d09179a89",
                "new_commit_hash": "5982d3102",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/tests/test_owsave.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/tests/test_owsave.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 13,
                            "length": 6
                        },
                        "new_range": {
                            "start": 13,
                            "length": 7
                        },
                        "section": "from Orange.tests import named_file"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from Orange.widgets.data.owsave import OWSave, OWSaveBase",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.save.tests.test_owsavebase import \\",
                                "type": "context"
                            },
                            {
                                "content": "    SaveWidgetsTestBaseMixin",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.state_summary import format_summary_details",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.widgets.tests.base import WidgetTest, open_widget_classes",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owsave.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.widgets.utils.state_summary import format_summary_details",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 16,
                            "end_lineno": 16,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 55,
                            "length": 7
                        },
                        "new_range": {
                            "start": 56,
                            "length": 7
                        },
                        "section": "class TestOWSave(OWSaveTestBase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        datasig = widget.Inputs.data",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(datasig, self.iris)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(insum.call_args[0][0], \"150\")",
                                "type": "deleted"
                            },
                            {
                                "content": "        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))",
                                "type": "added"
                            },
                            {
                                "content": "        insum.reset_mock()",
                                "type": "context"
                            },
                            {
                                "content": "        savefile.reset_mock()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owsave.py",
                            "type": "method",
                            "name": "TestOWSave.test_dataset",
                            "content": "class TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_called()\n\n        self.send_signal(datasig, None)\n        insum.assert_called_with(widget.info.NoInput)\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 50,
                            "end_lineno": 75,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owsave.py",
                                "type": "class",
                                "name": "TestOWSave",
                                "content": "class TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_called()\n\n        self.send_signal(datasig, None)\n        insum.assert_called_with(widget.info.NoInput)\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 49,
                                "end_lineno": 380,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/data/tests/test_owsave.py",
                            "type": "class",
                            "name": "TestOWSave",
                            "content": "class TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_called()\n\n        self.send_signal(datasig, None)\n        insum.assert_called_with(widget.info.NoInput)\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 49,
                            "end_lineno": 380,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 63,
                            "length": 16
                        },
                        "new_range": {
                            "start": 64,
                            "length": 18
                        },
                        "section": "class TestOWSave(OWSaveTestBase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        widget.writer = TabReader",
                                "type": "context"
                            },
                            {
                                "content": "        widget.auto_save = False",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(datasig, self.iris)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(insum.call_args[0][0], \"150\")",
                                "type": "deleted"
                            },
                            {
                                "content": "        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))",
                                "type": "added"
                            },
                            {
                                "content": "        savefile.assert_not_called()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        widget.auto_save = True",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(datasig, self.iris)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(insum.call_args[0][0], \"150\")",
                                "type": "deleted"
                            },
                            {
                                "content": "        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))",
                                "type": "added"
                            },
                            {
                                "content": "        savefile.assert_called()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        insum.reset_mock()",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(datasig, None)",
                                "type": "context"
                            },
                            {
                                "content": "        insum.assert_called_with(widget.info.NoInput)",
                                "type": "deleted"
                            },
                            {
                                "content": "        insum.assert_called_once()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(insum.call_args[0][0].brief, \"\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_initial_start_dir(self):",
                                "type": "context"
                            },
                            {
                                "content": "        widget = self.widget",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owsave.py",
                            "type": "method",
                            "name": "TestOWSave.test_dataset",
                            "content": "class TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_called()\n\n        self.send_signal(datasig, None)\n        insum.assert_called_with(widget.info.NoInput)\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 50,
                            "end_lineno": 75,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owsave.py",
                                "type": "class",
                                "name": "TestOWSave",
                                "content": "class TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_called()\n\n        self.send_signal(datasig, None)\n        insum.assert_called_with(widget.info.NoInput)\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 49,
                                "end_lineno": 380,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/data/tests/test_owsave.py",
                            "type": "class",
                            "name": "TestOWSave",
                            "content": "class TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        self.assertEqual(insum.call_args[0][0], \"150\")\n        savefile.assert_called()\n\n        self.send_signal(datasig, None)\n        insum.assert_called_with(widget.info.NoInput)\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 49,
                            "end_lineno": 380,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "bafa2adcd9ea8903c568658a878911148a5fdb2c^",
    "new_commit_hash": "bafa2adcd9ea8903c568658a878911148a5fdb2c",
    "commit_message": "Merge pull request #4505 from aturanjanin/owsave\n\n[ENH] OWSave: Data info displayed in the status bar",
    "commit_date": "2020-03-13T10:30:29+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "bafa2adcd9ea8903c568658a878911148a5fdb2c",
    "test_file_codes": [
        "# pylint: disable=missing-docstring, protected-access, unsubscriptable-object\nimport unittest\nfrom unittest.mock import patch, Mock\nimport os\nimport sys\n\nimport scipy.sparse as sp\nfrom AnyQt.QtWidgets import QFileDialog\n\nfrom Orange.data import Table\nfrom Orange.data.io import TabReader, PickleReader, ExcelReader, FileFormat\nfrom Orange.tests import named_file\nfrom Orange.widgets.data.owsave import OWSave, OWSaveBase\nfrom Orange.widgets.utils.save.tests.test_owsavebase import \\\n    SaveWidgetsTestBaseMixin\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.tests.base import WidgetTest, open_widget_classes\n\n\n# Yay, MS Windows!\n# This is not the proper general way to do it, but it's simplest and sufficient\n# Short name is suitable for the function's purpose\ndef _w(s):  # pylint: disable=invalid-name\n    return s.replace(\"/\", os.sep)\n\n\nclass MockFormat(FileFormat):\n    EXTENSIONS = ('.mock',)\n    DESCRIPTION = \"Mock file format\"\n\n    @staticmethod\n    def write_file(filename, data):\n        pass\n\n\nclass OWSaveTestBase(WidgetTest, SaveWidgetsTestBaseMixin):\n    def setUp(self):\n        with open_widget_classes():\n            class OWSaveMockWriter(OWSave):\n                writer = Mock()\n                writer.EXTENSIONS = [\".csv\"]\n                writer.SUPPORT_COMPRESSED = True\n                writer.SUPPORT_SPARSE_DATA = False\n                writer.OPTIONAL_TYPE_ANNOTATIONS = False\n\n        self.widget = self.create_widget(OWSaveMockWriter)  # type: OWSave\n        self.iris = Table(\"iris\")\n\n\nclass TestOWSave(OWSaveTestBase):\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n\n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))\n        insum.reset_mock()\n        savefile.reset_mock()\n\n        widget.filename = \"foo.tab\"\n        widget.writer = TabReader\n        widget.auto_save = False\n        self.send_signal(datasig, self.iris)\n        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))\n        savefile.assert_not_called()\n\n        widget.auto_save = True\n        self.send_signal(datasig, self.iris)\n        insum.assert_called_with(len(self.iris), format_summary_details(self.iris))\n        savefile.assert_called()\n\n        insum.reset_mock()\n        self.send_signal(datasig, None)\n        insum.assert_called_once()\n        self.assertEqual(insum.call_args[0][0].brief, \"\")\n\n    def test_initial_start_dir(self):\n        widget = self.widget\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        self.assertEqual(widget.initial_start_dir(),\n                         _w(os.path.expanduser(\"~/\")))\n\n        with patch(\"os.path.exists\", return_value=True):\n            widget.filename = _w(\"/usr/foo/bar.csv\")\n            self.assertEqual(widget.initial_start_dir(), widget.filename)\n\n            widget.filename = \"\"\n            widget.last_dir = _w(\"/usr/bar\")\n            self.assertEqual(widget.initial_start_dir(), _w(\"/usr/bar/\"))\n\n            widget.last_dir = _w(\"/usr/bar\")\n            self.send_signal(widget.Inputs.data, self.iris)\n            self.assertEqual(widget.initial_start_dir(),\n                             _w(\"/usr/bar/iris.csv\"))\n\n            widget.last_dir = \"\"\n            self.assertEqual(widget.initial_start_dir(),\n                             os.path.expanduser(_w(\"~/iris.csv\")))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog.getSaveFileName\")\n    def test_save_file_sets_name(self, _filedialog):\n        widget = self.widget\n        filters = iter(widget.get_filters())\n        filter1 = next(filters)\n        filter2 = next(filters)\n\n        widget.filename = _w(\"/usr/foo/bar.csv\")\n        widget.last_dir = _w(\"/usr/foo/\")\n        widget.filter = filter1\n\n        widget.update_messages = Mock()\n        widget.do_save = Mock()\n        widget.data = Mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/usr/foo/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/usr/foo/\"))\n        self.assertEqual(widget.filter, filter1)\n        widget.update_messages.assert_not_called()\n        widget.do_save.assert_not_called()\n\n        widget.get_save_filename = \\\n            Mock(return_value=(_w(\"/bar/bar.csv\"), filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_called()\n        widget.do_save.reset_mock()\n\n        widget.get_save_filename = Mock(return_value=(\"\", filter2))\n        widget.save_file_as()\n        self.assertEqual(widget.filename, _w(\"/bar/bar.csv\"))\n        self.assertEqual(widget.last_dir, _w(\"/bar\"))\n        self.assertEqual(widget.filter, filter2)\n        self.assertIn(\"bar.csv\", widget.bt_save.text())\n        widget.update_messages.assert_called()\n        widget.do_save.assert_not_called()\n\n    def test_save_file_calls_save_as(self):\n        widget = self.widget\n        widget.save_file_as = Mock()\n\n        self.send_signal(widget.Inputs.data, self.iris)\n\n        widget.filename = \"\"\n        widget.save_file()\n        widget.save_file_as.assert_called()\n        widget.save_file_as.reset_mock()\n\n        widget.filename = \"bar.csv\"\n        widget.save_file()\n        widget.save_file_as.assert_not_called()\n\n    def test_save_file_checks_can_save(self):\n        widget = self.widget\n        widget.get_save_filename = Mock(return_value=(\"\", 0))\n\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"\"\n        self.send_signal(widget.Inputs.data, self.iris)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.filename = \"foo\"\n        widget.save_file()\n        widget.writer.write.assert_called()\n        widget.writer.reset_mock()\n\n        self.iris.X = sp.csr_matrix(self.iris.X)\n        widget.save_file()\n        widget.writer.write.assert_not_called()\n\n        widget.writer.SUPPORT_SPARSE_DATA = True\n        widget.save_file()\n        widget.writer.write.assert_called()\n\n    def test_save_file_write_errors(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n        widget.filename = _w(\"bar/foo\")\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, self.iris)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = IOError\n        self.send_signal(datasig, self.iris)\n        self.assertTrue(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = None\n        self.send_signal(datasig, None)\n        self.assertFalse(widget.Error.general_error.is_shown())\n\n        widget.writer.write.side_effect = ValueError\n        self.assertRaises(ValueError, self.send_signal, datasig, self.iris)\n\n    def test_save_file_write(self):\n        widget = self.widget\n        datasig = widget.Inputs.data\n\n        widget.auto_save = True\n\n        widget.filename = _w(\"bar/foo.csv\")\n        widget.add_type_annotations = True\n        self.send_signal(datasig, self.iris)\n        widget.writer.write.assert_called_with(\n            _w(\"bar/foo.csv\"), self.iris, True)\n\n    def test_file_name_label(self):\n        widget = self.widget\n\n        widget.filename = \"\"\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n        widget.auto_save = True\n        widget.update_messages()\n        self.assertTrue(widget.Error.no_file_name.is_shown())\n\n        widget.filename = _w(\"/foo/bar/baz.csv\")\n        widget.update_messages()\n        self.assertFalse(widget.Error.no_file_name.is_shown())\n\n    def test_sparse_error(self):\n        widget = self.widget\n        err = widget.Error.unsupported_sparse\n\n        widget.writer = ExcelReader\n        widget.filename = \"foo.xlsx\"\n        widget.data = self.iris\n\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.writer = PickleReader\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n        widget.writer = ExcelReader\n        widget.update_messages()\n        self.assertTrue(err.is_shown())\n\n        widget.data = None\n        widget.update_messages()\n        self.assertFalse(err.is_shown())\n\n    def test_valid_filters_for_sparse(self):\n        widget = self.widget\n\n        widget.data = None\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data = self.iris\n        self.assertEqual(widget.get_filters(), widget.valid_filters())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        valid = widget.valid_filters()\n        self.assertNotEqual(widget.get_filters(), {})\n        # false positive, pylint: disable=no-member\n        self.assertTrue(all(v.SUPPORT_SPARSE_DATA for v in valid.values()))\n\n    def test_valid_default_filter(self):\n        widget = self.widget\n        for widget.filter, writer in widget.get_filters().items():\n            if not writer.SUPPORT_SPARSE_DATA:\n                break\n\n        widget.data = None\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data = self.iris\n        self.assertIs(widget.filter, widget.default_valid_filter())\n\n        widget.data.X = sp.csr_matrix(widget.data.X)\n        self.assertTrue(\n            widget.get_filters()[widget.default_valid_filter()]\n            .SUPPORT_SPARSE_DATA)\n\n    def test_add_on_writers(self):\n        # test adding file formats after registering the widget\n        self.assertIn(MockFormat, self.widget.valid_filters().values())\n        # this test doesn't call it - test_save_uncompressed does\n\n    def test_send_report(self):\n        widget = self.widget\n\n        widget.report_items = Mock()\n        for writer in widget.get_filters().values():\n            widget.writer = writer\n            for widget.add_type_annotations in (False, True):\n                widget.filename = f\"foo.{writer.EXTENSIONS[0]}\"\n                widget.send_report()\n                items = dict(widget.report_items.call_args[0][0])\n                msg = f\"for {writer}, annotations={widget.add_type_annotations}\"\n                self.assertEqual(items[\"File name\"], widget.filename, msg=msg)\n                if writer.OPTIONAL_TYPE_ANNOTATIONS:\n                    self.assertEqual(\n                        items[\"Type annotations\"],\n                        [\"No\", \"Yes\"][widget.add_type_annotations], msg=msg)\n                else:\n                    self.assertFalse(items[\"Type annotations\"], msg=msg)\n\n    def test_migration_to_version_2(self):\n        const_settings = {\n            'add_type_annotations': True, 'auto_save': False,\n            'controlAreaVisible': True, 'last_dir': '/home/joe/Desktop',\n            '__version__': 1}\n\n        # No compression, Tab-separated values\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'gzip (.gz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Tab-separated values (*.tab)\"})\n\n        # Compression; ignore compression format (.xz is no longer supported)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Tab-separated values (.tab)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Compressed Tab-separated values (*.tab.gz)\"})\n\n        # No compression, Excel\n        settings = {**const_settings,\n                    'compress': False, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Excel with compression - compression must be ignored\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Microsoft Excel spreadsheet (.xlsx)'}\n        OWSave.migrate_settings(settings)\n        self.assertEqual(\n            settings,\n            {**const_settings,\n             \"filter\": \"Microsoft Excel spreadsheet (*.xlsx)\"})\n\n        # Missing filetype (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n        # Unsupported file format (is this possible?)\n        settings = {**const_settings,\n                    'compress': True, 'compression': 'lzma (.xz)',\n                    'filetype': 'Bar file (.bar)'}\n        OWSave.migrate_settings(settings)\n        self.assertTrue(settings[\"filter\"] in OWSave.get_filters())\n\n\nclass TestFunctionalOWSave(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSave)  # type: OWSave\n        self.iris = Table(\"iris\")\n\n    def test_save_uncompressed(self):\n        widget = self.widget\n        widget.auto_save = False\n\n        spiris = Table(\"iris\")\n        spiris.X = sp.csr_matrix(spiris.X)\n\n        for selected_filter, writer in widget.get_filters().items():\n            widget.write = writer\n            ext = writer.EXTENSIONS[0]\n            with named_file(\"\", suffix=ext) as filename:\n                widget.get_save_filename = Mock(\n                    return_value=(filename, selected_filter))\n\n                self.send_signal(widget.Inputs.data, self.iris)\n                widget.save_file_as()\n                if hasattr(writer, \"read\"):\n                    self.assertEqual(len(Table(filename)), 150)\n\n                if writer.SUPPORT_SPARSE_DATA:\n                    self.send_signal(widget.Inputs.data, spiris)\n                    widget.save_file()\n                    if hasattr(writer, \"read\"):\n                        self.assertEqual(len(Table(filename)), 150)\n\n\n@unittest.skipUnless(sys.platform == \"linux\", \"Tests for dialog on Linux\")\nclass TestOWSaveLinuxDialog(OWSaveTestBase):\n    def test_get_save_filename_linux(self):\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        widget.get_filters = lambda: dict.fromkeys(\"abc\")\n        widget.filter = \"b\"\n        dlg = widget.SaveFileDialog = Mock()  # pylint: disable=invalid-name\n        instance = dlg.return_value\n        instance.selectedFiles.return_value = [\"foo\"]\n        instance.selectedNameFilter.return_value = \"bar\"\n        self.assertEqual(widget.get_save_filename(), (\"foo\", \"bar\"))\n        self.assertEqual(dlg.call_args[0][3], \"baz\")\n        self.assertEqual(dlg.call_args[0][4], \"a;;b;;c\")\n        instance.selectNameFilter.assert_called_with(\"b\")\n\n        instance.exec.return_value = QFileDialog.Rejected\n        self.assertEqual(widget.get_save_filename(), (\"\", \"\"))\n\n    @patch.object(OWSaveBase, \"filters\", OWSave.get_filters())\n    def test_save_file_dialog_enforces_extension_linux(self):\n        dialog = OWSave.SaveFileDialog(\n            OWSave, None, \"Save File\", \"foo.bar\",\n            \"Bar files (*.tab);;Low files (*.csv)\")\n\n        dialog.selectNameFilter(\"Low files (*.csv)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/foo.csv\"))\n\n        dialog.selectFile(\"high.bar\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.bar.csv\"))\n\n        dialog.selectNameFilter(\"Bar files (*.tab)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.bar.tab\"))\n\n        dialog.selectFile(\"middle.pkl\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/middle.tab\"))\n\n        dialog.filterSelected.emit(\"Low files (*.csv)\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/middle.csv\"))\n\n        dialog.selectFile(\"high.tab.gz\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.csv\"))\n\n        dialog.selectFile(\"high.tab.gz.tab.tab.gz\")\n        self.assertTrue(dialog.selectedFiles()[0].endswith(\"/high.csv\"))\n\n    def test_save_file_dialog_uses_valid_filters_linux(self):\n        widget = self.widget\n        widget.valid_filters = lambda: [\"a (*.a)\", \"b (*.b)\"]\n        widget.default_valid_filter = lambda: \"a (*.a)\"\n        dlg = widget.SaveFileDialog = Mock()  # pylint: disable=invalid-name\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        widget.get_save_filename()\n        self.assertEqual(dlg.call_args[0][4], \"a (*.a);;b (*.b)\")\n        instance.selectNameFilter.assert_called_with(\"a (*.a)\")\n\n\n@unittest.skipUnless(sys.platform in (\"darwin\", \"win32\"),\n                     \"Test for native dialog on Windows and macOS\")\nclass TestOWSaveDarwinDialog(OWSaveTestBase):  # pragma: no cover\n    if sys.platform == \"darwin\":\n        @staticmethod\n        def remove_star(filt):\n            return filt.replace(\" (*.\", \" (.\")\n    else:\n        @staticmethod\n        def remove_star(filt):\n            return filt\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_get_save_filename_darwin(self, dlg):\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        widget.get_filters = \\\n            lambda: dict.fromkeys((\"aa (*.a)\", \"bb (*.b)\", \"cc (*.c)\"))\n        widget.filter = \"bb (*.b)\"\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Accepted = QFileDialog.Accepted\n        instance.selectedFiles.return_value = [\"foo\"]\n        instance.selectedNameFilter.return_value = self.remove_star(\"aa (*.a)\")\n        self.assertEqual(widget.get_save_filename(), (\"foo.a\", \"aa (*.a)\"))\n        self.assertEqual(dlg.call_args[0][2], \"baz\")\n        self.assertEqual(\n            dlg.call_args[0][3],\n            self.remove_star(\"aa (*.a);;bb (*.b);;cc (*.c)\"))\n        instance.selectNameFilter.assert_called_with(\n            self.remove_star(\"bb (*.b)\"))\n\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        self.assertEqual(widget.get_save_filename(), (\"\", \"\"))\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_save_file_dialog_enforces_extension_darwin(self, dlg):\n        widget = self.widget\n        filter1 = \"\"  # prevent pylint warning 'undefined-loop-variable'\n        for filter1 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter1) == \".tab\":\n                break\n        for filter2 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter2) == \".csv.gz\":\n                break\n\n        widget.filter = filter1\n        instance = dlg.return_value\n        instance.exec.return_value = QFileDialog.Accepted\n\n        instance.selectedNameFilter.return_value = self.remove_star(filter1)\n        instance.selectedFiles.return_value = [\"foo\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.pkl\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.tab.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.csv.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.tab\")\n        instance.selectedFiles.return_value = [\"foo.bar\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.bar.tab\")\n\n        instance.selectedNameFilter.return_value = self.remove_star(filter2)\n        instance.selectedFiles.return_value = [\"foo\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.pkl\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.tab.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.csv.gz\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.csv.gz\")\n        instance.selectedFiles.return_value = [\"foo.bar\"]\n        self.assertEqual(widget.get_save_filename()[0], \"foo.bar.csv.gz\")\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    @patch(\"os.path.exists\", new=lambda x: x == \"old.tab\")\n    @patch(\"Orange.widgets.utils.save.owsavebase.QMessageBox\")\n    def test_save_file_dialog_asks_for_overwrite_darwin(self, msgbox, dlg):\n        def selected_files():\n            nonlocal attempts\n            attempts += 1\n            return [[\"old.tab\", \"new.tab\"][attempts]]\n\n        widget = self.widget\n        widget.initial_start_dir = lambda: \"baz\"\n        filter1 = \"\"  # prevent pylint warning 'undefined-loop-variable'\n        for filter1 in widget.get_filters():\n            if OWSaveBase._extension_from_filter(filter1) == \".tab\":\n                break\n\n        widget.filter = filter1\n        instance = dlg.return_value\n        instance.exec.return_value = QFileDialog.Accepted\n        instance.selectedFiles = selected_files\n        instance.selectedNameFilter.return_value = self.remove_star(filter1)\n\n        attempts = -1\n        msgbox.question.return_value = msgbox.Yes = 1\n        self.assertEqual(widget.get_save_filename()[0], \"old.tab\")\n\n        attempts = -1\n        msgbox.question.return_value = msgbox.No = 0\n        self.assertEqual(widget.get_save_filename()[0], \"new.tab\")\n\n    @patch(\"Orange.widgets.utils.save.owsavebase.QFileDialog\")\n    def test_save_file_dialog_uses_valid_filters_darwin(self, dlg):\n        widget = self.widget\n        widget.valid_filters = lambda: [\"aa (*.a)\", \"bb (*.b)\"]\n        widget.default_valid_filter = lambda: \"aa (*.a)\"\n        instance = dlg.return_value\n        instance.exec.return_value = dlg.Rejected = QFileDialog.Rejected\n        widget.get_save_filename()\n        self.assertEqual(\n            dlg.call_args[0][3], self.remove_star(\"aa (*.a);;bb (*.b)\"))\n        instance.selectNameFilter.assert_called_with(\n            self.remove_star(\"aa (*.a)\"))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpk4xw3o9j/tmp\ncreating /tmp/tmpk4xw3o9j/tmp/tmpk4xw3o9j\ncompile options: '-MMD -MF /tmp/tmpk4xw3o9j/file.c.d -c'\ncc: /tmp/tmpk4xw3o9j/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmplyzsddnv/tmp\ncreating /tmp/tmplyzsddnv/tmp/tmplyzsddnv\ncompile options: '-MMD -MF /tmp/tmplyzsddnv/file.c.d -c'\ncc: /tmp/tmplyzsddnv/file.c\ncustomize UnixCCompiler using build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_simple_tree.c\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 Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_tree_scorers.c\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 Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_valuecount.c\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 Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_contingency.c\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 Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_io.c\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 Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_variable.c\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 Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/distance/_distance.c\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 Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/preprocess/_discretize.c\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 Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/preprocess/_relieff.cpp\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 Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/projection/_som.c\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 Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/widgets/utils/_grid_density.cpp\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 Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nrunning develop\nrunning build_scripts\nrunning egg_info\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\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'\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching 'COPYING'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpp04vkkoc/tmp\ncreating /tmp/tmpp04vkkoc/tmp/tmpp04vkkoc\ncompile options: '-MMD -MF /tmp/tmpp04vkkoc/file.c.d -c'\ncc: /tmp/tmpp04vkkoc/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmprmltjjzk/tmp\ncreating /tmp/tmprmltjjzk/tmp/tmprmltjjzk\ncompile options: '-MMD -MF /tmp/tmprmltjjzk/file.c.d -c'\ncc: /tmp/tmprmltjjzk/file.c\ncustomize UnixCCompiler using build_ext\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.25.0.dev0+bafa2ad to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c\nProcessing dependencies for Orange3==3.25.0.dev0+bafa2ad\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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.10.0\nBest match: pyqtgraph 0.10.0\nAdding pyqtgraph 0.10.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.25.0.dev0+bafa2ad\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 135ms\nPrepared 18 packages in 60ms\nInstalled 18 packages in 331ms\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 48 packages in 296ms\nInstalled 42 packages in 541ms\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 + 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 + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 34 packages in 121ms\nInstalled 13 packages in 57ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + platformdirs==4.0.0\n + pyqtgraph==0.10.0\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 5ms\nInstalled 2 packages in 7ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nAudited 1 package in 24ms\nAudited 2 packages in 1ms\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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:3115:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3115 |   __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:4619:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4619 |   __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:5396:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5396 |           for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5517:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5517 |           __pyx_t_27 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5523:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5523 |           __pyx_t_27 = (((__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:7051:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7051 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7741:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7741 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7801:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7801 |               __pyx_t_17 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_18 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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:3881:24: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3881 |           __pyx_v_decs = (__pyx_v_decs / 10.0);\n      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:4070:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4070 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:480:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  480 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1301:7: note: ‘__pyx_v_attr_index’ was declared here\n 1301 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:2935:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2935 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:581:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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:3655:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3655 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3654:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3654 |   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:4547:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4547 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4114:7: note: ‘__pyx_v_win_y’ was declared here\n 4114 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4536:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4536 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4113:7: note: ‘__pyx_v_win_x’ was declared here\n 4113 |   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:4746:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4746 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4745:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4745 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3141:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3141 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:2964:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2964 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2665:7: note: ‘__pyx_v_win_y’ was declared here\n 2665 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:2953:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2953 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2664:7: note: ‘__pyx_v_win_x’ was declared here\n 2664 |   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:5515:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5515 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5514:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5514 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.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_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_bafa2adcd9ea8903c568658a878911148a5fdb2c/.venv/lib/python3.7/site-packages/setuptools/command/egg_info.py:628: SetuptoolsDeprecationWarning: Custom 'build_py' does not implement 'get_data_files_without_manifest'.\nPlease extend command classes from setuptools instead of distutils.\n  SetuptoolsDeprecationWarning\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_bafa2adcd9ea8903c568658a878911148a5fdb2c\ncollected 48 items\n\nr2e_tests/test_1.py sss...........................F........sssssssss     [100%]\n\n=================================== FAILURES ===================================\n_________________ TestFunctionalOWSave.test_save_uncompressed __________________\n\nself = <Orange.data.io.XlsReader object at 0x7d9a565b8450>\n\n    def read(self):\n        try:\n>           cells = self.get_cells()\n\nOrange/data/io.py:263: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/data/io.py:346: in get_cells\n    sheet = self._get_active_sheet()\nOrange/data/io.py:361: in _get_active_sheet\n    return self.workbook.sheet_by_index(0)\nOrange/data/io.py:337: in workbook\n    self._workbook = xlrd.open_workbook(self.filename, on_demand=True)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nfilename = '/tmp/tmpog54rct5.xls'\nlogfile = <_io.TextIOWrapper name=\"<_io.FileIO name=7 mode='rb+' closefd=True>\" mode='r+' encoding='utf-8'>\nverbosity = 0, use_mmap = True, file_contents = None, encoding_override = None\nformatting_info = False, on_demand = True, ragged_rows = False\nignore_workbook_corruption = False\n\n    def open_workbook(filename=None,\n                      logfile=sys.stdout,\n                      verbosity=0,\n                      use_mmap=True,\n                      file_contents=None,\n                      encoding_override=None,\n                      formatting_info=False,\n                      on_demand=False,\n                      ragged_rows=False,\n                      ignore_workbook_corruption=False\n                      ):\n        \"\"\"\n        Open a spreadsheet file for data extraction.\n    \n        :param filename: The path to the spreadsheet file to be opened.\n    \n        :param logfile: An open file to which messages and diagnostics are written.\n    \n        :param verbosity: Increases the volume of trace material written to the\n                          logfile.\n    \n        :param use_mmap:\n    \n          Whether to use the mmap module is determined heuristically.\n          Use this arg to override the result.\n    \n          Current heuristic: mmap is used if it exists.\n    \n        :param file_contents:\n    \n          A string or an :class:`mmap.mmap` object or some other behave-alike\n          object. If ``file_contents`` is supplied, ``filename`` will not be used,\n          except (possibly) in messages.\n    \n        :param encoding_override:\n    \n          Used to overcome missing or bad codepage information\n          in older-version files. See :doc:`unicode`.\n    \n        :param formatting_info:\n    \n          The default is ``False``, which saves memory.\n          In this case, \"Blank\" cells, which are those with their own formatting\n          information but no data, are treated as empty by ignoring the file's\n          ``BLANK`` and ``MULBLANK`` records.\n          This cuts off any bottom or right \"margin\" of rows of empty or blank\n          cells.\n          Only :meth:`~xlrd.sheet.Sheet.cell_value` and\n          :meth:`~xlrd.sheet.Sheet.cell_type` are available.\n    \n          When ``True``, formatting information will be read from the spreadsheet\n          file. This provides all cells, including empty and blank cells.\n          Formatting information is available for each cell.\n    \n          Note that this will raise a NotImplementedError when used with an\n          xlsx file.\n    \n        :param on_demand:\n    \n          Governs whether sheets are all loaded initially or when demanded\n          by the caller. See :doc:`on_demand`.\n    \n        :param ragged_rows:\n    \n          The default of ``False`` means all rows are padded out with empty cells so\n          that all rows have the same size as found in\n          :attr:`~xlrd.sheet.Sheet.ncols`.\n    \n          ``True`` means that there are no empty cells at the ends of rows.\n          This can result in substantial memory savings if rows are of widely\n          varying sizes. See also the :meth:`~xlrd.sheet.Sheet.row_len` method.\n    \n    \n        :param ignore_workbook_corruption:\n    \n          This option allows to read corrupted workbooks.\n          When ``False`` you may face CompDocError: Workbook corruption.\n          When ``True`` that exception will be ignored.\n    \n        :returns: An instance of the :class:`~xlrd.book.Book` class.\n        \"\"\"\n    \n        file_format = inspect_format(filename, file_contents)\n        # We have to let unknown file formats pass through here, as some ancient\n        # files that xlrd can parse don't start with the expected signature.\n        if file_format and file_format != 'xls':\n>           raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')\nE           xlrd.biffh.XLRDError: Excel xlsx file; not supported\n\n.venv/lib/python3.7/site-packages/xlrd/__init__.py:170: XLRDError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_1.TestFunctionalOWSave testMethod=test_save_uncompressed>\n\n    def test_save_uncompressed(self):\n        widget = self.widget\n        widget.auto_save = False\n    \n        spiris = Table(\"iris\")\n        spiris.X = sp.csr_matrix(spiris.X)\n    \n        for selected_filter, writer in widget.get_filters().items():\n            widget.write = writer\n            ext = writer.EXTENSIONS[0]\n            with named_file(\"\", suffix=ext) as filename:\n                widget.get_save_filename = Mock(\n                    return_value=(filename, selected_filter))\n    \n                self.send_signal(widget.Inputs.data, self.iris)\n                widget.save_file_as()\n                if hasattr(writer, \"read\"):\n>                   self.assertEqual(len(Table(filename)), 150)\n\nr2e_tests/test_1.py:408: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/data/table.py:241: in __new__\n    return cls.from_file(args[0], **kwargs)\nOrange/data/table.py:696: in from_file\n    data = reader.read()\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Orange.data.io.XlsReader object at 0x7d9a565b8450>\n\n    def read(self):\n        try:\n            cells = self.get_cells()\n            table = self.data_table(cells)\n            table.name = path.splitext(path.split(self.filename)[-1])[0]\n            if self.sheet:\n                table.name = '-'.join((table.name, self.sheet))\n        except Exception:\n>           raise IOError(\"Couldn't load spreadsheet from \" + self.filename)\nE           OSError: Couldn't load spreadsheet from /tmp/tmpog54rct5.xls\n\nOrange/data/io.py:269: OSError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_filters\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_image_export\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_input_handler\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_minimum_size\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSave::test_add_on_writers\nPASSED r2e_tests/test_1.py::TestOWSave::test_dataset\nPASSED r2e_tests/test_1.py::TestOWSave::test_file_name_label\nPASSED r2e_tests/test_1.py::TestOWSave::test_filters\nPASSED r2e_tests/test_1.py::TestOWSave::test_image_export\nPASSED r2e_tests/test_1.py::TestOWSave::test_initial_start_dir\nPASSED r2e_tests/test_1.py::TestOWSave::test_input_handler\nPASSED r2e_tests/test_1.py::TestOWSave::test_migration_to_version_2\nPASSED r2e_tests/test_1.py::TestOWSave::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWSave::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_calls_save_as\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_checks_can_save\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_sets_name\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_write\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_write_errors\nPASSED r2e_tests/test_1.py::TestOWSave::test_send_report\nPASSED r2e_tests/test_1.py::TestOWSave::test_sparse_error\nPASSED r2e_tests/test_1.py::TestOWSave::test_valid_default_filter\nPASSED r2e_tests/test_1.py::TestOWSave::test_valid_filters_for_sparse\nPASSED r2e_tests/test_1.py::TestFunctionalOWSave::test_image_export\nPASSED r2e_tests/test_1.py::TestFunctionalOWSave::test_minimum_size\nPASSED r2e_tests/test_1.py::TestFunctionalOWSave::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_filters\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_get_save_filename_linux\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_image_export\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_input_handler\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_save_file_dialog_enforces_extension_linux\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_save_file_dialog_uses_valid_filters_linux\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\nSKIPPED [1] Orange/widgets/utils/save/tests/test_owsavebase.py:38: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:487: Test for native dialog on Windows and macOS\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: Test for native dialog on Windows and macOS\nSKIPPED [1] Orange/widgets/utils/save/tests/test_owsavebase.py:19: Test for native dialog on Windows and macOS\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: Test for native dialog on Windows and macOS\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:548: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:509: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:578: Test for native dialog on Windows and macOS\nFAILED r2e_tests/test_1.py::TestFunctionalOWSave::test_save_uncompressed - OS...\n=================== 1 failed, 35 passed, 12 skipped in 5.09s ===================\nWidgets left: 0    Max widgets: 780 \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_bafa2adcd9ea8903c568658a878911148a5fdb2c\ncollected 48 items\n\nr2e_tests/test_1.py sss......F....................F........sssssssss     [100%]\n\n=================================== FAILURES ===================================\n___________________________ TestOWSave.test_dataset ____________________________\n\nself = <r2e_tests.test_1.TestOWSave testMethod=test_dataset>\n\n    def test_dataset(self):\n        widget = self.widget\n        widget.auto_save = True\n        insum = widget.info.set_input_summary = Mock()\n        savefile = widget.save_file = Mock()\n    \n        datasig = widget.Inputs.data\n        self.send_signal(datasig, self.iris)\n>       insum.assert_called_with(len(self.iris), format_summary_details(self.iris))\n\nr2e_tests/test_1.py:59: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\n_mock_self = <Mock id='139315452766800'>\nargs = (150, '150 instances, 5 variables\\nFeatures: 4 numeric\\nTarget: categorical\\nMetas: —')\nkwargs = {}\nexpected = ((150, '150 instances, 5 variables\\nFeatures: 4 numeric\\nTarget: categorical\\nMetas: —'), {})\n_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7eb4e818d9e0>\nactual = call('150', 'Data set iris with 150 instances'), cause = None\n\n    def assert_called_with(_mock_self, *args, **kwargs):\n        \"\"\"assert that the mock was called with the specified arguments.\n    \n        Raises an AssertionError if the args and keyword args passed in are\n        different to the last call to the mock.\"\"\"\n        self = _mock_self\n        if self.call_args is None:\n            expected = self._format_mock_call_signature(args, kwargs)\n            raise AssertionError('Expected call: %s\\nNot called' % (expected,))\n    \n        def _error_message():\n            msg = self._format_mock_failure_message(args, kwargs)\n            return msg\n        expected = self._call_matcher((args, kwargs))\n        actual = self._call_matcher(self.call_args)\n        if expected != actual:\n            cause = expected if isinstance(expected, Exception) else None\n>           raise AssertionError(_error_message()) from cause\nE           AssertionError: Expected call: mock(150, '150 instances, 5 variables\\nFeatures: 4 numeric\\nTarget: categorical\\nMetas: —')\nE           Actual call: mock('150', 'Data set iris with 150 instances')\n\n../../../../.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py:878: AssertionError\n_________________ TestFunctionalOWSave.test_save_uncompressed __________________\n\nself = <Orange.data.io.XlsReader object at 0x7eb4e8119450>\n\n    def read(self):\n        try:\n>           cells = self.get_cells()\n\nOrange/data/io.py:263: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/data/io.py:346: in get_cells\n    sheet = self._get_active_sheet()\nOrange/data/io.py:361: in _get_active_sheet\n    return self.workbook.sheet_by_index(0)\nOrange/data/io.py:337: in workbook\n    self._workbook = xlrd.open_workbook(self.filename, on_demand=True)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nfilename = '/tmp/tmp1y9g34r1.xls'\nlogfile = <_io.TextIOWrapper name=\"<_io.FileIO name=7 mode='rb+' closefd=True>\" mode='r+' encoding='utf-8'>\nverbosity = 0, use_mmap = True, file_contents = None, encoding_override = None\nformatting_info = False, on_demand = True, ragged_rows = False\nignore_workbook_corruption = False\n\n    def open_workbook(filename=None,\n                      logfile=sys.stdout,\n                      verbosity=0,\n                      use_mmap=True,\n                      file_contents=None,\n                      encoding_override=None,\n                      formatting_info=False,\n                      on_demand=False,\n                      ragged_rows=False,\n                      ignore_workbook_corruption=False\n                      ):\n        \"\"\"\n        Open a spreadsheet file for data extraction.\n    \n        :param filename: The path to the spreadsheet file to be opened.\n    \n        :param logfile: An open file to which messages and diagnostics are written.\n    \n        :param verbosity: Increases the volume of trace material written to the\n                          logfile.\n    \n        :param use_mmap:\n    \n          Whether to use the mmap module is determined heuristically.\n          Use this arg to override the result.\n    \n          Current heuristic: mmap is used if it exists.\n    \n        :param file_contents:\n    \n          A string or an :class:`mmap.mmap` object or some other behave-alike\n          object. If ``file_contents`` is supplied, ``filename`` will not be used,\n          except (possibly) in messages.\n    \n        :param encoding_override:\n    \n          Used to overcome missing or bad codepage information\n          in older-version files. See :doc:`unicode`.\n    \n        :param formatting_info:\n    \n          The default is ``False``, which saves memory.\n          In this case, \"Blank\" cells, which are those with their own formatting\n          information but no data, are treated as empty by ignoring the file's\n          ``BLANK`` and ``MULBLANK`` records.\n          This cuts off any bottom or right \"margin\" of rows of empty or blank\n          cells.\n          Only :meth:`~xlrd.sheet.Sheet.cell_value` and\n          :meth:`~xlrd.sheet.Sheet.cell_type` are available.\n    \n          When ``True``, formatting information will be read from the spreadsheet\n          file. This provides all cells, including empty and blank cells.\n          Formatting information is available for each cell.\n    \n          Note that this will raise a NotImplementedError when used with an\n          xlsx file.\n    \n        :param on_demand:\n    \n          Governs whether sheets are all loaded initially or when demanded\n          by the caller. See :doc:`on_demand`.\n    \n        :param ragged_rows:\n    \n          The default of ``False`` means all rows are padded out with empty cells so\n          that all rows have the same size as found in\n          :attr:`~xlrd.sheet.Sheet.ncols`.\n    \n          ``True`` means that there are no empty cells at the ends of rows.\n          This can result in substantial memory savings if rows are of widely\n          varying sizes. See also the :meth:`~xlrd.sheet.Sheet.row_len` method.\n    \n    \n        :param ignore_workbook_corruption:\n    \n          This option allows to read corrupted workbooks.\n          When ``False`` you may face CompDocError: Workbook corruption.\n          When ``True`` that exception will be ignored.\n    \n        :returns: An instance of the :class:`~xlrd.book.Book` class.\n        \"\"\"\n    \n        file_format = inspect_format(filename, file_contents)\n        # We have to let unknown file formats pass through here, as some ancient\n        # files that xlrd can parse don't start with the expected signature.\n        if file_format and file_format != 'xls':\n>           raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')\nE           xlrd.biffh.XLRDError: Excel xlsx file; not supported\n\n.venv/lib/python3.7/site-packages/xlrd/__init__.py:170: XLRDError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_1.TestFunctionalOWSave testMethod=test_save_uncompressed>\n\n    def test_save_uncompressed(self):\n        widget = self.widget\n        widget.auto_save = False\n    \n        spiris = Table(\"iris\")\n        spiris.X = sp.csr_matrix(spiris.X)\n    \n        for selected_filter, writer in widget.get_filters().items():\n            widget.write = writer\n            ext = writer.EXTENSIONS[0]\n            with named_file(\"\", suffix=ext) as filename:\n                widget.get_save_filename = Mock(\n                    return_value=(filename, selected_filter))\n    \n                self.send_signal(widget.Inputs.data, self.iris)\n                widget.save_file_as()\n                if hasattr(writer, \"read\"):\n>                   self.assertEqual(len(Table(filename)), 150)\n\nr2e_tests/test_1.py:408: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/data/table.py:241: in __new__\n    return cls.from_file(args[0], **kwargs)\nOrange/data/table.py:696: in from_file\n    data = reader.read()\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Orange.data.io.XlsReader object at 0x7eb4e8119450>\n\n    def read(self):\n        try:\n            cells = self.get_cells()\n            table = self.data_table(cells)\n            table.name = path.splitext(path.split(self.filename)[-1])[0]\n            if self.sheet:\n                table.name = '-'.join((table.name, self.sheet))\n        except Exception:\n>           raise IOError(\"Couldn't load spreadsheet from \" + self.filename)\nE           OSError: Couldn't load spreadsheet from /tmp/tmp1y9g34r1.xls\n\nOrange/data/io.py:269: OSError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_filters\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_image_export\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_input_handler\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_minimum_size\nPASSED r2e_tests/test_1.py::OWSaveTestBase::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSave::test_add_on_writers\nPASSED r2e_tests/test_1.py::TestOWSave::test_file_name_label\nPASSED r2e_tests/test_1.py::TestOWSave::test_filters\nPASSED r2e_tests/test_1.py::TestOWSave::test_image_export\nPASSED r2e_tests/test_1.py::TestOWSave::test_initial_start_dir\nPASSED r2e_tests/test_1.py::TestOWSave::test_input_handler\nPASSED r2e_tests/test_1.py::TestOWSave::test_migration_to_version_2\nPASSED r2e_tests/test_1.py::TestOWSave::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWSave::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_calls_save_as\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_checks_can_save\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_sets_name\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_write\nPASSED r2e_tests/test_1.py::TestOWSave::test_save_file_write_errors\nPASSED r2e_tests/test_1.py::TestOWSave::test_send_report\nPASSED r2e_tests/test_1.py::TestOWSave::test_sparse_error\nPASSED r2e_tests/test_1.py::TestOWSave::test_valid_default_filter\nPASSED r2e_tests/test_1.py::TestOWSave::test_valid_filters_for_sparse\nPASSED r2e_tests/test_1.py::TestFunctionalOWSave::test_image_export\nPASSED r2e_tests/test_1.py::TestFunctionalOWSave::test_minimum_size\nPASSED r2e_tests/test_1.py::TestFunctionalOWSave::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_filters\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_get_save_filename_linux\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_image_export\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_input_handler\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_save_file_dialog_enforces_extension_linux\nPASSED r2e_tests/test_1.py::TestOWSaveLinuxDialog::test_save_file_dialog_uses_valid_filters_linux\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\nSKIPPED [1] Orange/widgets/utils/save/tests/test_owsavebase.py:38: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:487: Test for native dialog on Windows and macOS\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: Test for native dialog on Windows and macOS\nSKIPPED [1] Orange/widgets/utils/save/tests/test_owsavebase.py:19: Test for native dialog on Windows and macOS\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: Test for native dialog on Windows and macOS\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:548: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:509: Test for native dialog on Windows and macOS\nSKIPPED [1] r2e_tests/test_1.py:578: Test for native dialog on Windows and macOS\nFAILED r2e_tests/test_1.py::TestOWSave::test_dataset - AssertionError: Expect...\nFAILED r2e_tests/test_1.py::TestFunctionalOWSave::test_save_uncompressed - OS...\n=================== 2 failed, 34 passed, 12 skipped in 3.95s ===================\nWidgets left: 0    Max widgets: 784 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/data/owsave.py Orange/widgets/data/tests/test_owsave.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** OWSave Widget Displays Incorrect Data Summary in Status Bar

**Description:**
When loading a dataset into the OWSave widget, the information displayed in the status bar is improperly formatted. Instead of showing the number of instances as an integer along with detailed dataset information, it displays the instance count as a string with a simplified message. This discrepancy causes related tests to fail, indicating that the widget does not provide comprehensive data summaries as expected.

**Example Buggy Code:**
```python
def test_dataset_display(widget, dataset):
    widget.auto_save = True
    widget.info.set_input_summary = Mock()
    widget.send_signal(widget.Inputs.data, dataset)
    # Expected to be called with an integer and detailed summary
    # Instead, it was called with a string and a simplified summary
```

**Expected Behavior:**
When a dataset is loaded, the status bar should display:
- The number of instances as an integer.
- A detailed summary of the dataset, including the number of variables, their types, target information, and meta attributes.

**Actual Behavior:**
The status bar displays:
- The number of instances as a string.
- A simplified summary message, such as "Data set iris with 150 instances," lacking detailed information about the dataset structure.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/data/owsave.py
import os.path

from Orange.data.table import Table
from Orange.data.io import \
    TabReader, CSVReader, PickleReader, ExcelReader, XlsReader, FileFormat
from Orange.widgets import gui, widget
from Orange.widgets.widget import Input
from Orange.widgets.settings import Setting
from Orange.widgets.utils.save.owsavebase import OWSaveBase
from Orange.widgets.utils.widgetpreview import WidgetPreview


_userhome = os.path.expanduser(f"~{os.sep}")


class OWSave(OWSaveBase):
    name = "Save Data"
    description = "Save data to an output file."
    icon = "icons/Save.svg"
    category = "Data"
    keywords = ["export"]

    settings_version = 2

    class Inputs:
        data = Input("Data", Table)

    class Error(OWSaveBase.Error):
        unsupported_sparse = widget.Msg("Use Pickle format for sparse data.")

    add_type_annotations = Setting(True)

    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]

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

        self.grid.addWidget(
            gui.checkBox(
                None, self, "add_type_annotations",
                "Add type annotations to header",
                tooltip=
                "Some formats (Tab-delimited, Comma-separated) can include \n"
                "additional information about variables types in header rows.",
                callback=self.update_messages),
            0, 0, 1, 2)
        self.grid.setRowMinimumHeight(1, 8)
        self.adjustSize()

    @classmethod
    def get_filters(cls):
        writers = [format for format in FileFormat.formats
                   if getattr(format, 'write_file', None)
                   and getattr(format, "EXTENSIONS", None)]
        writers.sort(key=lambda writer: cls.builtin_order.index(writer)
                     if writer in cls.builtin_order else 99)

        return {
            **{f"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})": w
               for w in writers},
            **{f"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)": w
               for w in writers if w.SUPPORT_COMPRESSED}
        }

    @Inputs.data
    def dataset(self, data):
        self.data = data
        self.on_new_input()

    def do_save(self):
        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:
            return
        self.writer.write(self.filename, self.data, self.add_type_annotations)

    def update_messages(self):
        super().update_messages()
        self.Error.unsupported_sparse(
            shown=self.data is not None and self.data.is_sparse()
            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)

    def update_status(self):
        if self.data is None:
            self.info.set_input_summary(self.info.NoInput)
        else:
            self.info.set_input_summary(
                str(len(self.data)),
                f"Data set {self.data.name or '(no name)'} "
                f"with {len(self.data)} instances")

    def send_report(self):
        self.report_data_brief(self.data)
        writer = self.writer
        noyes = ["No", "Yes"]
        self.report_items((
            ("File name", self.filename or "not set"),
            ("Format", writer.DESCRIPTION),
            ("Type annotations",
             writer.OPTIONAL_TYPE_ANNOTATIONS
             and noyes[self.add_type_annotations])
        ))

    @classmethod
    def migrate_settings(cls, settings, version=0):
        def migrate_to_version_2():
            # Set the default; change later if possible
            settings.pop("compression", None)
            settings["filter"] = next(iter(cls.get_filters()))
            filetype = settings.pop("filetype", None)
            if filetype is None:
                return

            ext = cls._extension_from_filter(filetype)
            if settings.pop("compress", False):
                for afilter in cls.get_filters():
                    if ext + ".gz" in afilter:
                        settings["filter"] = afilter
                        return
                # If not found, uncompressed may have been erroneously set
                # for a writer that didn't support if (such as .xlsx), so
                # fall through to uncompressed
            for afilter in cls.get_filters():
                if ext in afilter:
                    settings["filter"] = afilter
                    return

        if version < 2:
            migrate_to_version_2()

    def initial_start_dir(self):
        if self.filename and os.path.exists(os.path.split(self.filename)[0]):
            return self.filename
        else:
            data_name = getattr(self.data, 'name', '')
            if data_name:
                data_name += self.writer.EXTENSIONS[0]
            return os.path.join(self.last_dir or _userhome, data_name)

    def valid_filters(self):
        if self.data is None or not self.data.is_sparse():
            return self.get_filters()
        else:
            return {filt: writer for filt, writer in self.get_filters().items()
                    if writer.SUPPORT_SPARSE_DATA}

    def default_valid_filter(self):
        valid = self.valid_filters()
        if self.data is None or not self.data.is_sparse() \
                or (self.filter in valid
                        and valid[self.filter].SUPPORT_SPARSE_DATA):
            return self.filter
        return next(iter(valid))


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWSave).run(Table("iris"))

```
--- 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:** OWSave Widget Displays Incorrect Data Summary in Status Bar

**Description:**
When loading a dataset into the OWSave widget, the information displayed in the status bar is improperly formatted. Instead of showing the number of instances as an integer along with detailed dataset information, it displays the instance count as a string with a simplified message. This discrepancy causes related tests to fail, indicating that the widget does not provide comprehensive data summaries as expected.

**Example Buggy Code:**
```python
def test_dataset_display(widget, dataset):
    widget.auto_save = True
    widget.info.set_input_summary = Mock()
    widget.send_signal(widget.Inputs.data, dataset)
    # Expected to be called with an integer and detailed summary
    # Instead, it was called with a string and a simplified summary
```

**Expected Behavior:**
When a dataset is loaded, the status bar should display:
- The number of instances as an integer.
- A detailed summary of the dataset, including the number of variables, their types, target information, and meta attributes.

**Actual Behavior:**
The status bar displays:
- The number of instances as a string.
- A simplified summary message, such as "Data set iris with 150 instances," lacking detailed information about the dataset structure.

[/ISSUE]
{
    "OWSaveTestBase.test_filters": "PASSED",
    "OWSaveTestBase.test_image_export": "PASSED",
    "OWSaveTestBase.test_input_handler": "PASSED",
    "OWSaveTestBase.test_minimum_size": "PASSED",
    "OWSaveTestBase.test_msg_base_class": "PASSED",
    "TestOWSave.test_add_on_writers": "PASSED",
    "TestOWSave.test_dataset": "PASSED",
    "TestOWSave.test_file_name_label": "PASSED",
    "TestOWSave.test_filters": "PASSED",
    "TestOWSave.test_image_export": "PASSED",
    "TestOWSave.test_initial_start_dir": "PASSED",
    "TestOWSave.test_input_handler": "PASSED",
    "TestOWSave.test_migration_to_version_2": "PASSED",
    "TestOWSave.test_minimum_size": "PASSED",
    "TestOWSave.test_msg_base_class": "PASSED",
    "TestOWSave.test_save_file_calls_save_as": "PASSED",
    "TestOWSave.test_save_file_checks_can_save": "PASSED",
    "TestOWSave.test_save_file_sets_name": "PASSED",
    "TestOWSave.test_save_file_write": "PASSED",
    "TestOWSave.test_save_file_write_errors": "PASSED",
    "TestOWSave.test_send_report": "PASSED",
    "TestOWSave.test_sparse_error": "PASSED",
    "TestOWSave.test_valid_default_filter": "PASSED",
    "TestOWSave.test_valid_filters_for_sparse": "PASSED",
    "TestFunctionalOWSave.test_image_export": "PASSED",
    "TestFunctionalOWSave.test_minimum_size": "PASSED",
    "TestFunctionalOWSave.test_msg_base_class": "PASSED",
    "TestOWSaveLinuxDialog.test_filters": "PASSED",
    "TestOWSaveLinuxDialog.test_get_save_filename_linux": "PASSED",
    "TestOWSaveLinuxDialog.test_image_export": "PASSED",
    "TestOWSaveLinuxDialog.test_input_handler": "PASSED",
    "TestOWSaveLinuxDialog.test_minimum_size": "PASSED",
    "TestOWSaveLinuxDialog.test_msg_base_class": "PASSED",
    "TestOWSaveLinuxDialog.test_save_file_dialog_enforces_extension_linux": "PASSED",
    "TestOWSaveLinuxDialog.test_save_file_dialog_uses_valid_filters_linux": "PASSED",
    "TestFunctionalOWSave.test_save_uncompressed": "FAILED"
}
diff --git a/Orange/widgets/data/owsave.py b/Orange/widgets/data/owsave.py
index 2a8446ab3..b3b55a4fa 100644
--- a/Orange/widgets/data/owsave.py
+++ b/Orange/widgets/data/owsave.py
@@ -8,6 +8,7 @@ from Orange.widgets.widget import Input
 from Orange.widgets.settings import Setting
 from Orange.widgets.utils.save.owsavebase import OWSaveBase
 from Orange.widgets.utils.widgetpreview import WidgetPreview
+from Orange.widgets.utils.state_summary import format_summary_details
 
 
 _userhome = os.path.expanduser(f"~{os.sep}")
@@ -35,6 +36,8 @@ class OWSave(OWSaveBase):
     def __init__(self):
         super().__init__(2)
 
+        self.info.set_input_summary(self.info.NoInput)
+
         self.grid.addWidget(
             gui.checkBox(
                 None, self, "add_type_annotations",
@@ -79,13 +82,9 @@ class OWSave(OWSaveBase):
             and self.filename and not self.writer.SUPPORT_SPARSE_DATA)
 
     def update_status(self):
-        if self.data is None:
-            self.info.set_input_summary(self.info.NoInput)
-        else:
-            self.info.set_input_summary(
-                str(len(self.data)),
-                f"Data set {self.data.name or '(no name)'} "
-                f"with {len(self.data)} instances")
+        summary = len(self.data) if self.data else self.info.NoInput
+        details = format_summary_details(self.data) if self.data else ""
+        self.info.set_input_summary(summary, details)
 
     def send_report(self):
         self.report_data_brief(self.data)

{"Orange/widgets/data/owsave.py": "import os.path\n\nfrom Orange.data.table import Table\nfrom Orange.data.io import \\\n    TabReader, CSVReader, PickleReader, ExcelReader, XlsReader, FileFormat\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.widget import Input\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils.save.owsavebase import OWSaveBase\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\n\n\n_userhome = os.path.expanduser(f\"~{os.sep}\")\n\n\nclass OWSave(OWSaveBase):\n    name = \"Save Data\"\n    description = \"Save data to an output file.\"\n    icon = \"icons/Save.svg\"\n    category = \"Data\"\n    keywords = [\"export\"]\n\n    settings_version = 2\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Error(OWSaveBase.Error):\n        unsupported_sparse = widget.Msg(\"Use Pickle format for sparse data.\")\n\n    add_type_annotations = Setting(True)\n\n    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]\n\n    def __init__(self):\n        super().__init__(2)\n\n        self.grid.addWidget(\n            gui.checkBox(\n                None, self, \"add_type_annotations\",\n                \"Add type annotations to header\",\n                tooltip=\n                \"Some formats (Tab-delimited, Comma-separated) can include \\n\"\n                \"additional information about variables types in header rows.\",\n                callback=self.update_messages),\n            0, 0, 1, 2)\n        self.grid.setRowMinimumHeight(1, 8)\n        self.adjustSize()\n\n    @classmethod\n    def get_filters(cls):\n        writers = [format for format in FileFormat.formats\n                   if getattr(format, 'write_file', None)\n                   and getattr(format, \"EXTENSIONS\", None)]\n        writers.sort(key=lambda writer: cls.builtin_order.index(writer)\n                     if writer in cls.builtin_order else 99)\n\n        return {\n            **{f\"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})\": w\n               for w in writers},\n            **{f\"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)\": w\n               for w in writers if w.SUPPORT_COMPRESSED}\n        }\n\n    @Inputs.data\n    def dataset(self, data):\n        self.data = data\n        self.on_new_input()\n\n    def do_save(self):\n        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:\n            return\n        self.writer.write(self.filename, self.data, self.add_type_annotations)\n\n    def update_messages(self):\n        super().update_messages()\n        self.Error.unsupported_sparse(\n            shown=self.data is not None and self.data.is_sparse()\n            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)\n\n    def update_status(self):\n        if self.data is None:\n            self.info.set_input_summary(self.info.NoInput)\n        else:\n            self.info.set_input_summary(\n                str(len(self.data)),\n                f\"Data set {self.data.name or '(no name)'} \"\n                f\"with {len(self.data)} instances\")\n\n    def send_report(self):\n        self.report_data_brief(self.data)\n        writer = self.writer\n        noyes = [\"No\", \"Yes\"]\n        self.report_items((\n            (\"File name\", self.filename or \"not set\"),\n            (\"Format\", writer.DESCRIPTION),\n            (\"Type annotations\",\n             writer.OPTIONAL_TYPE_ANNOTATIONS\n             and noyes[self.add_type_annotations])\n        ))\n\n    @classmethod\n    def migrate_settings(cls, settings, version=0):\n        def migrate_to_version_2():\n            # Set the default; change later if possible\n            settings.pop(\"compression\", None)\n            settings[\"filter\"] = next(iter(cls.get_filters()))\n            filetype = settings.pop(\"filetype\", None)\n            if filetype is None:\n                return\n\n            ext = cls._extension_from_filter(filetype)\n            if settings.pop(\"compress\", False):\n                for afilter in cls.get_filters():\n                    if ext + \".gz\" in afilter:\n                        settings[\"filter\"] = afilter\n                        return\n                # If not found, uncompressed may have been erroneously set\n                # for a writer that didn't support if (such as .xlsx), so\n                # fall through to uncompressed\n            for afilter in cls.get_filters():\n                if ext in afilter:\n                    settings[\"filter\"] = afilter\n                    return\n\n        if version < 2:\n            migrate_to_version_2()\n\n    def initial_start_dir(self):\n        if self.filename and os.path.exists(os.path.split(self.filename)[0]):\n            return self.filename\n        else:\n            data_name = getattr(self.data, 'name', '')\n            if data_name:\n                data_name += self.writer.EXTENSIONS[0]\n            return os.path.join(self.last_dir or _userhome, data_name)\n\n    def valid_filters(self):\n        if self.data is None or not self.data.is_sparse():\n            return self.get_filters()\n        else:\n            return {filt: writer for filt, writer in self.get_filters().items()\n                    if writer.SUPPORT_SPARSE_DATA}\n\n    def default_valid_filter(self):\n        valid = self.valid_filters()\n        if self.data is None or not self.data.is_sparse() \\\n                or (self.filter in valid\n                        and valid[self.filter].SUPPORT_SPARSE_DATA):\n            return self.filter\n        return next(iter(valid))\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWSave).run(Table(\"iris\"))\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:** OWSave Widget Displays Incorrect Data Summary in Status Bar

**Description:**
When loading a dataset into the OWSave widget, the information displayed in the status bar is improperly formatted. Instead of showing the number of instances as an integer along with detailed dataset information, it displays the instance count as a string with a simplified message. This discrepancy causes related tests to fail, indicating that the widget does not provide comprehensive data summaries as expected.

**Example Buggy Code:**
```python
def test_dataset_display(widget, dataset):
    widget.auto_save = True
    widget.info.set_input_summary = Mock()
    widget.send_signal(widget.Inputs.data, dataset)
    # Expected to be called with an integer and detailed summary
    # Instead, it was called with a string and a simplified summary
```

**Expected Behavior:**
When a dataset is loaded, the status bar should display:
- The number of instances as an integer.
- A detailed summary of the dataset, including the number of variables, their types, target information, and meta attributes.

**Actual Behavior:**
The status bar displays:
- The number of instances as a string.
- A simplified summary message, such as "Data set iris with 150 instances," lacking detailed information about the dataset structure.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/data/owsave.py
import os.path

from Orange.data.table import Table
from Orange.data.io import \
    TabReader, CSVReader, PickleReader, ExcelReader, XlsReader, FileFormat
from Orange.widgets import gui, widget
from Orange.widgets.widget import Input
from Orange.widgets.settings import Setting
from Orange.widgets.utils.save.owsavebase import OWSaveBase
from Orange.widgets.utils.widgetpreview import WidgetPreview


_userhome = os.path.expanduser(f"~{os.sep}")


class OWSave(OWSaveBase):
    name = "Save Data"
    description = "Save data to an output file."
    icon = "icons/Save.svg"
    category = "Data"
    keywords = ["export"]

    settings_version = 2

    class Inputs:
        data = Input("Data", Table)

    class Error(OWSaveBase.Error):
        unsupported_sparse = widget.Msg("Use Pickle format for sparse data.")

    add_type_annotations = Setting(True)

    builtin_order = [TabReader, CSVReader, PickleReader, ExcelReader, XlsReader]

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

        self.grid.addWidget(
            gui.checkBox(
                None, self, "add_type_annotations",
                "Add type annotations to header",
                tooltip=
                "Some formats (Tab-delimited, Comma-separated) can include \n"
                "additional information about variables types in header rows.",
                callback=self.update_messages),
            0, 0, 1, 2)
        self.grid.setRowMinimumHeight(1, 8)
        self.adjustSize()

    @classmethod
    def get_filters(cls):
        writers = [format for format in FileFormat.formats
                   if getattr(format, 'write_file', None)
                   and getattr(format, "EXTENSIONS", None)]
        writers.sort(key=lambda writer: cls.builtin_order.index(writer)
                     if writer in cls.builtin_order else 99)

        return {
            **{f"{w.DESCRIPTION} (*{w.EXTENSIONS[0]})": w
               for w in writers},
            **{f"Compressed {w.DESCRIPTION} (*{w.EXTENSIONS[0]}.gz)": w
               for w in writers if w.SUPPORT_COMPRESSED}
        }

    @Inputs.data
    def dataset(self, data):
        self.data = data
        self.on_new_input()

    def do_save(self):
        if self.data.is_sparse() and not self.writer.SUPPORT_SPARSE_DATA:
            return
        self.writer.write(self.filename, self.data, self.add_type_annotations)

    def update_messages(self):
        super().update_messages()
        self.Error.unsupported_sparse(
            shown=self.data is not None and self.data.is_sparse()
            and self.filename and not self.writer.SUPPORT_SPARSE_DATA)

    def update_status(self):
        if self.data is None:
            self.info.set_input_summary(self.info.NoInput)
        else:
            self.info.set_input_summary(
                str(len(self.data)),
                f"Data set {self.data.name or '(no name)'} "
                f"with {len(self.data)} instances")

    def send_report(self):
        self.report_data_brief(self.data)
        writer = self.writer
        noyes = ["No", "Yes"]
        self.report_items((
            ("File name", self.filename or "not set"),
            ("Format", writer.DESCRIPTION),
            ("Type annotations",
             writer.OPTIONAL_TYPE_ANNOTATIONS
             and noyes[self.add_type_annotations])
        ))

    @classmethod
    def migrate_settings(cls, settings, version=0):
        def migrate_to_version_2():
            # Set the default; change later if possible
            settings.pop("compression", None)
            settings["filter"] = next(iter(cls.get_filters()))
            filetype = settings.pop("filetype", None)
            if filetype is None:
                return

            ext = cls._extension_from_filter(filetype)
            if settings.pop("compress", False):
                for afilter in cls.get_filters():
                    if ext + ".gz" in afilter:
                        settings["filter"] = afilter
                        return
                # If not found, uncompressed may have been erroneously set
                # for a writer that didn't support if (such as .xlsx), so
                # fall through to uncompressed
            for afilter in cls.get_filters():
                if ext in afilter:
                    settings["filter"] = afilter
                    return

        if version < 2:
            migrate_to_version_2()

    def initial_start_dir(self):
        if self.filename and os.path.exists(os.path.split(self.filename)[0]):
            return self.filename
        else:
            data_name = getattr(self.data, 'name', '')
            if data_name:
                data_name += self.writer.EXTENSIONS[0]
            return os.path.join(self.last_dir or _userhome, data_name)

    def valid_filters(self):
        if self.data is None or not self.data.is_sparse():
            return self.get_filters()
        else:
            return {filt: writer for filt, writer in self.get_filters().items()
                    if writer.SUPPORT_SPARSE_DATA}

    def default_valid_filter(self):
        valid = self.valid_filters()
        if self.data is None or not self.data.is_sparse() \
                or (self.filter in valid
                        and valid[self.filter].SUPPORT_SPARSE_DATA):
            return self.filter
        return next(iter(valid))


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWSave).run(Table("iris"))

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