{
    "file_diffs": [
        {
            "old_file_content": "from copy import deepcopy\n\nfrom AnyQt.QtCore import QTimer, Qt\n\nfrom Orange.data import Table\nfrom Orange.modelling import Fitter, Learner, Model\nfrom Orange.preprocess.preprocess import Preprocess\nfrom Orange.statistics import util as ut\nfrom Orange.widgets import gui\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils import getmembers\nfrom Orange.widgets.utils.signals import Output, Input\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.widget import OWWidget, WidgetMetaClass, Msg\n\n\nclass OWBaseLearnerMeta(WidgetMetaClass):\n    \"\"\" Meta class for learner widgets\n\n    OWBaseLearner declares two outputs, learner and model with\n    generic type (Learner and Model).\n\n    This metaclass ensures that each of the subclasses gets\n    its own Outputs class with output that match the corresponding\n    learner.\n    \"\"\"\n    def __new__(cls, name, bases, attributes, **kwargs):\n        def abstract_widget():\n            return not attributes.get(\"name\")\n\n        def copy_outputs(template):\n            result = type(\"Outputs\", (), {})\n            for name, signal in getmembers(template, Output):\n                setattr(result, name, deepcopy(signal))\n            return result\n\n        obj = super().__new__(cls, name, bases, attributes, **kwargs)\n        if abstract_widget():\n            return obj\n\n        learner = attributes.get(\"LEARNER\")\n        if not learner:\n            raise AttributeError(\n                \"'{}' must declare attribute LEARNER\".format(name))\n\n        outputs = obj.Outputs = copy_outputs(obj.Outputs)\n        outputs.learner.type = learner\n        outputs.model.type = learner.__returns__\n\n        return obj\n\n\nclass OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):\n    \"\"\"Abstract widget for classification/regression learners.\n\n    Notes\n    -----\n    All learner widgets should define learner class LEARNER.\n    LEARNER should have __returns__ attribute.\n\n    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`\n    in case LEARNER has extra parameters.\n\n    \"\"\"\n    LEARNER = None\n    supports_sparse = True\n\n    learner_name = Setting(\"\", schema_only=True)\n    want_main_area = False\n    resizing_enabled = False\n    auto_apply = Setting(True)\n\n    class Error(OWWidget.Error):\n        data_error = Msg(\"{}\")\n        fitting_failed = Msg(\"Fitting failed.\\n{}\")\n        sparse_not_supported = Msg(\"Sparse data is not supported.\")\n        out_of_memory = Msg(\"Out of memory.\")\n\n    class Warning(OWWidget.Warning):\n        outdated_learner = Msg(\"Press Apply to submit changes.\")\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n        preprocessor = Input(\"Preprocessor\", Preprocess)\n\n    class Outputs:\n        learner = Output(\"Learner\", Learner, dynamic=False)\n        model = Output(\"Model\", Model, dynamic=False,\n                       replaces=[\"Classifier\", \"Predictor\"])\n\n    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code\n\n    def __init__(self, preprocessors=None):\n        super().__init__()\n        self.data = None\n        self.valid_data = False\n        self.learner = None\n        self.model = None\n        self.preprocessors = preprocessors\n        self.outdated_settings = False\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.setup_layout()\n        QTimer.singleShot(0, getattr(self, \"unconditional_apply\", self.apply))\n\n    def create_learner(self):\n        \"\"\"Creates a learner with current configuration.\n\n        Returns:\n            Learner: an instance of Orange.base.learner subclass.\n        \"\"\"\n        return self.LEARNER(preprocessors=self.preprocessors)\n\n    def get_learner_parameters(self):\n        \"\"\"Creates an `OrderedDict` or a sequence of pairs with current model\n        configuration.\n\n        Returns:\n            OrderedDict or List: (option, value) pairs or dict\n        \"\"\"\n        return []\n\n    @Inputs.preprocessor\n    def set_preprocessor(self, preprocessor):\n        self.preprocessors = preprocessor\n        self.apply()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        \"\"\"Set the input train dataset.\"\"\"\n        self.Error.data_error.clear()\n        self.data = data\n        self.set_input_summary()\n\n        if data is not None and data.domain.class_var is None:\n            self.Error.data_error(\"Data has no target variable.\\n\"\n                                  \"You can set a target variable with the Select Columns widget.\")\n            self.data = None\n\n        self.update_model()\n\n    def set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def apply(self):\n        \"\"\"Applies learner and sends new model.\"\"\"\n        self.update_learner()\n        self.update_model()\n\n    def update_learner(self):\n        self.learner = self.create_learner()\n        if self.learner and issubclass(self.LEARNER, Fitter):\n            self.learner.use_default_preprocessors = True\n        if self.learner is not None:\n            self.learner.name = self.learner_name or self.name\n        self.Outputs.learner.send(self.learner)\n        self.outdated_settings = False\n        self.Warning.outdated_learner.clear()\n\n    def show_fitting_failed(self, exc):\n        \"\"\"Show error when fitting fails.\n            Derived widgets can override this to show more specific messages.\"\"\"\n        self.Error.fitting_failed(str(exc), shown=exc is not None)\n\n    def update_model(self):\n        self.show_fitting_failed(None)\n        self.model = None\n        if self.check_data():\n            try:\n                self.model = self.learner(self.data)\n            except BaseException as exc:\n                self.show_fitting_failed(exc)\n            else:\n                self.model.name = self.learner_name or self.name\n                self.model.instances = self.data\n        self.Outputs.model.send(self.model)\n\n    def check_data(self):\n        self.valid_data = False\n        self.Error.sparse_not_supported.clear()\n        if self.data is not None and self.learner is not None:\n            self.Error.data_error.clear()\n            if not self.learner.check_learner_adequacy(self.data.domain):\n                self.Error.data_error(self.learner.learner_adequacy_err_msg)\n            elif not len(self.data):\n                self.Error.data_error(\"Dataset is empty.\")\n            elif len(ut.unique(self.data.Y)) < 2:\n                self.Error.data_error(\"Data contains a single target value.\")\n            elif self.data.X.size == 0:\n                self.Error.data_error(\"Data has no features to learn from.\")\n            elif self.data.is_sparse() and not self.supports_sparse:\n                self.Error.sparse_not_supported()\n            else:\n                self.valid_data = True\n        return self.valid_data\n\n    def settings_changed(self, *args, **kwargs):\n        self.outdated_settings = True\n        self.Warning.outdated_learner(shown=not self.auto_apply)\n        self.apply()\n\n    def _change_name(self, instance, output):\n        if instance:\n            instance.name = self.learner_name or self.name\n            if self.auto_apply:\n                output.send(instance)\n\n    def learner_name_changed(self):\n        self._change_name(self.learner, self.Outputs.learner)\n        self._change_name(self.model, self.Outputs.model)\n\n    def send_report(self):\n        self.report_items(((\"Name\", self.learner_name or self.name),))\n\n        model_parameters = self.get_learner_parameters()\n        if model_parameters:\n            self.report_items(\"Model parameters\", model_parameters)\n\n        if self.data:\n            self.report_data(\"Data\", self.data)\n\n    # GUI\n    def setup_layout(self):\n        self.add_learner_name_widget()\n        self.add_main_layout()\n        # Options specific to target variable type, if supported\n        if issubclass(self.LEARNER, Fitter):\n            # Only add a classification section if the method is overridden\n            if type(self).add_classification_layout is not \\\n                    OWBaseLearner.add_classification_layout:\n                classification_box = gui.widgetBox(\n                    self.controlArea, 'Classification')\n                self.add_classification_layout(classification_box)\n            # Only add a regression section if the method is overridden\n            if type(self).add_regression_layout is not \\\n                    OWBaseLearner.add_regression_layout:\n                regression_box = gui.widgetBox(self.controlArea, 'Regression')\n                self.add_regression_layout(regression_box)\n        self.add_bottom_buttons()\n\n    def add_main_layout(self):\n        \"\"\"Creates layout with the learner configuration widgets.\n\n        Override this method for laying out any learner-specific parameter controls.\n        See setup_layout() method for execution order.\n        \"\"\"\n        pass\n\n    def add_classification_layout(self, box):\n        \"\"\"Creates layout for classification specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_regression_layout(self, box):\n        \"\"\"Creates layout for regression specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_learner_name_widget(self):\n        self.name_line_edit = gui.lineEdit(\n            self.controlArea, self, 'learner_name', box='Name',\n            placeholderText=self.name,\n            tooltip='The name will identify this model in other widgets',\n            orientation=Qt.Horizontal, callback=self.learner_name_changed)\n\n    def add_bottom_buttons(self):\n        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)\n\n    def send(self, signalName, value, id=None):\n        # A subclass might still use the old syntax to send outputs\n        # defined on this class\n        for _, output in getmembers(self.Outputs, Output):\n            if output.name == signalName or signalName in output.replaces:\n                output.send(value, id=id)\n                return\n\n        super().send(signalName, value, id)\n\n    @classmethod\n    def get_widget_description(cls):\n        # When a subclass defines defines old-style signals, those override\n        # the new-style ones, so we add them manually\n        desc = super().get_widget_description()\n\n        if cls.outputs:\n            desc[\"outputs\"].extend(cls.get_signals(\"outputs\", True))\n        if cls.inputs:\n            desc[\"inputs\"].extend(cls.get_signals(\"inputs\", True))\n        return desc\n",
            "new_file_content": "from copy import deepcopy\n\nfrom AnyQt.QtCore import QTimer, Qt\n\nfrom Orange.data import Table\nfrom Orange.modelling import Fitter, Learner, Model\nfrom Orange.preprocess.preprocess import Preprocess\nfrom Orange.statistics import util as ut\nfrom Orange.widgets import gui\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils import getmembers\nfrom Orange.widgets.utils.signals import Output, Input\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.widget import OWWidget, WidgetMetaClass, Msg\n\n\nclass OWBaseLearnerMeta(WidgetMetaClass):\n    \"\"\" Meta class for learner widgets\n\n    OWBaseLearner declares two outputs, learner and model with\n    generic type (Learner and Model).\n\n    This metaclass ensures that each of the subclasses gets\n    its own Outputs class with output that match the corresponding\n    learner.\n    \"\"\"\n    def __new__(cls, name, bases, attributes, **kwargs):\n        def abstract_widget():\n            return not attributes.get(\"name\")\n\n        def copy_outputs(template):\n            result = type(\"Outputs\", (), {})\n            for name, signal in getmembers(template, Output):\n                setattr(result, name, deepcopy(signal))\n            return result\n\n        obj = super().__new__(cls, name, bases, attributes, **kwargs)\n        if abstract_widget():\n            return obj\n\n        learner = attributes.get(\"LEARNER\")\n        if not learner:\n            raise AttributeError(\n                \"'{}' must declare attribute LEARNER\".format(name))\n\n        outputs = obj.Outputs = copy_outputs(obj.Outputs)\n        outputs.learner.type = learner\n        outputs.model.type = learner.__returns__\n\n        return obj\n\n\nclass OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):\n    \"\"\"Abstract widget for classification/regression learners.\n\n    Notes\n    -----\n    All learner widgets should define learner class LEARNER.\n    LEARNER should have __returns__ attribute.\n\n    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`\n    in case LEARNER has extra parameters.\n\n    \"\"\"\n    LEARNER = None\n    supports_sparse = True\n\n    learner_name = Setting(\"\", schema_only=True)\n    want_main_area = False\n    resizing_enabled = False\n    auto_apply = Setting(True)\n\n    class Error(OWWidget.Error):\n        data_error = Msg(\"{}\")\n        fitting_failed = Msg(\"Fitting failed.\\n{}\")\n        sparse_not_supported = Msg(\"Sparse data is not supported.\")\n        out_of_memory = Msg(\"Out of memory.\")\n\n    class Warning(OWWidget.Warning):\n        outdated_learner = Msg(\"Press Apply to submit changes.\")\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n        preprocessor = Input(\"Preprocessor\", Preprocess)\n\n    class Outputs:\n        learner = Output(\"Learner\", Learner, dynamic=False)\n        model = Output(\"Model\", Model, dynamic=False,\n                       replaces=[\"Classifier\", \"Predictor\"])\n\n    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code\n\n    def __init__(self, preprocessors=None):\n        super().__init__()\n        self.data = None\n        self.valid_data = False\n        self.learner = None\n        self.model = None\n        self.preprocessors = preprocessors\n        self.outdated_settings = False\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.setup_layout()\n        QTimer.singleShot(0, getattr(self, \"unconditional_apply\", self.apply))\n\n    def create_learner(self):\n        \"\"\"Creates a learner with current configuration.\n\n        Returns:\n            Learner: an instance of Orange.base.learner subclass.\n        \"\"\"\n        return self.LEARNER(preprocessors=self.preprocessors)\n\n    def get_learner_parameters(self):\n        \"\"\"Creates an `OrderedDict` or a sequence of pairs with current model\n        configuration.\n\n        Returns:\n            OrderedDict or List: (option, value) pairs or dict\n        \"\"\"\n        return []\n\n    @Inputs.preprocessor\n    def set_preprocessor(self, preprocessor):\n        self.preprocessors = preprocessor\n        self.apply()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        \"\"\"Set the input train dataset.\"\"\"\n        self.Error.data_error.clear()\n        self.data = data\n        self.set_input_summary()\n\n        if data is not None and data.domain.class_var is None:\n            if data.domain.class_vars:\n                self.Error.data_error(\n                    \"Data contains multiple target variables.\\n\"\n                    \"Select a single one with the Select Columns widget.\")\n            else:\n                self.Error.data_error(\n                    \"Data has no target variable.\\n\"\n                    \"Select one with the Select Columns widget.\")\n            self.data = None\n\n        self.update_model()\n\n    def set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def apply(self):\n        \"\"\"Applies learner and sends new model.\"\"\"\n        self.update_learner()\n        self.update_model()\n\n    def update_learner(self):\n        self.learner = self.create_learner()\n        if self.learner and issubclass(self.LEARNER, Fitter):\n            self.learner.use_default_preprocessors = True\n        if self.learner is not None:\n            self.learner.name = self.learner_name or self.name\n        self.Outputs.learner.send(self.learner)\n        self.outdated_settings = False\n        self.Warning.outdated_learner.clear()\n\n    def show_fitting_failed(self, exc):\n        \"\"\"Show error when fitting fails.\n            Derived widgets can override this to show more specific messages.\"\"\"\n        self.Error.fitting_failed(str(exc), shown=exc is not None)\n\n    def update_model(self):\n        self.show_fitting_failed(None)\n        self.model = None\n        if self.check_data():\n            try:\n                self.model = self.learner(self.data)\n            except BaseException as exc:\n                self.show_fitting_failed(exc)\n            else:\n                self.model.name = self.learner_name or self.name\n                self.model.instances = self.data\n        self.Outputs.model.send(self.model)\n\n    def check_data(self):\n        self.valid_data = False\n        self.Error.sparse_not_supported.clear()\n        if self.data is not None and self.learner is not None:\n            self.Error.data_error.clear()\n            if not self.learner.check_learner_adequacy(self.data.domain):\n                self.Error.data_error(self.learner.learner_adequacy_err_msg)\n            elif not len(self.data):\n                self.Error.data_error(\"Dataset is empty.\")\n            elif len(ut.unique(self.data.Y)) < 2:\n                self.Error.data_error(\"Data contains a single target value.\")\n            elif self.data.X.size == 0:\n                self.Error.data_error(\"Data has no features to learn from.\")\n            elif self.data.is_sparse() and not self.supports_sparse:\n                self.Error.sparse_not_supported()\n            else:\n                self.valid_data = True\n        return self.valid_data\n\n    def settings_changed(self, *args, **kwargs):\n        self.outdated_settings = True\n        self.Warning.outdated_learner(shown=not self.auto_apply)\n        self.apply()\n\n    def _change_name(self, instance, output):\n        if instance:\n            instance.name = self.learner_name or self.name\n            if self.auto_apply:\n                output.send(instance)\n\n    def learner_name_changed(self):\n        self._change_name(self.learner, self.Outputs.learner)\n        self._change_name(self.model, self.Outputs.model)\n\n    def send_report(self):\n        self.report_items(((\"Name\", self.learner_name or self.name),))\n\n        model_parameters = self.get_learner_parameters()\n        if model_parameters:\n            self.report_items(\"Model parameters\", model_parameters)\n\n        if self.data:\n            self.report_data(\"Data\", self.data)\n\n    # GUI\n    def setup_layout(self):\n        self.add_learner_name_widget()\n        self.add_main_layout()\n        # Options specific to target variable type, if supported\n        if issubclass(self.LEARNER, Fitter):\n            # Only add a classification section if the method is overridden\n            if type(self).add_classification_layout is not \\\n                    OWBaseLearner.add_classification_layout:\n                classification_box = gui.widgetBox(\n                    self.controlArea, 'Classification')\n                self.add_classification_layout(classification_box)\n            # Only add a regression section if the method is overridden\n            if type(self).add_regression_layout is not \\\n                    OWBaseLearner.add_regression_layout:\n                regression_box = gui.widgetBox(self.controlArea, 'Regression')\n                self.add_regression_layout(regression_box)\n        self.add_bottom_buttons()\n\n    def add_main_layout(self):\n        \"\"\"Creates layout with the learner configuration widgets.\n\n        Override this method for laying out any learner-specific parameter controls.\n        See setup_layout() method for execution order.\n        \"\"\"\n        pass\n\n    def add_classification_layout(self, box):\n        \"\"\"Creates layout for classification specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_regression_layout(self, box):\n        \"\"\"Creates layout for regression specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_learner_name_widget(self):\n        self.name_line_edit = gui.lineEdit(\n            self.controlArea, self, 'learner_name', box='Name',\n            placeholderText=self.name,\n            tooltip='The name will identify this model in other widgets',\n            orientation=Qt.Horizontal, callback=self.learner_name_changed)\n\n    def add_bottom_buttons(self):\n        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)\n\n    def send(self, signalName, value, id=None):\n        # A subclass might still use the old syntax to send outputs\n        # defined on this class\n        for _, output in getmembers(self.Outputs, Output):\n            if output.name == signalName or signalName in output.replaces:\n                output.send(value, id=id)\n                return\n\n        super().send(signalName, value, id)\n\n    @classmethod\n    def get_widget_description(cls):\n        # When a subclass defines defines old-style signals, those override\n        # the new-style ones, so we add them manually\n        desc = super().get_widget_description()\n\n        if cls.outputs:\n            desc[\"outputs\"].extend(cls.get_signals(\"outputs\", True))\n        if cls.inputs:\n            desc[\"inputs\"].extend(cls.get_signals(\"inputs\", True))\n        return desc\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/utils/owlearnerwidget.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "d306500c8",
                "new_commit_hash": "881035183",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/utils/owlearnerwidget.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/utils/owlearnerwidget.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 136,
                            "length": 8
                        },
                        "new_range": {
                            "start": 136,
                            "length": 14
                        },
                        "section": "class OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.set_input_summary()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        if data is not None and data.domain.class_var is None:",
                                "type": "context"
                            },
                            {
                                "content": "            self.Error.data_error(\"Data has no target variable.\\n\"",
                                "type": "deleted"
                            },
                            {
                                "content": "                                  \"You can set a target variable with the Select Columns widget.\")",
                                "type": "deleted"
                            },
                            {
                                "content": "            if data.domain.class_vars:",
                                "type": "added"
                            },
                            {
                                "content": "                self.Error.data_error(",
                                "type": "added"
                            },
                            {
                                "content": "                    \"Data contains multiple target variables.\\n\"",
                                "type": "added"
                            },
                            {
                                "content": "                    \"Select a single one with the Select Columns widget.\")",
                                "type": "added"
                            },
                            {
                                "content": "            else:",
                                "type": "added"
                            },
                            {
                                "content": "                self.Error.data_error(",
                                "type": "added"
                            },
                            {
                                "content": "                    \"Data has no target variable.\\n\"",
                                "type": "added"
                            },
                            {
                                "content": "                    \"Select one with the Select Columns widget.\")",
                                "type": "added"
                            },
                            {
                                "content": "            self.data = None",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.update_model()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/utils/owlearnerwidget.py",
                            "type": "method",
                            "name": "OWBaseLearner.set_data",
                            "content": "class OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):\n    \"\"\"Abstract widget for classification/regression learners.\n\n    Notes\n    -----\n    All learner widgets should define learner class LEARNER.\n    LEARNER should have __returns__ attribute.\n\n    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`\n    in case LEARNER has extra parameters.\n\n    \"\"\"\n    LEARNER = None\n    supports_sparse = True\n\n    learner_name = Setting(\"\", schema_only=True)\n    want_main_area = False\n    resizing_enabled = False\n    auto_apply = Setting(True)\n\n    class Error(OWWidget.Error):\n        data_error = Msg(\"{}\")\n        fitting_failed = Msg(\"Fitting failed.\\n{}\")\n        sparse_not_supported = Msg(\"Sparse data is not supported.\")\n        out_of_memory = Msg(\"Out of memory.\")\n\n    class Warning(OWWidget.Warning):\n        outdated_learner = Msg(\"Press Apply to submit changes.\")\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n        preprocessor = Input(\"Preprocessor\", Preprocess)\n\n    class Outputs:\n        learner = Output(\"Learner\", Learner, dynamic=False)\n        model = Output(\"Model\", Model, dynamic=False,\n                       replaces=[\"Classifier\", \"Predictor\"])\n\n    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code\n\n    def __init__(self, preprocessors=None):\n        super().__init__()\n        self.data = None\n        self.valid_data = False\n        self.learner = None\n        self.model = None\n        self.preprocessors = preprocessors\n        self.outdated_settings = False\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.setup_layout()\n        QTimer.singleShot(0, getattr(self, \"unconditional_apply\", self.apply))\n\n    def create_learner(self):\n        \"\"\"Creates a learner with current configuration.\n\n        Returns:\n            Learner: an instance of Orange.base.learner subclass.\n        \"\"\"\n        return self.LEARNER(preprocessors=self.preprocessors)\n\n    def get_learner_parameters(self):\n        \"\"\"Creates an `OrderedDict` or a sequence of pairs with current model\n        configuration.\n\n        Returns:\n            OrderedDict or List: (option, value) pairs or dict\n        \"\"\"\n        return []\n\n    @Inputs.preprocessor\n    def set_preprocessor(self, preprocessor):\n        self.preprocessors = preprocessor\n        self.apply()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        \"\"\"Set the input train dataset.\"\"\"\n        self.Error.data_error.clear()\n        self.data = data\n        self.set_input_summary()\n\n        if data is not None and data.domain.class_var is None:\n            self.Error.data_error(\"Data has no target variable.\\n\"\n                                  \"You can set a target variable with the Select Columns widget.\")\n            self.data = None\n\n        self.update_model()\n\n    def set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def apply(self):\n        \"\"\"Applies learner and sends new model.\"\"\"\n        self.update_learner()\n        self.update_model()\n\n    def update_learner(self):\n        self.learner = self.create_learner()\n        if self.learner and issubclass(self.LEARNER, Fitter):\n            self.learner.use_default_preprocessors = True\n        if self.learner is not None:\n            self.learner.name = self.learner_name or self.name\n        self.Outputs.learner.send(self.learner)\n        self.outdated_settings = False\n        self.Warning.outdated_learner.clear()\n\n    def show_fitting_failed(self, exc):\n        \"\"\"Show error when fitting fails.\n            Derived widgets can override this to show more specific messages.\"\"\"\n        self.Error.fitting_failed(str(exc), shown=exc is not None)\n\n    def update_model(self):\n        self.show_fitting_failed(None)\n        self.model = None\n        if self.check_data():\n            try:\n                self.model = self.learner(self.data)\n            except BaseException as exc:\n                self.show_fitting_failed(exc)\n            else:\n                self.model.name = self.learner_name or self.name\n                self.model.instances = self.data\n        self.Outputs.model.send(self.model)\n\n    def check_data(self):\n        self.valid_data = False\n        self.Error.sparse_not_supported.clear()\n        if self.data is not None and self.learner is not None:\n            self.Error.data_error.clear()\n            if not self.learner.check_learner_adequacy(self.data.domain):\n                self.Error.data_error(self.learner.learner_adequacy_err_msg)\n            elif not len(self.data):\n                self.Error.data_error(\"Dataset is empty.\")\n            elif len(ut.unique(self.data.Y)) < 2:\n                self.Error.data_error(\"Data contains a single target value.\")\n            elif self.data.X.size == 0:\n                self.Error.data_error(\"Data has no features to learn from.\")\n            elif self.data.is_sparse() and not self.supports_sparse:\n                self.Error.sparse_not_supported()\n            else:\n                self.valid_data = True\n        return self.valid_data\n\n    def settings_changed(self, *args, **kwargs):\n        self.outdated_settings = True\n        self.Warning.outdated_learner(shown=not self.auto_apply)\n        self.apply()\n\n    def _change_name(self, instance, output):\n        if instance:\n            instance.name = self.learner_name or self.name\n            if self.auto_apply:\n                output.send(instance)\n\n    def learner_name_changed(self):\n        self._change_name(self.learner, self.Outputs.learner)\n        self._change_name(self.model, self.Outputs.model)\n\n    def send_report(self):\n        self.report_items(((\"Name\", self.learner_name or self.name),))\n\n        model_parameters = self.get_learner_parameters()\n        if model_parameters:\n            self.report_items(\"Model parameters\", model_parameters)\n\n        if self.data:\n            self.report_data(\"Data\", self.data)\n\n    # GUI\n    def setup_layout(self):\n        self.add_learner_name_widget()\n        self.add_main_layout()\n        # Options specific to target variable type, if supported\n        if issubclass(self.LEARNER, Fitter):\n            # Only add a classification section if the method is overridden\n            if type(self).add_classification_layout is not \\\n                    OWBaseLearner.add_classification_layout:\n                classification_box = gui.widgetBox(\n                    self.controlArea, 'Classification')\n                self.add_classification_layout(classification_box)\n            # Only add a regression section if the method is overridden\n            if type(self).add_regression_layout is not \\\n                    OWBaseLearner.add_regression_layout:\n                regression_box = gui.widgetBox(self.controlArea, 'Regression')\n                self.add_regression_layout(regression_box)\n        self.add_bottom_buttons()\n\n    def add_main_layout(self):\n        \"\"\"Creates layout with the learner configuration widgets.\n\n        Override this method for laying out any learner-specific parameter controls.\n        See setup_layout() method for execution order.\n        \"\"\"\n        pass\n\n    def add_classification_layout(self, box):\n        \"\"\"Creates layout for classification specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_regression_layout(self, box):\n        \"\"\"Creates layout for regression specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_learner_name_widget(self):\n        self.name_line_edit = gui.lineEdit(\n            self.controlArea, self, 'learner_name', box='Name',\n            placeholderText=self.name,\n            tooltip='The name will identify this model in other widgets',\n            orientation=Qt.Horizontal, callback=self.learner_name_changed)\n\n    def add_bottom_buttons(self):\n        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)\n\n    def send(self, signalName, value, id=None):\n        # A subclass might still use the old syntax to send outputs\n        # defined on this class\n        for _, output in getmembers(self.Outputs, Output):\n            if output.name == signalName or signalName in output.replaces:\n                output.send(value, id=id)\n                return\n\n        super().send(signalName, value, id)\n\n    @classmethod\n    def get_widget_description(cls):\n        # When a subclass defines defines old-style signals, those override\n        # the new-style ones, so we add them manually\n        desc = super().get_widget_description()\n\n        if cls.outputs:\n            desc[\"outputs\"].extend(cls.get_signals(\"outputs\", True))\n        if cls.inputs:\n            desc[\"inputs\"].extend(cls.get_signals(\"inputs\", True))\n        return desc",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 132,
                            "end_lineno": 143,
                            "parent": {
                                "file_name": "Orange/widgets/utils/owlearnerwidget.py",
                                "type": "class",
                                "name": "OWBaseLearner",
                                "content": "class OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):\n    \"\"\"Abstract widget for classification/regression learners.\n\n    Notes\n    -----\n    All learner widgets should define learner class LEARNER.\n    LEARNER should have __returns__ attribute.\n\n    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`\n    in case LEARNER has extra parameters.\n\n    \"\"\"\n    LEARNER = None\n    supports_sparse = True\n\n    learner_name = Setting(\"\", schema_only=True)\n    want_main_area = False\n    resizing_enabled = False\n    auto_apply = Setting(True)\n\n    class Error(OWWidget.Error):\n        data_error = Msg(\"{}\")\n        fitting_failed = Msg(\"Fitting failed.\\n{}\")\n        sparse_not_supported = Msg(\"Sparse data is not supported.\")\n        out_of_memory = Msg(\"Out of memory.\")\n\n    class Warning(OWWidget.Warning):\n        outdated_learner = Msg(\"Press Apply to submit changes.\")\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n        preprocessor = Input(\"Preprocessor\", Preprocess)\n\n    class Outputs:\n        learner = Output(\"Learner\", Learner, dynamic=False)\n        model = Output(\"Model\", Model, dynamic=False,\n                       replaces=[\"Classifier\", \"Predictor\"])\n\n    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code\n\n    def __init__(self, preprocessors=None):\n        super().__init__()\n        self.data = None\n        self.valid_data = False\n        self.learner = None\n        self.model = None\n        self.preprocessors = preprocessors\n        self.outdated_settings = False\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.setup_layout()\n        QTimer.singleShot(0, getattr(self, \"unconditional_apply\", self.apply))\n\n    def create_learner(self):\n        \"\"\"Creates a learner with current configuration.\n\n        Returns:\n            Learner: an instance of Orange.base.learner subclass.\n        \"\"\"\n        return self.LEARNER(preprocessors=self.preprocessors)\n\n    def get_learner_parameters(self):\n        \"\"\"Creates an `OrderedDict` or a sequence of pairs with current model\n        configuration.\n\n        Returns:\n            OrderedDict or List: (option, value) pairs or dict\n        \"\"\"\n        return []\n\n    @Inputs.preprocessor\n    def set_preprocessor(self, preprocessor):\n        self.preprocessors = preprocessor\n        self.apply()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        \"\"\"Set the input train dataset.\"\"\"\n        self.Error.data_error.clear()\n        self.data = data\n        self.set_input_summary()\n\n        if data is not None and data.domain.class_var is None:\n            self.Error.data_error(\"Data has no target variable.\\n\"\n                                  \"You can set a target variable with the Select Columns widget.\")\n            self.data = None\n\n        self.update_model()\n\n    def set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def apply(self):\n        \"\"\"Applies learner and sends new model.\"\"\"\n        self.update_learner()\n        self.update_model()\n\n    def update_learner(self):\n        self.learner = self.create_learner()\n        if self.learner and issubclass(self.LEARNER, Fitter):\n            self.learner.use_default_preprocessors = True\n        if self.learner is not None:\n            self.learner.name = self.learner_name or self.name\n        self.Outputs.learner.send(self.learner)\n        self.outdated_settings = False\n        self.Warning.outdated_learner.clear()\n\n    def show_fitting_failed(self, exc):\n        \"\"\"Show error when fitting fails.\n            Derived widgets can override this to show more specific messages.\"\"\"\n        self.Error.fitting_failed(str(exc), shown=exc is not None)\n\n    def update_model(self):\n        self.show_fitting_failed(None)\n        self.model = None\n        if self.check_data():\n            try:\n                self.model = self.learner(self.data)\n            except BaseException as exc:\n                self.show_fitting_failed(exc)\n            else:\n                self.model.name = self.learner_name or self.name\n                self.model.instances = self.data\n        self.Outputs.model.send(self.model)\n\n    def check_data(self):\n        self.valid_data = False\n        self.Error.sparse_not_supported.clear()\n        if self.data is not None and self.learner is not None:\n            self.Error.data_error.clear()\n            if not self.learner.check_learner_adequacy(self.data.domain):\n                self.Error.data_error(self.learner.learner_adequacy_err_msg)\n            elif not len(self.data):\n                self.Error.data_error(\"Dataset is empty.\")\n            elif len(ut.unique(self.data.Y)) < 2:\n                self.Error.data_error(\"Data contains a single target value.\")\n            elif self.data.X.size == 0:\n                self.Error.data_error(\"Data has no features to learn from.\")\n            elif self.data.is_sparse() and not self.supports_sparse:\n                self.Error.sparse_not_supported()\n            else:\n                self.valid_data = True\n        return self.valid_data\n\n    def settings_changed(self, *args, **kwargs):\n        self.outdated_settings = True\n        self.Warning.outdated_learner(shown=not self.auto_apply)\n        self.apply()\n\n    def _change_name(self, instance, output):\n        if instance:\n            instance.name = self.learner_name or self.name\n            if self.auto_apply:\n                output.send(instance)\n\n    def learner_name_changed(self):\n        self._change_name(self.learner, self.Outputs.learner)\n        self._change_name(self.model, self.Outputs.model)\n\n    def send_report(self):\n        self.report_items(((\"Name\", self.learner_name or self.name),))\n\n        model_parameters = self.get_learner_parameters()\n        if model_parameters:\n            self.report_items(\"Model parameters\", model_parameters)\n\n        if self.data:\n            self.report_data(\"Data\", self.data)\n\n    # GUI\n    def setup_layout(self):\n        self.add_learner_name_widget()\n        self.add_main_layout()\n        # Options specific to target variable type, if supported\n        if issubclass(self.LEARNER, Fitter):\n            # Only add a classification section if the method is overridden\n            if type(self).add_classification_layout is not \\\n                    OWBaseLearner.add_classification_layout:\n                classification_box = gui.widgetBox(\n                    self.controlArea, 'Classification')\n                self.add_classification_layout(classification_box)\n            # Only add a regression section if the method is overridden\n            if type(self).add_regression_layout is not \\\n                    OWBaseLearner.add_regression_layout:\n                regression_box = gui.widgetBox(self.controlArea, 'Regression')\n                self.add_regression_layout(regression_box)\n        self.add_bottom_buttons()\n\n    def add_main_layout(self):\n        \"\"\"Creates layout with the learner configuration widgets.\n\n        Override this method for laying out any learner-specific parameter controls.\n        See setup_layout() method for execution order.\n        \"\"\"\n        pass\n\n    def add_classification_layout(self, box):\n        \"\"\"Creates layout for classification specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_regression_layout(self, box):\n        \"\"\"Creates layout for regression specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_learner_name_widget(self):\n        self.name_line_edit = gui.lineEdit(\n            self.controlArea, self, 'learner_name', box='Name',\n            placeholderText=self.name,\n            tooltip='The name will identify this model in other widgets',\n            orientation=Qt.Horizontal, callback=self.learner_name_changed)\n\n    def add_bottom_buttons(self):\n        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)\n\n    def send(self, signalName, value, id=None):\n        # A subclass might still use the old syntax to send outputs\n        # defined on this class\n        for _, output in getmembers(self.Outputs, Output):\n            if output.name == signalName or signalName in output.replaces:\n                output.send(value, id=id)\n                return\n\n        super().send(signalName, value, id)\n\n    @classmethod\n    def get_widget_description(cls):\n        # When a subclass defines defines old-style signals, those override\n        # the new-style ones, so we add them manually\n        desc = super().get_widget_description()\n\n        if cls.outputs:\n            desc[\"outputs\"].extend(cls.get_signals(\"outputs\", True))\n        if cls.inputs:\n            desc[\"inputs\"].extend(cls.get_signals(\"inputs\", True))\n        return desc",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 54,
                                "end_lineno": 302,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/utils/owlearnerwidget.py",
                            "type": "class",
                            "name": "OWBaseLearner",
                            "content": "class OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):\n    \"\"\"Abstract widget for classification/regression learners.\n\n    Notes\n    -----\n    All learner widgets should define learner class LEARNER.\n    LEARNER should have __returns__ attribute.\n\n    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`\n    in case LEARNER has extra parameters.\n\n    \"\"\"\n    LEARNER = None\n    supports_sparse = True\n\n    learner_name = Setting(\"\", schema_only=True)\n    want_main_area = False\n    resizing_enabled = False\n    auto_apply = Setting(True)\n\n    class Error(OWWidget.Error):\n        data_error = Msg(\"{}\")\n        fitting_failed = Msg(\"Fitting failed.\\n{}\")\n        sparse_not_supported = Msg(\"Sparse data is not supported.\")\n        out_of_memory = Msg(\"Out of memory.\")\n\n    class Warning(OWWidget.Warning):\n        outdated_learner = Msg(\"Press Apply to submit changes.\")\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n        preprocessor = Input(\"Preprocessor\", Preprocess)\n\n    class Outputs:\n        learner = Output(\"Learner\", Learner, dynamic=False)\n        model = Output(\"Model\", Model, dynamic=False,\n                       replaces=[\"Classifier\", \"Predictor\"])\n\n    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code\n\n    def __init__(self, preprocessors=None):\n        super().__init__()\n        self.data = None\n        self.valid_data = False\n        self.learner = None\n        self.model = None\n        self.preprocessors = preprocessors\n        self.outdated_settings = False\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.setup_layout()\n        QTimer.singleShot(0, getattr(self, \"unconditional_apply\", self.apply))\n\n    def create_learner(self):\n        \"\"\"Creates a learner with current configuration.\n\n        Returns:\n            Learner: an instance of Orange.base.learner subclass.\n        \"\"\"\n        return self.LEARNER(preprocessors=self.preprocessors)\n\n    def get_learner_parameters(self):\n        \"\"\"Creates an `OrderedDict` or a sequence of pairs with current model\n        configuration.\n\n        Returns:\n            OrderedDict or List: (option, value) pairs or dict\n        \"\"\"\n        return []\n\n    @Inputs.preprocessor\n    def set_preprocessor(self, preprocessor):\n        self.preprocessors = preprocessor\n        self.apply()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        \"\"\"Set the input train dataset.\"\"\"\n        self.Error.data_error.clear()\n        self.data = data\n        self.set_input_summary()\n\n        if data is not None and data.domain.class_var is None:\n            self.Error.data_error(\"Data has no target variable.\\n\"\n                                  \"You can set a target variable with the Select Columns widget.\")\n            self.data = None\n\n        self.update_model()\n\n    def set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def apply(self):\n        \"\"\"Applies learner and sends new model.\"\"\"\n        self.update_learner()\n        self.update_model()\n\n    def update_learner(self):\n        self.learner = self.create_learner()\n        if self.learner and issubclass(self.LEARNER, Fitter):\n            self.learner.use_default_preprocessors = True\n        if self.learner is not None:\n            self.learner.name = self.learner_name or self.name\n        self.Outputs.learner.send(self.learner)\n        self.outdated_settings = False\n        self.Warning.outdated_learner.clear()\n\n    def show_fitting_failed(self, exc):\n        \"\"\"Show error when fitting fails.\n            Derived widgets can override this to show more specific messages.\"\"\"\n        self.Error.fitting_failed(str(exc), shown=exc is not None)\n\n    def update_model(self):\n        self.show_fitting_failed(None)\n        self.model = None\n        if self.check_data():\n            try:\n                self.model = self.learner(self.data)\n            except BaseException as exc:\n                self.show_fitting_failed(exc)\n            else:\n                self.model.name = self.learner_name or self.name\n                self.model.instances = self.data\n        self.Outputs.model.send(self.model)\n\n    def check_data(self):\n        self.valid_data = False\n        self.Error.sparse_not_supported.clear()\n        if self.data is not None and self.learner is not None:\n            self.Error.data_error.clear()\n            if not self.learner.check_learner_adequacy(self.data.domain):\n                self.Error.data_error(self.learner.learner_adequacy_err_msg)\n            elif not len(self.data):\n                self.Error.data_error(\"Dataset is empty.\")\n            elif len(ut.unique(self.data.Y)) < 2:\n                self.Error.data_error(\"Data contains a single target value.\")\n            elif self.data.X.size == 0:\n                self.Error.data_error(\"Data has no features to learn from.\")\n            elif self.data.is_sparse() and not self.supports_sparse:\n                self.Error.sparse_not_supported()\n            else:\n                self.valid_data = True\n        return self.valid_data\n\n    def settings_changed(self, *args, **kwargs):\n        self.outdated_settings = True\n        self.Warning.outdated_learner(shown=not self.auto_apply)\n        self.apply()\n\n    def _change_name(self, instance, output):\n        if instance:\n            instance.name = self.learner_name or self.name\n            if self.auto_apply:\n                output.send(instance)\n\n    def learner_name_changed(self):\n        self._change_name(self.learner, self.Outputs.learner)\n        self._change_name(self.model, self.Outputs.model)\n\n    def send_report(self):\n        self.report_items(((\"Name\", self.learner_name or self.name),))\n\n        model_parameters = self.get_learner_parameters()\n        if model_parameters:\n            self.report_items(\"Model parameters\", model_parameters)\n\n        if self.data:\n            self.report_data(\"Data\", self.data)\n\n    # GUI\n    def setup_layout(self):\n        self.add_learner_name_widget()\n        self.add_main_layout()\n        # Options specific to target variable type, if supported\n        if issubclass(self.LEARNER, Fitter):\n            # Only add a classification section if the method is overridden\n            if type(self).add_classification_layout is not \\\n                    OWBaseLearner.add_classification_layout:\n                classification_box = gui.widgetBox(\n                    self.controlArea, 'Classification')\n                self.add_classification_layout(classification_box)\n            # Only add a regression section if the method is overridden\n            if type(self).add_regression_layout is not \\\n                    OWBaseLearner.add_regression_layout:\n                regression_box = gui.widgetBox(self.controlArea, 'Regression')\n                self.add_regression_layout(regression_box)\n        self.add_bottom_buttons()\n\n    def add_main_layout(self):\n        \"\"\"Creates layout with the learner configuration widgets.\n\n        Override this method for laying out any learner-specific parameter controls.\n        See setup_layout() method for execution order.\n        \"\"\"\n        pass\n\n    def add_classification_layout(self, box):\n        \"\"\"Creates layout for classification specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_regression_layout(self, box):\n        \"\"\"Creates layout for regression specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_learner_name_widget(self):\n        self.name_line_edit = gui.lineEdit(\n            self.controlArea, self, 'learner_name', box='Name',\n            placeholderText=self.name,\n            tooltip='The name will identify this model in other widgets',\n            orientation=Qt.Horizontal, callback=self.learner_name_changed)\n\n    def add_bottom_buttons(self):\n        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)\n\n    def send(self, signalName, value, id=None):\n        # A subclass might still use the old syntax to send outputs\n        # defined on this class\n        for _, output in getmembers(self.Outputs, Output):\n            if output.name == signalName or signalName in output.replaces:\n                output.send(value, id=id)\n                return\n\n        super().send(signalName, value, id)\n\n    @classmethod\n    def get_widget_description(cls):\n        # When a subclass defines defines old-style signals, those override\n        # the new-style ones, so we add them manually\n        desc = super().get_widget_description()\n\n        if cls.outputs:\n            desc[\"outputs\"].extend(cls.get_signals(\"outputs\", True))\n        if cls.inputs:\n            desc[\"inputs\"].extend(cls.get_signals(\"inputs\", True))\n        return desc",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 54,
                            "end_lineno": 302,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import scipy.sparse as sp\n\n# pylint: disable=missing-docstring, protected-access\nfrom Orange.base import Learner, Model\nfrom Orange.classification import KNNLearner\nfrom Orange.data import Table, Domain\nfrom Orange.modelling import TreeLearner\nfrom Orange.preprocess import continuize\nfrom Orange.regression import MeanLearner, LinearRegressionLearner\nfrom Orange.widgets.utils.owlearnerwidget import OWBaseLearner\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.signals import Output\nfrom Orange.widgets.utils.state_summary import format_summary_details\n\n\nclass TestOWBaseLearner(WidgetTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.iris = Table(\"iris\")\n\n    def test_error_on_learning(self):\n        \"\"\"Check that widget shows error message when learner fails\"\"\"\n\n        class FailingLearner(Learner):\n            \"\"\"A learner that fails when given data\"\"\"\n            __returns__ = Model\n\n            def __call__(self, data, *_):\n                if data is not None:\n                    raise ValueError(\"boom\")\n                return Model(Domain([]))\n\n        class OWFailingLearner(OWBaseLearner):\n            \"\"\"Widget for the above learner\"\"\"\n            name = learner_name = \"foo\"\n            LEARNER = FailingLearner\n            auto_apply = True\n\n        self.widget = self.create_widget(OWFailingLearner)\n        self.send_signal(\"Data\", self.iris)\n        self.assertTrue(self.widget.Error.fitting_failed.is_shown())\n        self.send_signal(\"Data\", None)\n        self.assertFalse(self.widget.Error.fitting_failed.is_shown())\n\n    def test_subclasses_do_not_share_outputs(self):\n        class WidgetA(OWBaseLearner, openclass=True):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        class WidgetB(OWBaseLearner):\n            name = \"B\"\n            LEARNER = MeanLearner\n\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertEqual(WidgetB.Outputs.learner.type, MeanLearner)\n\n        class WidgetC(WidgetA):\n            name = \"C\"\n            LEARNER = TreeLearner\n\n            class Outputs(WidgetA.Outputs):\n                test = Output(\"test\", str)\n\n        self.assertEqual(WidgetC.Outputs.learner.type, TreeLearner)\n        self.assertEqual(WidgetC.Outputs.test.name, \"test\")\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertFalse(hasattr(WidgetA.Outputs, \"test\"))\n\n    def test_send_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w = self.create_widget(WidgetA)\n        w.send(w.OUTPUT_MODEL_NAME, \"Foo\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Foo\")\n\n        # Old old signal name\n        w.send(\"Predictor\", \"Bar\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Bar\")\n\n    def test_old_style_signals_on_subclass_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n            inputs = [(\"A\", None, \"set_data\")]\n            outputs = [(\"A\", None)]\n\n        desc = WidgetA.get_widget_description()\n        inputs = [i.name for i in desc[\"inputs\"]]\n        outputs = [o.name for o in desc[\"outputs\"]]\n\n        self.assertIn(WidgetA.Outputs.learner.name, outputs)\n        self.assertIn(WidgetA.Outputs.model.name, outputs)\n        self.assertIn(\"A\", outputs)\n\n        self.assertIn(WidgetA.Inputs.data.name, inputs)\n        self.assertIn(WidgetA.Inputs.preprocessor.name, inputs)\n        self.assertIn(\"A\", inputs)\n\n    def test_persists_learner_name_in_settings(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w1 = self.create_widget(WidgetA)\n        w1.learner_name = \"MyWidget\"\n\n        settings = w1.settingsHandler.pack_data(w1)\n        w2 = self.create_widget(WidgetA, settings)\n        self.assertEqual(w2.learner_name, w1.learner_name)\n\n    def test_converts_sparse_targets_to_dense(self):\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = LinearRegressionLearner\n\n        w = self.create_widget(WidgetLR)\n\n        # Orange will want do do one-hot encoding when continuizing discrete variable\n        pp = continuize.DomainContinuizer(\n            multinomial_treatment=continuize.Continuize.AsOrdinal,\n            transform_class=True,\n        )\n        data = self.iris.transform(pp(self.iris))\n        data.Y = sp.csr_matrix(data.Y)\n\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertFalse(any(w.Error.active))\n\n        model = self.get_output(w.Outputs.model, widget=w)\n        self.assertIsNotNone(model)\n\n    def test_summary(self):\n        \"\"\"Check if the status bar is updated when data is received\"\"\"\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n        widget = self.create_widget(WidgetA)\n        info = widget.info\n        no_input = \"No data on input\"\n\n        self.send_signal(widget.Inputs.data, self.iris)\n        summary, details = \"150\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.send_signal(widget.Inputs.data, None)\n        self.assertEqual(info._StateInfo__input_summary.brief, \"-\")\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n",
            "new_file_content": "from unittest.mock import Mock\n\nimport scipy.sparse as sp\n\n# pylint: disable=missing-docstring, protected-access\nfrom Orange.base import Learner, Model\nfrom Orange.classification import KNNLearner\nfrom Orange.data import Table, Domain\nfrom Orange.modelling import TreeLearner, Fitter\nfrom Orange.preprocess import continuize\nfrom Orange.regression import MeanLearner, LinearRegressionLearner\nfrom Orange.widgets.utils.owlearnerwidget import OWBaseLearner\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.signals import Output\nfrom Orange.widgets.utils.state_summary import format_summary_details\n\n\nclass TestOWBaseLearner(WidgetTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.iris = Table(\"iris\")\n\n    def test_error_on_learning(self):\n        \"\"\"Check that widget shows error message when learner fails\"\"\"\n\n        class FailingLearner(Learner):\n            \"\"\"A learner that fails when given data\"\"\"\n            __returns__ = Model\n\n            def __call__(self, data, *_):\n                if data is not None:\n                    raise ValueError(\"boom\")\n                return Model(Domain([]))\n\n        class OWFailingLearner(OWBaseLearner):\n            \"\"\"Widget for the above learner\"\"\"\n            name = learner_name = \"foo\"\n            LEARNER = FailingLearner\n            auto_apply = True\n\n        self.widget = self.create_widget(OWFailingLearner)\n        self.send_signal(\"Data\", self.iris)\n        self.assertTrue(self.widget.Error.fitting_failed.is_shown())\n        self.send_signal(\"Data\", None)\n        self.assertFalse(self.widget.Error.fitting_failed.is_shown())\n\n    def test_subclasses_do_not_share_outputs(self):\n        class WidgetA(OWBaseLearner, openclass=True):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        class WidgetB(OWBaseLearner):\n            name = \"B\"\n            LEARNER = MeanLearner\n\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertEqual(WidgetB.Outputs.learner.type, MeanLearner)\n\n        class WidgetC(WidgetA):\n            name = \"C\"\n            LEARNER = TreeLearner\n\n            class Outputs(WidgetA.Outputs):\n                test = Output(\"test\", str)\n\n        self.assertEqual(WidgetC.Outputs.learner.type, TreeLearner)\n        self.assertEqual(WidgetC.Outputs.test.name, \"test\")\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertFalse(hasattr(WidgetA.Outputs, \"test\"))\n\n    def test_send_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w = self.create_widget(WidgetA)\n        w.send(w.OUTPUT_MODEL_NAME, \"Foo\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Foo\")\n\n        # Old old signal name\n        w.send(\"Predictor\", \"Bar\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Bar\")\n\n    def test_old_style_signals_on_subclass_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n            inputs = [(\"A\", None, \"set_data\")]\n            outputs = [(\"A\", None)]\n\n        desc = WidgetA.get_widget_description()\n        inputs = [i.name for i in desc[\"inputs\"]]\n        outputs = [o.name for o in desc[\"outputs\"]]\n\n        self.assertIn(WidgetA.Outputs.learner.name, outputs)\n        self.assertIn(WidgetA.Outputs.model.name, outputs)\n        self.assertIn(\"A\", outputs)\n\n        self.assertIn(WidgetA.Inputs.data.name, inputs)\n        self.assertIn(WidgetA.Inputs.preprocessor.name, inputs)\n        self.assertIn(\"A\", inputs)\n\n    def test_persists_learner_name_in_settings(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w1 = self.create_widget(WidgetA)\n        w1.learner_name = \"MyWidget\"\n\n        settings = w1.settingsHandler.pack_data(w1)\n        w2 = self.create_widget(WidgetA, settings)\n        self.assertEqual(w2.learner_name, w1.learner_name)\n\n    def test_converts_sparse_targets_to_dense(self):\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = LinearRegressionLearner\n\n        w = self.create_widget(WidgetLR)\n\n        # Orange will want do do one-hot encoding when continuizing discrete variable\n        pp = continuize.DomainContinuizer(\n            multinomial_treatment=continuize.Continuize.AsOrdinal,\n            transform_class=True,\n        )\n        data = self.iris.transform(pp(self.iris))\n        data.Y = sp.csr_matrix(data.Y)\n\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertFalse(any(w.Error.active))\n\n        model = self.get_output(w.Outputs.model, widget=w)\n        self.assertIsNotNone(model)\n\n    def test_summary(self):\n        \"\"\"Check if the status bar is updated when data is received\"\"\"\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n        widget = self.create_widget(WidgetA)\n        info = widget.info\n        no_input = \"No data on input\"\n\n        self.send_signal(widget.Inputs.data, self.iris)\n        summary, details = \"150\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.send_signal(widget.Inputs.data, None)\n        self.assertEqual(info._StateInfo__input_summary.brief, \"-\")\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n\n    def test_invalid_number_of_targets(self):\n        class MockLearner(Fitter):\n            name = 'mock'\n            __fits__ = {'classification': Mock()}\n            __returns__ = Mock()\n\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = MockLearner\n\n        w = self.create_widget(WidgetLR)\n        error = w.Error.data_error\n        heart = Table(\"heart_disease\")\n        domain = heart.domain\n\n        no_target = heart.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = heart.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(w.Inputs.data, heart)\n        self.assertFalse(error.is_shown())\n        self.assertIs(w.data, heart)\n\n        self.send_signal(w.Inputs.data, no_target)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_no_target = str(error)\n        self.assertIn(\"target\", err_no_target)\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_two_targets = str(error)\n        self.assertIn(\"target\", err_no_target)\n        self.assertNotEqual(err_no_target, err_two_targets)\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertIsNone(w.data)\n        self.assertFalse(error.is_shown())\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertFalse(error.is_shown())\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/utils/tests/test_owlearnerwidget.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "3cceadc80",
                "new_commit_hash": "da11571be",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/utils/tests/test_owlearnerwidget.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/utils/tests/test_owlearnerwidget.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 1,
                            "length": 10
                        },
                        "new_range": {
                            "start": 1,
                            "length": 12
                        },
                        "section": ""
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from unittest.mock import Mock",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "import scipy.sparse as sp",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "# pylint: disable=missing-docstring, protected-access",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.base import Learner, Model",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.classification import KNNLearner",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Table, Domain",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.modelling import TreeLearner",
                                "type": "deleted"
                            },
                            {
                                "content": "from Orange.modelling import TreeLearner, Fitter",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.preprocess import continuize",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.regression import MeanLearner, LinearRegressionLearner",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.utils.owlearnerwidget import OWBaseLearner",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_owlearnerwidget.py",
                            "type": "statement",
                            "name": "",
                            "content": "from unittest.mock import Mock",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 1,
                            "end_lineno": 1,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/utils/tests/test_owlearnerwidget.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.modelling import TreeLearner, Fitter",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 9,
                            "end_lineno": 9,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_owlearnerwidget.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.modelling import TreeLearner",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 7,
                            "end_lineno": 7,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 149,
                            "length": 3
                        },
                        "new_range": {
                            "start": 151,
                            "length": 52
                        },
                        "section": "class TestOWBaseLearner(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.send_signal(widget.Inputs.data, None)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(info._StateInfo__input_summary.brief, \"-\")",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(info._StateInfo__input_summary.details, no_input)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_invalid_number_of_targets(self):",
                                "type": "added"
                            },
                            {
                                "content": "        class MockLearner(Fitter):",
                                "type": "added"
                            },
                            {
                                "content": "            name = 'mock'",
                                "type": "added"
                            },
                            {
                                "content": "            __fits__ = {'classification': Mock()}",
                                "type": "added"
                            },
                            {
                                "content": "            __returns__ = Mock()",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        class WidgetLR(OWBaseLearner):",
                                "type": "added"
                            },
                            {
                                "content": "            name = \"lr\"",
                                "type": "added"
                            },
                            {
                                "content": "            LEARNER = MockLearner",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        w = self.create_widget(WidgetLR)",
                                "type": "added"
                            },
                            {
                                "content": "        error = w.Error.data_error",
                                "type": "added"
                            },
                            {
                                "content": "        heart = Table(\"heart_disease\")",
                                "type": "added"
                            },
                            {
                                "content": "        domain = heart.domain",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        no_target = heart.transform(",
                                "type": "added"
                            },
                            {
                                "content": "            Domain(domain.attributes,",
                                "type": "added"
                            },
                            {
                                "content": "                   []))",
                                "type": "added"
                            },
                            {
                                "content": "        two_targets = heart.transform(",
                                "type": "added"
                            },
                            {
                                "content": "            Domain([domain[\"age\"]],",
                                "type": "added"
                            },
                            {
                                "content": "                   [domain[\"gender\"], domain[\"chest pain\"]]))",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, heart)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(error.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIs(w.data, heart)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, no_target)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(error.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIsNone(w.data)",
                                "type": "added"
                            },
                            {
                                "content": "        err_no_target = str(error)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIn(\"target\", err_no_target)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, two_targets)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(error.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIsNone(w.data)",
                                "type": "added"
                            },
                            {
                                "content": "        err_two_targets = str(error)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIn(\"target\", err_no_target)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertNotEqual(err_no_target, err_two_targets)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, None)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIsNone(w.data)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(error.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, two_targets)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(error.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(w.Inputs.data, None)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(error.is_shown())",
                                "type": "added"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_owlearnerwidget.py",
                            "type": "class",
                            "name": "TestOWBaseLearner",
                            "content": "class TestOWBaseLearner(WidgetTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.iris = Table(\"iris\")\n\n    def test_error_on_learning(self):\n        \"\"\"Check that widget shows error message when learner fails\"\"\"\n\n        class FailingLearner(Learner):\n            \"\"\"A learner that fails when given data\"\"\"\n            __returns__ = Model\n\n            def __call__(self, data, *_):\n                if data is not None:\n                    raise ValueError(\"boom\")\n                return Model(Domain([]))\n\n        class OWFailingLearner(OWBaseLearner):\n            \"\"\"Widget for the above learner\"\"\"\n            name = learner_name = \"foo\"\n            LEARNER = FailingLearner\n            auto_apply = True\n\n        self.widget = self.create_widget(OWFailingLearner)\n        self.send_signal(\"Data\", self.iris)\n        self.assertTrue(self.widget.Error.fitting_failed.is_shown())\n        self.send_signal(\"Data\", None)\n        self.assertFalse(self.widget.Error.fitting_failed.is_shown())\n\n    def test_subclasses_do_not_share_outputs(self):\n        class WidgetA(OWBaseLearner, openclass=True):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        class WidgetB(OWBaseLearner):\n            name = \"B\"\n            LEARNER = MeanLearner\n\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertEqual(WidgetB.Outputs.learner.type, MeanLearner)\n\n        class WidgetC(WidgetA):\n            name = \"C\"\n            LEARNER = TreeLearner\n\n            class Outputs(WidgetA.Outputs):\n                test = Output(\"test\", str)\n\n        self.assertEqual(WidgetC.Outputs.learner.type, TreeLearner)\n        self.assertEqual(WidgetC.Outputs.test.name, \"test\")\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertFalse(hasattr(WidgetA.Outputs, \"test\"))\n\n    def test_send_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w = self.create_widget(WidgetA)\n        w.send(w.OUTPUT_MODEL_NAME, \"Foo\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Foo\")\n\n        # Old old signal name\n        w.send(\"Predictor\", \"Bar\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Bar\")\n\n    def test_old_style_signals_on_subclass_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n            inputs = [(\"A\", None, \"set_data\")]\n            outputs = [(\"A\", None)]\n\n        desc = WidgetA.get_widget_description()\n        inputs = [i.name for i in desc[\"inputs\"]]\n        outputs = [o.name for o in desc[\"outputs\"]]\n\n        self.assertIn(WidgetA.Outputs.learner.name, outputs)\n        self.assertIn(WidgetA.Outputs.model.name, outputs)\n        self.assertIn(\"A\", outputs)\n\n        self.assertIn(WidgetA.Inputs.data.name, inputs)\n        self.assertIn(WidgetA.Inputs.preprocessor.name, inputs)\n        self.assertIn(\"A\", inputs)\n\n    def test_persists_learner_name_in_settings(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w1 = self.create_widget(WidgetA)\n        w1.learner_name = \"MyWidget\"\n\n        settings = w1.settingsHandler.pack_data(w1)\n        w2 = self.create_widget(WidgetA, settings)\n        self.assertEqual(w2.learner_name, w1.learner_name)\n\n    def test_converts_sparse_targets_to_dense(self):\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = LinearRegressionLearner\n\n        w = self.create_widget(WidgetLR)\n\n        # Orange will want do do one-hot encoding when continuizing discrete variable\n        pp = continuize.DomainContinuizer(\n            multinomial_treatment=continuize.Continuize.AsOrdinal,\n            transform_class=True,\n        )\n        data = self.iris.transform(pp(self.iris))\n        data.Y = sp.csr_matrix(data.Y)\n\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertFalse(any(w.Error.active))\n\n        model = self.get_output(w.Outputs.model, widget=w)\n        self.assertIsNotNone(model)\n\n    def test_summary(self):\n        \"\"\"Check if the status bar is updated when data is received\"\"\"\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n        widget = self.create_widget(WidgetA)\n        info = widget.info\n        no_input = \"No data on input\"\n\n        self.send_signal(widget.Inputs.data, self.iris)\n        summary, details = \"150\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.send_signal(widget.Inputs.data, None)\n        self.assertEqual(info._StateInfo__input_summary.brief, \"-\")\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n\n    def test_invalid_number_of_targets(self):\n        class MockLearner(Fitter):\n            name = 'mock'\n            __fits__ = {'classification': Mock()}\n            __returns__ = Mock()\n\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = MockLearner\n\n        w = self.create_widget(WidgetLR)\n        error = w.Error.data_error\n        heart = Table(\"heart_disease\")\n        domain = heart.domain\n\n        no_target = heart.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = heart.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(w.Inputs.data, heart)\n        self.assertFalse(error.is_shown())\n        self.assertIs(w.data, heart)\n\n        self.send_signal(w.Inputs.data, no_target)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_no_target = str(error)\n        self.assertIn(\"target\", err_no_target)\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_two_targets = str(error)\n        self.assertIn(\"target\", err_no_target)\n        self.assertNotEqual(err_no_target, err_two_targets)\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertIsNone(w.data)\n        self.assertFalse(error.is_shown())\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertFalse(error.is_shown())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 18,
                            "end_lineno": 202,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/utils/tests/test_owlearnerwidget.py",
                            "type": "method",
                            "name": "TestOWBaseLearner.test_invalid_number_of_targets",
                            "content": "class TestOWBaseLearner(WidgetTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.iris = Table(\"iris\")\n\n    def test_error_on_learning(self):\n        \"\"\"Check that widget shows error message when learner fails\"\"\"\n\n        class FailingLearner(Learner):\n            \"\"\"A learner that fails when given data\"\"\"\n            __returns__ = Model\n\n            def __call__(self, data, *_):\n                if data is not None:\n                    raise ValueError(\"boom\")\n                return Model(Domain([]))\n\n        class OWFailingLearner(OWBaseLearner):\n            \"\"\"Widget for the above learner\"\"\"\n            name = learner_name = \"foo\"\n            LEARNER = FailingLearner\n            auto_apply = True\n\n        self.widget = self.create_widget(OWFailingLearner)\n        self.send_signal(\"Data\", self.iris)\n        self.assertTrue(self.widget.Error.fitting_failed.is_shown())\n        self.send_signal(\"Data\", None)\n        self.assertFalse(self.widget.Error.fitting_failed.is_shown())\n\n    def test_subclasses_do_not_share_outputs(self):\n        class WidgetA(OWBaseLearner, openclass=True):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        class WidgetB(OWBaseLearner):\n            name = \"B\"\n            LEARNER = MeanLearner\n\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertEqual(WidgetB.Outputs.learner.type, MeanLearner)\n\n        class WidgetC(WidgetA):\n            name = \"C\"\n            LEARNER = TreeLearner\n\n            class Outputs(WidgetA.Outputs):\n                test = Output(\"test\", str)\n\n        self.assertEqual(WidgetC.Outputs.learner.type, TreeLearner)\n        self.assertEqual(WidgetC.Outputs.test.name, \"test\")\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertFalse(hasattr(WidgetA.Outputs, \"test\"))\n\n    def test_send_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w = self.create_widget(WidgetA)\n        w.send(w.OUTPUT_MODEL_NAME, \"Foo\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Foo\")\n\n        # Old old signal name\n        w.send(\"Predictor\", \"Bar\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Bar\")\n\n    def test_old_style_signals_on_subclass_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n            inputs = [(\"A\", None, \"set_data\")]\n            outputs = [(\"A\", None)]\n\n        desc = WidgetA.get_widget_description()\n        inputs = [i.name for i in desc[\"inputs\"]]\n        outputs = [o.name for o in desc[\"outputs\"]]\n\n        self.assertIn(WidgetA.Outputs.learner.name, outputs)\n        self.assertIn(WidgetA.Outputs.model.name, outputs)\n        self.assertIn(\"A\", outputs)\n\n        self.assertIn(WidgetA.Inputs.data.name, inputs)\n        self.assertIn(WidgetA.Inputs.preprocessor.name, inputs)\n        self.assertIn(\"A\", inputs)\n\n    def test_persists_learner_name_in_settings(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w1 = self.create_widget(WidgetA)\n        w1.learner_name = \"MyWidget\"\n\n        settings = w1.settingsHandler.pack_data(w1)\n        w2 = self.create_widget(WidgetA, settings)\n        self.assertEqual(w2.learner_name, w1.learner_name)\n\n    def test_converts_sparse_targets_to_dense(self):\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = LinearRegressionLearner\n\n        w = self.create_widget(WidgetLR)\n\n        # Orange will want do do one-hot encoding when continuizing discrete variable\n        pp = continuize.DomainContinuizer(\n            multinomial_treatment=continuize.Continuize.AsOrdinal,\n            transform_class=True,\n        )\n        data = self.iris.transform(pp(self.iris))\n        data.Y = sp.csr_matrix(data.Y)\n\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertFalse(any(w.Error.active))\n\n        model = self.get_output(w.Outputs.model, widget=w)\n        self.assertIsNotNone(model)\n\n    def test_summary(self):\n        \"\"\"Check if the status bar is updated when data is received\"\"\"\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n        widget = self.create_widget(WidgetA)\n        info = widget.info\n        no_input = \"No data on input\"\n\n        self.send_signal(widget.Inputs.data, self.iris)\n        summary, details = \"150\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.send_signal(widget.Inputs.data, None)\n        self.assertEqual(info._StateInfo__input_summary.brief, \"-\")\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n\n    def test_invalid_number_of_targets(self):\n        class MockLearner(Fitter):\n            name = 'mock'\n            __fits__ = {'classification': Mock()}\n            __returns__ = Mock()\n\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = MockLearner\n\n        w = self.create_widget(WidgetLR)\n        error = w.Error.data_error\n        heart = Table(\"heart_disease\")\n        domain = heart.domain\n\n        no_target = heart.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = heart.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(w.Inputs.data, heart)\n        self.assertFalse(error.is_shown())\n        self.assertIs(w.data, heart)\n\n        self.send_signal(w.Inputs.data, no_target)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_no_target = str(error)\n        self.assertIn(\"target\", err_no_target)\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_two_targets = str(error)\n        self.assertIn(\"target\", err_no_target)\n        self.assertNotEqual(err_no_target, err_two_targets)\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertIsNone(w.data)\n        self.assertFalse(error.is_shown())\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertFalse(error.is_shown())",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 155,
                            "end_lineno": 202,
                            "parent": {
                                "file_name": "Orange/widgets/utils/tests/test_owlearnerwidget.py",
                                "type": "class",
                                "name": "TestOWBaseLearner",
                                "content": "class TestOWBaseLearner(WidgetTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.iris = Table(\"iris\")\n\n    def test_error_on_learning(self):\n        \"\"\"Check that widget shows error message when learner fails\"\"\"\n\n        class FailingLearner(Learner):\n            \"\"\"A learner that fails when given data\"\"\"\n            __returns__ = Model\n\n            def __call__(self, data, *_):\n                if data is not None:\n                    raise ValueError(\"boom\")\n                return Model(Domain([]))\n\n        class OWFailingLearner(OWBaseLearner):\n            \"\"\"Widget for the above learner\"\"\"\n            name = learner_name = \"foo\"\n            LEARNER = FailingLearner\n            auto_apply = True\n\n        self.widget = self.create_widget(OWFailingLearner)\n        self.send_signal(\"Data\", self.iris)\n        self.assertTrue(self.widget.Error.fitting_failed.is_shown())\n        self.send_signal(\"Data\", None)\n        self.assertFalse(self.widget.Error.fitting_failed.is_shown())\n\n    def test_subclasses_do_not_share_outputs(self):\n        class WidgetA(OWBaseLearner, openclass=True):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        class WidgetB(OWBaseLearner):\n            name = \"B\"\n            LEARNER = MeanLearner\n\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertEqual(WidgetB.Outputs.learner.type, MeanLearner)\n\n        class WidgetC(WidgetA):\n            name = \"C\"\n            LEARNER = TreeLearner\n\n            class Outputs(WidgetA.Outputs):\n                test = Output(\"test\", str)\n\n        self.assertEqual(WidgetC.Outputs.learner.type, TreeLearner)\n        self.assertEqual(WidgetC.Outputs.test.name, \"test\")\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertFalse(hasattr(WidgetA.Outputs, \"test\"))\n\n    def test_send_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w = self.create_widget(WidgetA)\n        w.send(w.OUTPUT_MODEL_NAME, \"Foo\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Foo\")\n\n        # Old old signal name\n        w.send(\"Predictor\", \"Bar\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Bar\")\n\n    def test_old_style_signals_on_subclass_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n            inputs = [(\"A\", None, \"set_data\")]\n            outputs = [(\"A\", None)]\n\n        desc = WidgetA.get_widget_description()\n        inputs = [i.name for i in desc[\"inputs\"]]\n        outputs = [o.name for o in desc[\"outputs\"]]\n\n        self.assertIn(WidgetA.Outputs.learner.name, outputs)\n        self.assertIn(WidgetA.Outputs.model.name, outputs)\n        self.assertIn(\"A\", outputs)\n\n        self.assertIn(WidgetA.Inputs.data.name, inputs)\n        self.assertIn(WidgetA.Inputs.preprocessor.name, inputs)\n        self.assertIn(\"A\", inputs)\n\n    def test_persists_learner_name_in_settings(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w1 = self.create_widget(WidgetA)\n        w1.learner_name = \"MyWidget\"\n\n        settings = w1.settingsHandler.pack_data(w1)\n        w2 = self.create_widget(WidgetA, settings)\n        self.assertEqual(w2.learner_name, w1.learner_name)\n\n    def test_converts_sparse_targets_to_dense(self):\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = LinearRegressionLearner\n\n        w = self.create_widget(WidgetLR)\n\n        # Orange will want do do one-hot encoding when continuizing discrete variable\n        pp = continuize.DomainContinuizer(\n            multinomial_treatment=continuize.Continuize.AsOrdinal,\n            transform_class=True,\n        )\n        data = self.iris.transform(pp(self.iris))\n        data.Y = sp.csr_matrix(data.Y)\n\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertFalse(any(w.Error.active))\n\n        model = self.get_output(w.Outputs.model, widget=w)\n        self.assertIsNotNone(model)\n\n    def test_summary(self):\n        \"\"\"Check if the status bar is updated when data is received\"\"\"\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n        widget = self.create_widget(WidgetA)\n        info = widget.info\n        no_input = \"No data on input\"\n\n        self.send_signal(widget.Inputs.data, self.iris)\n        summary, details = \"150\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.send_signal(widget.Inputs.data, None)\n        self.assertEqual(info._StateInfo__input_summary.brief, \"-\")\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n\n    def test_invalid_number_of_targets(self):\n        class MockLearner(Fitter):\n            name = 'mock'\n            __fits__ = {'classification': Mock()}\n            __returns__ = Mock()\n\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = MockLearner\n\n        w = self.create_widget(WidgetLR)\n        error = w.Error.data_error\n        heart = Table(\"heart_disease\")\n        domain = heart.domain\n\n        no_target = heart.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = heart.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(w.Inputs.data, heart)\n        self.assertFalse(error.is_shown())\n        self.assertIs(w.data, heart)\n\n        self.send_signal(w.Inputs.data, no_target)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_no_target = str(error)\n        self.assertIn(\"target\", err_no_target)\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_two_targets = str(error)\n        self.assertIn(\"target\", err_no_target)\n        self.assertNotEqual(err_no_target, err_two_targets)\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertIsNone(w.data)\n        self.assertFalse(error.is_shown())\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertFalse(error.is_shown())",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 18,
                                "end_lineno": 202,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# pylint: disable=too-many-ancestors\nfrom enum import IntEnum\nfrom types import SimpleNamespace as namespace\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt, QRectF, QLineF, QPoint\nfrom AnyQt.QtGui import QColor\n\nimport pyqtgraph as pg\n\nfrom Orange.data import Table\nfrom Orange.projection import FreeViz\nfrom Orange.projection.freeviz import FreeVizModel\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.utils.concurrent import ConcurrentWidgetMixin, TaskState\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.utils.component import OWGraphWithAnchors\nfrom Orange.widgets.visualize.utils.plotutils import AnchorItem\nfrom Orange.widgets.visualize.utils.widget import OWAnchorProjectionWidget\n\n\nclass Result(namespace):\n    projector = None  # type: FreeViz\n    projection = None  # type: FreeVizModel\n\n\nMAX_ITERATIONS = 1000\n\n\ndef run_freeviz(data: Table, projector: FreeViz, state: TaskState):\n    res = Result(projector=projector, projection=None)\n    step, steps = 0, MAX_ITERATIONS\n    initial = res.projector.components_.T\n    state.set_status(\"Calculating...\")\n    while True:\n        # Needs a copy because projection should not be modified inplace.\n        # If it is modified inplace, the widget and the thread hold a\n        # reference to the same object. When the thread is interrupted it\n        # is still modifying the object, but the widget receives it\n        # (the modified object) with a delay.\n        res.projection = res.projector(data).copy()\n        anchors = res.projector.components_.T\n        res.projector.initial = anchors\n\n        state.set_partial_result(res)\n        if np.allclose(initial, anchors, rtol=1e-5, atol=1e-4):\n            return res\n        initial = anchors\n\n        step += 1\n        state.set_progress_value(100 * step / steps)\n        if state.is_interruption_requested():\n            return res\n\n\nclass OWFreeVizGraph(OWGraphWithAnchors):\n    hide_radius = settings.Setting(0)\n\n    @property\n    def scaled_radius(self):\n        return self.hide_radius / 100 + 1e-5\n\n    def update_radius(self):\n        self.update_circle()\n        self.update_anchors()\n\n    def set_view_box_range(self):\n        self.view_box.setRange(QRectF(-1.05, -1.05, 2.1, 2.1))\n\n    def closest_draggable_item(self, pos):\n        points, *_ = self.master.get_anchors()\n        if points is None or not len(points):\n            return None\n        mask = np.linalg.norm(points, axis=1) > self.scaled_radius\n        xi, yi = points[mask].T\n        distances = (xi - pos.x()) ** 2 + (yi - pos.y()) ** 2\n        if len(distances) and np.min(distances) < self.DISTANCE_DIFF ** 2:\n            return np.flatnonzero(mask)[np.argmin(distances)]\n        return None\n\n    def update_anchors(self):\n        points, labels = self.master.get_anchors()\n        if points is None:\n            return\n        r = self.scaled_radius\n        if self.anchor_items is None:\n            self.anchor_items = []\n            for point, label in zip(points, labels):\n                anchor = AnchorItem(line=QLineF(0, 0, *point), text=label)\n                anchor.setVisible(np.linalg.norm(point) > r)\n                anchor.setPen(pg.mkPen((100, 100, 100)))\n                anchor.setFont(self.parameter_setter.anchor_font)\n                self.plot_widget.addItem(anchor)\n                self.anchor_items.append(anchor)\n        else:\n            for anchor, point, label in zip(self.anchor_items, points, labels):\n                anchor.setLine(QLineF(0, 0, *point))\n                anchor.setText(label)\n                anchor.setVisible(np.linalg.norm(point) > r)\n                anchor.setFont(self.parameter_setter.anchor_font)\n\n    def update_circle(self):\n        super().update_circle()\n        if self.circle_item is not None:\n            r = self.scaled_radius\n            self.circle_item.setRect(QRectF(-r, -r, 2 * r, 2 * r))\n            pen = pg.mkPen(QColor(Qt.lightGray), width=1, cosmetic=True)\n            self.circle_item.setPen(pen)\n\n    def _add_indicator_item(self, anchor_idx):\n        x, y = self.anchor_items[anchor_idx].get_xy()\n        dx = (self.view_box.childGroup.mapToDevice(QPoint(1, 0)) -\n              self.view_box.childGroup.mapToDevice(QPoint(-1, 0))).x()\n        self.indicator_item = MoveIndicator(x, y, 600 / dx)\n        self.plot_widget.addItem(self.indicator_item)\n\n\nclass InitType(IntEnum):\n    Circular, Random = 0, 1\n\n    @staticmethod\n    def items():\n        return [\"Circular\", \"Random\"]\n\n\nclass OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):\n    MAX_INSTANCES = 10000\n\n    name = \"FreeViz\"\n    description = \"Displays FreeViz projection\"\n    icon = \"icons/Freeviz.svg\"\n    priority = 240\n    keywords = [\"viz\"]\n\n    settings_version = 3\n    initialization = settings.Setting(InitType.Circular)\n    GRAPH_CLASS = OWFreeVizGraph\n    graph = settings.SettingProvider(OWFreeVizGraph)\n\n    class Error(OWAnchorProjectionWidget.Error):\n        no_class_var = widget.Msg(\"Data has no target variable\")\n        not_enough_class_vars = widget.Msg(\n            \"Target variable is not at least binary\")\n        features_exceeds_instances = widget.Msg(\n            \"Number of features exceeds the number of instances.\")\n        too_many_data_instances = widget.Msg(\"Data is too large.\")\n        constant_data = widget.Msg(\"All data columns are constant.\")\n        not_enough_features = widget.Msg(\"At least two features are required\")\n\n    class Warning(OWAnchorProjectionWidget.Warning):\n        removed_features = widget.Msg(\"Categorical features with more than\"\n                                      \" two values are not shown.\")\n\n    def __init__(self):\n        OWAnchorProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n\n    def _add_controls(self):\n        self.__add_controls_start_box()\n        super()._add_controls()\n        self.gui.add_control(\n            self._effects_box, gui.hSlider, \"Hide radius:\", master=self.graph,\n            value=\"hide_radius\", minValue=0, maxValue=100, step=10,\n            createLabel=False, callback=self.__radius_slider_changed\n        )\n\n    def __add_controls_start_box(self):\n        box = gui.vBox(self.controlArea, box=True)\n        gui.comboBox(\n            box, self, \"initialization\", label=\"Initialization:\",\n            items=InitType.items(), orientation=Qt.Horizontal,\n            labelWidth=90, callback=self.__init_combo_changed)\n        self.run_button = gui.button(box, self, \"Start\", self._toggle_run)\n\n    @property\n    def effective_variables(self):\n        return [a for a in self.data.domain.attributes\n                if a.is_continuous or a.is_discrete and len(a.values) == 2]\n\n    def __radius_slider_changed(self):\n        self.graph.update_radius()\n\n    def __init_combo_changed(self):\n        self.Error.proj_error.clear()\n        self.init_projection()\n        self.setup_plot()\n        self.commit()\n        if self.task is not None:\n            self._run()\n\n    def _toggle_run(self):\n        if self.task is not None:\n            self.cancel()\n            self.graph.set_sample_size(None)\n            self.run_button.setText(\"Resume\")\n            self.commit()\n        else:\n            self._run()\n\n    def _run(self):\n        if self.data is None:\n            return\n        self.graph.set_sample_size(self.SAMPLE_SIZE)\n        self.run_button.setText(\"Stop\")\n        self.start(run_freeviz, self.effective_data, self.projector)\n\n    # ConcurrentWidgetMixin\n    def on_partial_result(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.update_coordinates()\n        self.graph.update_density()\n\n    def on_done(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n        self.commit()\n\n    def on_exception(self, ex: Exception):\n        self.Error.proj_error(ex)\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n\n    # OWAnchorProjectionWidget\n    def set_data(self, data):\n        super().set_data(data)\n        self.graph.set_sample_size(None)\n        if self._invalidated:\n            self.init_projection()\n\n    def init_projection(self):\n        if self.data is None:\n            return\n        anchors = FreeViz.init_radial(len(self.effective_variables)) \\\n            if self.initialization == InitType.Circular \\\n            else FreeViz.init_random(len(self.effective_variables), 2)\n        self.projector = FreeViz(scale=False, center=False,\n                                 initial=anchors, maxiter=10)\n        data = self.projector.preprocess(self.effective_data)\n        self.projector.domain = data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)\n        self.projection.pre_domain = data.domain\n        self.projection.name = self.projector.name\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        super().check_data()\n        if self.data is not None:\n            class_var, domain = self.data.domain.class_var, self.data.domain\n            if class_var is None:\n                error(self.Error.no_class_var)\n            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:\n                error(self.Error.not_enough_class_vars)\n            elif len(self.data.domain.attributes) < 2:\n                error(self.Error.not_enough_features)\n            elif len(self.data.domain.attributes) > self.data.X.shape[0]:\n                error(self.Error.features_exceeds_instances)\n            elif not np.sum(np.std(self.data.X, axis=0)):\n                error(self.Error.constant_data)\n            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:\n                error(self.Error.too_many_data_instances)\n            else:\n                if len(self.effective_variables) < len(domain.attributes):\n                    self.Warning.removed_features()\n\n    def enable_controls(self):\n        super().enable_controls()\n        self.run_button.setEnabled(self.data is not None)\n        self.run_button.setText(\"Start\")\n\n    def get_coordinates_data(self):\n        embedding = self.get_embedding()\n        if embedding is None:\n            return None, None\n        valid_emb = embedding[self.valid_data]\n        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)\n\n    def _manual_move(self, anchor_idx, x, y):\n        self.projector.initial[anchor_idx] = [x, y]\n        super()._manual_move(anchor_idx, x, y)\n\n    def clear(self):\n        super().clear()\n        self.cancel()\n\n    def onDeleteWidget(self):\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, _settings, version):\n        if version < 3:\n            if \"radius\" in _settings:\n                _settings[\"graph\"][\"hide_radius\"] = _settings[\"radius\"]\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]\n\n\nclass MoveIndicator(pg.GraphicsObject):\n    def __init__(self, x, y, scene_size, parent=None):\n        super().__init__(parent)\n        self.arrows = [\n            pg.ArrowItem(pos=(x - scene_size * 0.07 * np.cos(np.radians(ang)),\n                              y + scene_size * 0.07 * np.sin(np.radians(ang))),\n                         parent=self, angle=ang,\n                         headLen=13, tipAngle=45,\n                         brush=pg.mkColor(128, 128, 128))\n            for ang in (0, 90, 180, 270)]\n\n    def paint(self, painter, option, widget):\n        pass\n\n    def boundingRect(self):\n        return QRectF()\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    table = Table(\"zoo\")\n    WidgetPreview(OWFreeViz).run(set_data=table, set_subset_data=table[::10])\n",
            "new_file_content": "# pylint: disable=too-many-ancestors\nfrom enum import IntEnum\nfrom types import SimpleNamespace as namespace\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt, QRectF, QLineF, QPoint\nfrom AnyQt.QtGui import QColor\n\nimport pyqtgraph as pg\n\nfrom Orange.data import Table\nfrom Orange.projection import FreeViz\nfrom Orange.projection.freeviz import FreeVizModel\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.utils.concurrent import ConcurrentWidgetMixin, TaskState\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.utils.component import OWGraphWithAnchors\nfrom Orange.widgets.visualize.utils.plotutils import AnchorItem\nfrom Orange.widgets.visualize.utils.widget import OWAnchorProjectionWidget\n\n\nclass Result(namespace):\n    projector = None  # type: FreeViz\n    projection = None  # type: FreeVizModel\n\n\nMAX_ITERATIONS = 1000\n\n\ndef run_freeviz(data: Table, projector: FreeViz, state: TaskState):\n    res = Result(projector=projector, projection=None)\n    step, steps = 0, MAX_ITERATIONS\n    initial = res.projector.components_.T\n    state.set_status(\"Calculating...\")\n    while True:\n        # Needs a copy because projection should not be modified inplace.\n        # If it is modified inplace, the widget and the thread hold a\n        # reference to the same object. When the thread is interrupted it\n        # is still modifying the object, but the widget receives it\n        # (the modified object) with a delay.\n        res.projection = res.projector(data).copy()\n        anchors = res.projector.components_.T\n        res.projector.initial = anchors\n\n        state.set_partial_result(res)\n        if np.allclose(initial, anchors, rtol=1e-5, atol=1e-4):\n            return res\n        initial = anchors\n\n        step += 1\n        state.set_progress_value(100 * step / steps)\n        if state.is_interruption_requested():\n            return res\n\n\nclass OWFreeVizGraph(OWGraphWithAnchors):\n    hide_radius = settings.Setting(0)\n\n    @property\n    def scaled_radius(self):\n        return self.hide_radius / 100 + 1e-5\n\n    def update_radius(self):\n        self.update_circle()\n        self.update_anchors()\n\n    def set_view_box_range(self):\n        self.view_box.setRange(QRectF(-1.05, -1.05, 2.1, 2.1))\n\n    def closest_draggable_item(self, pos):\n        points, *_ = self.master.get_anchors()\n        if points is None or not len(points):\n            return None\n        mask = np.linalg.norm(points, axis=1) > self.scaled_radius\n        xi, yi = points[mask].T\n        distances = (xi - pos.x()) ** 2 + (yi - pos.y()) ** 2\n        if len(distances) and np.min(distances) < self.DISTANCE_DIFF ** 2:\n            return np.flatnonzero(mask)[np.argmin(distances)]\n        return None\n\n    def update_anchors(self):\n        points, labels = self.master.get_anchors()\n        if points is None:\n            return\n        r = self.scaled_radius\n        if self.anchor_items is None:\n            self.anchor_items = []\n            for point, label in zip(points, labels):\n                anchor = AnchorItem(line=QLineF(0, 0, *point), text=label)\n                anchor.setVisible(np.linalg.norm(point) > r)\n                anchor.setPen(pg.mkPen((100, 100, 100)))\n                anchor.setFont(self.parameter_setter.anchor_font)\n                self.plot_widget.addItem(anchor)\n                self.anchor_items.append(anchor)\n        else:\n            for anchor, point, label in zip(self.anchor_items, points, labels):\n                anchor.setLine(QLineF(0, 0, *point))\n                anchor.setText(label)\n                anchor.setVisible(np.linalg.norm(point) > r)\n                anchor.setFont(self.parameter_setter.anchor_font)\n\n    def update_circle(self):\n        super().update_circle()\n        if self.circle_item is not None:\n            r = self.scaled_radius\n            self.circle_item.setRect(QRectF(-r, -r, 2 * r, 2 * r))\n            pen = pg.mkPen(QColor(Qt.lightGray), width=1, cosmetic=True)\n            self.circle_item.setPen(pen)\n\n    def _add_indicator_item(self, anchor_idx):\n        x, y = self.anchor_items[anchor_idx].get_xy()\n        dx = (self.view_box.childGroup.mapToDevice(QPoint(1, 0)) -\n              self.view_box.childGroup.mapToDevice(QPoint(-1, 0))).x()\n        self.indicator_item = MoveIndicator(x, y, 600 / dx)\n        self.plot_widget.addItem(self.indicator_item)\n\n\nclass InitType(IntEnum):\n    Circular, Random = 0, 1\n\n    @staticmethod\n    def items():\n        return [\"Circular\", \"Random\"]\n\n\nclass OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):\n    MAX_INSTANCES = 10000\n\n    name = \"FreeViz\"\n    description = \"Displays FreeViz projection\"\n    icon = \"icons/Freeviz.svg\"\n    priority = 240\n    keywords = [\"viz\"]\n\n    settings_version = 3\n    initialization = settings.Setting(InitType.Circular)\n    GRAPH_CLASS = OWFreeVizGraph\n    graph = settings.SettingProvider(OWFreeVizGraph)\n\n    class Error(OWAnchorProjectionWidget.Error):\n        no_class_var = widget.Msg(\"Data must have a target variable.\")\n        multiple_class_vars = widget.Msg(\n            \"Data must have a single target variable.\")\n        not_enough_class_vars = widget.Msg(\n            \"Target variable must have at least two unique values.\")\n        features_exceeds_instances = widget.Msg(\n            \"Number of features exceeds the number of instances.\")\n        too_many_data_instances = widget.Msg(\"Data is too large.\")\n        constant_data = widget.Msg(\"All data columns are constant.\")\n        not_enough_features = widget.Msg(\"At least two features are required.\")\n\n    class Warning(OWAnchorProjectionWidget.Warning):\n        removed_features = widget.Msg(\"Categorical features with more than\"\n                                      \" two values are not shown.\")\n\n    def __init__(self):\n        OWAnchorProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n\n    def _add_controls(self):\n        self.__add_controls_start_box()\n        super()._add_controls()\n        self.gui.add_control(\n            self._effects_box, gui.hSlider, \"Hide radius:\", master=self.graph,\n            value=\"hide_radius\", minValue=0, maxValue=100, step=10,\n            createLabel=False, callback=self.__radius_slider_changed\n        )\n\n    def __add_controls_start_box(self):\n        box = gui.vBox(self.controlArea, box=True)\n        gui.comboBox(\n            box, self, \"initialization\", label=\"Initialization:\",\n            items=InitType.items(), orientation=Qt.Horizontal,\n            labelWidth=90, callback=self.__init_combo_changed)\n        self.run_button = gui.button(box, self, \"Start\", self._toggle_run)\n\n    @property\n    def effective_variables(self):\n        return [a for a in self.data.domain.attributes\n                if a.is_continuous or a.is_discrete and len(a.values) == 2]\n\n    def __radius_slider_changed(self):\n        self.graph.update_radius()\n\n    def __init_combo_changed(self):\n        self.Error.proj_error.clear()\n        self.init_projection()\n        self.setup_plot()\n        self.commit()\n        if self.task is not None:\n            self._run()\n\n    def _toggle_run(self):\n        if self.task is not None:\n            self.cancel()\n            self.graph.set_sample_size(None)\n            self.run_button.setText(\"Resume\")\n            self.commit()\n        else:\n            self._run()\n\n    def _run(self):\n        if self.data is None:\n            return\n        self.graph.set_sample_size(self.SAMPLE_SIZE)\n        self.run_button.setText(\"Stop\")\n        self.start(run_freeviz, self.effective_data, self.projector)\n\n    # ConcurrentWidgetMixin\n    def on_partial_result(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.update_coordinates()\n        self.graph.update_density()\n\n    def on_done(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n        self.commit()\n\n    def on_exception(self, ex: Exception):\n        self.Error.proj_error(ex)\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n\n    # OWAnchorProjectionWidget\n    def set_data(self, data):\n        super().set_data(data)\n        self.graph.set_sample_size(None)\n        if self._invalidated:\n            self.init_projection()\n\n    def init_projection(self):\n        if self.data is None:\n            return\n        anchors = FreeViz.init_radial(len(self.effective_variables)) \\\n            if self.initialization == InitType.Circular \\\n            else FreeViz.init_random(len(self.effective_variables), 2)\n        self.projector = FreeViz(scale=False, center=False,\n                                 initial=anchors, maxiter=10)\n        data = self.projector.preprocess(self.effective_data)\n        self.projector.domain = data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)\n        self.projection.pre_domain = data.domain\n        self.projection.name = self.projector.name\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        super().check_data()\n        if self.data is not None:\n            class_vars, domain = self.data.domain.class_vars, self.data.domain\n            if not class_vars:\n                error(self.Error.no_class_var)\n            elif len(class_vars) > 1:\n                error(self.Error.multiple_class_vars)\n            elif class_vars[0].is_discrete and len(np.unique(self.data.Y)) < 2:\n                error(self.Error.not_enough_class_vars)\n            elif len(self.data.domain.attributes) < 2:\n                error(self.Error.not_enough_features)\n            elif len(self.data.domain.attributes) > self.data.X.shape[0]:\n                error(self.Error.features_exceeds_instances)\n            elif not np.sum(np.std(self.data.X, axis=0)):\n                error(self.Error.constant_data)\n            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:\n                error(self.Error.too_many_data_instances)\n            else:\n                if len(self.effective_variables) < len(domain.attributes):\n                    self.Warning.removed_features()\n\n    def enable_controls(self):\n        super().enable_controls()\n        self.run_button.setEnabled(self.data is not None)\n        self.run_button.setText(\"Start\")\n\n    def get_coordinates_data(self):\n        embedding = self.get_embedding()\n        if embedding is None:\n            return None, None\n        valid_emb = embedding[self.valid_data]\n        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)\n\n    def _manual_move(self, anchor_idx, x, y):\n        self.projector.initial[anchor_idx] = [x, y]\n        super()._manual_move(anchor_idx, x, y)\n\n    def clear(self):\n        super().clear()\n        self.cancel()\n\n    def onDeleteWidget(self):\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, _settings, version):\n        if version < 3:\n            if \"radius\" in _settings:\n                _settings[\"graph\"][\"hide_radius\"] = _settings[\"radius\"]\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]\n\n\nclass MoveIndicator(pg.GraphicsObject):\n    def __init__(self, x, y, scene_size, parent=None):\n        super().__init__(parent)\n        self.arrows = [\n            pg.ArrowItem(pos=(x - scene_size * 0.07 * np.cos(np.radians(ang)),\n                              y + scene_size * 0.07 * np.sin(np.radians(ang))),\n                         parent=self, angle=ang,\n                         headLen=13, tipAngle=45,\n                         brush=pg.mkColor(128, 128, 128))\n            for ang in (0, 90, 180, 270)]\n\n    def paint(self, painter, option, widget):\n        pass\n\n    def boundingRect(self):\n        return QRectF()\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    table = Table(\"zoo\")\n    WidgetPreview(OWFreeViz).run(set_data=table, set_subset_data=table[::10])\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/visualize/owfreeviz.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "6d0159029",
                "new_commit_hash": "99387114f",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/visualize/owfreeviz.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/visualize/owfreeviz.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 139,
                            "length": 14
                        },
                        "new_range": {
                            "start": 139,
                            "length": 16
                        },
                        "section": "class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    graph = settings.SettingProvider(OWFreeVizGraph)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    class Error(OWAnchorProjectionWidget.Error):",
                                "type": "context"
                            },
                            {
                                "content": "        no_class_var = widget.Msg(\"Data has no target variable\")",
                                "type": "deleted"
                            },
                            {
                                "content": "        no_class_var = widget.Msg(\"Data must have a target variable.\")",
                                "type": "added"
                            },
                            {
                                "content": "        multiple_class_vars = widget.Msg(",
                                "type": "added"
                            },
                            {
                                "content": "            \"Data must have a single target variable.\")",
                                "type": "added"
                            },
                            {
                                "content": "        not_enough_class_vars = widget.Msg(",
                                "type": "context"
                            },
                            {
                                "content": "            \"Target variable is not at least binary\")",
                                "type": "deleted"
                            },
                            {
                                "content": "            \"Target variable must have at least two unique values.\")",
                                "type": "added"
                            },
                            {
                                "content": "        features_exceeds_instances = widget.Msg(",
                                "type": "context"
                            },
                            {
                                "content": "            \"Number of features exceeds the number of instances.\")",
                                "type": "context"
                            },
                            {
                                "content": "        too_many_data_instances = widget.Msg(\"Data is too large.\")",
                                "type": "context"
                            },
                            {
                                "content": "        constant_data = widget.Msg(\"All data columns are constant.\")",
                                "type": "context"
                            },
                            {
                                "content": "        not_enough_features = widget.Msg(\"At least two features are required\")",
                                "type": "deleted"
                            },
                            {
                                "content": "        not_enough_features = widget.Msg(\"At least two features are required.\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    class Warning(OWAnchorProjectionWidget.Warning):",
                                "type": "context"
                            },
                            {
                                "content": "        removed_features = widget.Msg(\"Categorical features with more than\"",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/owfreeviz.py",
                            "type": "class",
                            "name": "OWFreeViz",
                            "content": "class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):\n    MAX_INSTANCES = 10000\n\n    name = \"FreeViz\"\n    description = \"Displays FreeViz projection\"\n    icon = \"icons/Freeviz.svg\"\n    priority = 240\n    keywords = [\"viz\"]\n\n    settings_version = 3\n    initialization = settings.Setting(InitType.Circular)\n    GRAPH_CLASS = OWFreeVizGraph\n    graph = settings.SettingProvider(OWFreeVizGraph)\n\n    class Error(OWAnchorProjectionWidget.Error):\n        no_class_var = widget.Msg(\"Data has no target variable\")\n        not_enough_class_vars = widget.Msg(\n            \"Target variable is not at least binary\")\n        features_exceeds_instances = widget.Msg(\n            \"Number of features exceeds the number of instances.\")\n        too_many_data_instances = widget.Msg(\"Data is too large.\")\n        constant_data = widget.Msg(\"All data columns are constant.\")\n        not_enough_features = widget.Msg(\"At least two features are required\")\n\n    class Warning(OWAnchorProjectionWidget.Warning):\n        removed_features = widget.Msg(\"Categorical features with more than\"\n                                      \" two values are not shown.\")\n\n    def __init__(self):\n        OWAnchorProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n\n    def _add_controls(self):\n        self.__add_controls_start_box()\n        super()._add_controls()\n        self.gui.add_control(\n            self._effects_box, gui.hSlider, \"Hide radius:\", master=self.graph,\n            value=\"hide_radius\", minValue=0, maxValue=100, step=10,\n            createLabel=False, callback=self.__radius_slider_changed\n        )\n\n    def __add_controls_start_box(self):\n        box = gui.vBox(self.controlArea, box=True)\n        gui.comboBox(\n            box, self, \"initialization\", label=\"Initialization:\",\n            items=InitType.items(), orientation=Qt.Horizontal,\n            labelWidth=90, callback=self.__init_combo_changed)\n        self.run_button = gui.button(box, self, \"Start\", self._toggle_run)\n\n    @property\n    def effective_variables(self):\n        return [a for a in self.data.domain.attributes\n                if a.is_continuous or a.is_discrete and len(a.values) == 2]\n\n    def __radius_slider_changed(self):\n        self.graph.update_radius()\n\n    def __init_combo_changed(self):\n        self.Error.proj_error.clear()\n        self.init_projection()\n        self.setup_plot()\n        self.commit()\n        if self.task is not None:\n            self._run()\n\n    def _toggle_run(self):\n        if self.task is not None:\n            self.cancel()\n            self.graph.set_sample_size(None)\n            self.run_button.setText(\"Resume\")\n            self.commit()\n        else:\n            self._run()\n\n    def _run(self):\n        if self.data is None:\n            return\n        self.graph.set_sample_size(self.SAMPLE_SIZE)\n        self.run_button.setText(\"Stop\")\n        self.start(run_freeviz, self.effective_data, self.projector)\n\n    # ConcurrentWidgetMixin\n    def on_partial_result(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.update_coordinates()\n        self.graph.update_density()\n\n    def on_done(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n        self.commit()\n\n    def on_exception(self, ex: Exception):\n        self.Error.proj_error(ex)\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n\n    # OWAnchorProjectionWidget\n    def set_data(self, data):\n        super().set_data(data)\n        self.graph.set_sample_size(None)\n        if self._invalidated:\n            self.init_projection()\n\n    def init_projection(self):\n        if self.data is None:\n            return\n        anchors = FreeViz.init_radial(len(self.effective_variables)) \\\n            if self.initialization == InitType.Circular \\\n            else FreeViz.init_random(len(self.effective_variables), 2)\n        self.projector = FreeViz(scale=False, center=False,\n                                 initial=anchors, maxiter=10)\n        data = self.projector.preprocess(self.effective_data)\n        self.projector.domain = data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)\n        self.projection.pre_domain = data.domain\n        self.projection.name = self.projector.name\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        super().check_data()\n        if self.data is not None:\n            class_var, domain = self.data.domain.class_var, self.data.domain\n            if class_var is None:\n                error(self.Error.no_class_var)\n            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:\n                error(self.Error.not_enough_class_vars)\n            elif len(self.data.domain.attributes) < 2:\n                error(self.Error.not_enough_features)\n            elif len(self.data.domain.attributes) > self.data.X.shape[0]:\n                error(self.Error.features_exceeds_instances)\n            elif not np.sum(np.std(self.data.X, axis=0)):\n                error(self.Error.constant_data)\n            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:\n                error(self.Error.too_many_data_instances)\n            else:\n                if len(self.effective_variables) < len(domain.attributes):\n                    self.Warning.removed_features()\n\n    def enable_controls(self):\n        super().enable_controls()\n        self.run_button.setEnabled(self.data is not None)\n        self.run_button.setText(\"Start\")\n\n    def get_coordinates_data(self):\n        embedding = self.get_embedding()\n        if embedding is None:\n            return None, None\n        valid_emb = embedding[self.valid_data]\n        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)\n\n    def _manual_move(self, anchor_idx, x, y):\n        self.projector.initial[anchor_idx] = [x, y]\n        super()._manual_move(anchor_idx, x, y)\n\n    def clear(self):\n        super().clear()\n        self.cancel()\n\n    def onDeleteWidget(self):\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, _settings, version):\n        if version < 3:\n            if \"radius\" in _settings:\n                _settings[\"graph\"][\"hide_radius\"] = _settings[\"radius\"]\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 127,
                            "end_lineno": 314,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 257,
                            "length": 10
                        },
                        "new_range": {
                            "start": 259,
                            "length": 12
                        },
                        "section": "class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        super().check_data()",
                                "type": "context"
                            },
                            {
                                "content": "        if self.data is not None:",
                                "type": "context"
                            },
                            {
                                "content": "            class_var, domain = self.data.domain.class_var, self.data.domain",
                                "type": "deleted"
                            },
                            {
                                "content": "            if class_var is None:",
                                "type": "deleted"
                            },
                            {
                                "content": "            class_vars, domain = self.data.domain.class_vars, self.data.domain",
                                "type": "added"
                            },
                            {
                                "content": "            if not class_vars:",
                                "type": "added"
                            },
                            {
                                "content": "                error(self.Error.no_class_var)",
                                "type": "context"
                            },
                            {
                                "content": "            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:",
                                "type": "deleted"
                            },
                            {
                                "content": "            elif len(class_vars) > 1:",
                                "type": "added"
                            },
                            {
                                "content": "                error(self.Error.multiple_class_vars)",
                                "type": "added"
                            },
                            {
                                "content": "            elif class_vars[0].is_discrete and len(np.unique(self.data.Y)) < 2:",
                                "type": "added"
                            },
                            {
                                "content": "                error(self.Error.not_enough_class_vars)",
                                "type": "context"
                            },
                            {
                                "content": "            elif len(self.data.domain.attributes) < 2:",
                                "type": "context"
                            },
                            {
                                "content": "                error(self.Error.not_enough_features)",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/owfreeviz.py",
                            "type": "class",
                            "name": "OWFreeViz",
                            "content": "class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):\n    MAX_INSTANCES = 10000\n\n    name = \"FreeViz\"\n    description = \"Displays FreeViz projection\"\n    icon = \"icons/Freeviz.svg\"\n    priority = 240\n    keywords = [\"viz\"]\n\n    settings_version = 3\n    initialization = settings.Setting(InitType.Circular)\n    GRAPH_CLASS = OWFreeVizGraph\n    graph = settings.SettingProvider(OWFreeVizGraph)\n\n    class Error(OWAnchorProjectionWidget.Error):\n        no_class_var = widget.Msg(\"Data has no target variable\")\n        not_enough_class_vars = widget.Msg(\n            \"Target variable is not at least binary\")\n        features_exceeds_instances = widget.Msg(\n            \"Number of features exceeds the number of instances.\")\n        too_many_data_instances = widget.Msg(\"Data is too large.\")\n        constant_data = widget.Msg(\"All data columns are constant.\")\n        not_enough_features = widget.Msg(\"At least two features are required\")\n\n    class Warning(OWAnchorProjectionWidget.Warning):\n        removed_features = widget.Msg(\"Categorical features with more than\"\n                                      \" two values are not shown.\")\n\n    def __init__(self):\n        OWAnchorProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n\n    def _add_controls(self):\n        self.__add_controls_start_box()\n        super()._add_controls()\n        self.gui.add_control(\n            self._effects_box, gui.hSlider, \"Hide radius:\", master=self.graph,\n            value=\"hide_radius\", minValue=0, maxValue=100, step=10,\n            createLabel=False, callback=self.__radius_slider_changed\n        )\n\n    def __add_controls_start_box(self):\n        box = gui.vBox(self.controlArea, box=True)\n        gui.comboBox(\n            box, self, \"initialization\", label=\"Initialization:\",\n            items=InitType.items(), orientation=Qt.Horizontal,\n            labelWidth=90, callback=self.__init_combo_changed)\n        self.run_button = gui.button(box, self, \"Start\", self._toggle_run)\n\n    @property\n    def effective_variables(self):\n        return [a for a in self.data.domain.attributes\n                if a.is_continuous or a.is_discrete and len(a.values) == 2]\n\n    def __radius_slider_changed(self):\n        self.graph.update_radius()\n\n    def __init_combo_changed(self):\n        self.Error.proj_error.clear()\n        self.init_projection()\n        self.setup_plot()\n        self.commit()\n        if self.task is not None:\n            self._run()\n\n    def _toggle_run(self):\n        if self.task is not None:\n            self.cancel()\n            self.graph.set_sample_size(None)\n            self.run_button.setText(\"Resume\")\n            self.commit()\n        else:\n            self._run()\n\n    def _run(self):\n        if self.data is None:\n            return\n        self.graph.set_sample_size(self.SAMPLE_SIZE)\n        self.run_button.setText(\"Stop\")\n        self.start(run_freeviz, self.effective_data, self.projector)\n\n    # ConcurrentWidgetMixin\n    def on_partial_result(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.update_coordinates()\n        self.graph.update_density()\n\n    def on_done(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n        self.commit()\n\n    def on_exception(self, ex: Exception):\n        self.Error.proj_error(ex)\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n\n    # OWAnchorProjectionWidget\n    def set_data(self, data):\n        super().set_data(data)\n        self.graph.set_sample_size(None)\n        if self._invalidated:\n            self.init_projection()\n\n    def init_projection(self):\n        if self.data is None:\n            return\n        anchors = FreeViz.init_radial(len(self.effective_variables)) \\\n            if self.initialization == InitType.Circular \\\n            else FreeViz.init_random(len(self.effective_variables), 2)\n        self.projector = FreeViz(scale=False, center=False,\n                                 initial=anchors, maxiter=10)\n        data = self.projector.preprocess(self.effective_data)\n        self.projector.domain = data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)\n        self.projection.pre_domain = data.domain\n        self.projection.name = self.projector.name\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        super().check_data()\n        if self.data is not None:\n            class_var, domain = self.data.domain.class_var, self.data.domain\n            if class_var is None:\n                error(self.Error.no_class_var)\n            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:\n                error(self.Error.not_enough_class_vars)\n            elif len(self.data.domain.attributes) < 2:\n                error(self.Error.not_enough_features)\n            elif len(self.data.domain.attributes) > self.data.X.shape[0]:\n                error(self.Error.features_exceeds_instances)\n            elif not np.sum(np.std(self.data.X, axis=0)):\n                error(self.Error.constant_data)\n            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:\n                error(self.Error.too_many_data_instances)\n            else:\n                if len(self.effective_variables) < len(domain.attributes):\n                    self.Warning.removed_features()\n\n    def enable_controls(self):\n        super().enable_controls()\n        self.run_button.setEnabled(self.data is not None)\n        self.run_button.setText(\"Start\")\n\n    def get_coordinates_data(self):\n        embedding = self.get_embedding()\n        if embedding is None:\n            return None, None\n        valid_emb = embedding[self.valid_data]\n        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)\n\n    def _manual_move(self, anchor_idx, x, y):\n        self.projector.initial[anchor_idx] = [x, y]\n        super()._manual_move(anchor_idx, x, y)\n\n    def clear(self):\n        super().clear()\n        self.cancel()\n\n    def onDeleteWidget(self):\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, _settings, version):\n        if version < 3:\n            if \"radius\" in _settings:\n                _settings[\"graph\"][\"hide_radius\"] = _settings[\"radius\"]\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 127,
                            "end_lineno": 314,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/visualize/owfreeviz.py",
                            "type": "method",
                            "name": "OWFreeViz.check_data",
                            "content": "class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):\n    MAX_INSTANCES = 10000\n\n    name = \"FreeViz\"\n    description = \"Displays FreeViz projection\"\n    icon = \"icons/Freeviz.svg\"\n    priority = 240\n    keywords = [\"viz\"]\n\n    settings_version = 3\n    initialization = settings.Setting(InitType.Circular)\n    GRAPH_CLASS = OWFreeVizGraph\n    graph = settings.SettingProvider(OWFreeVizGraph)\n\n    class Error(OWAnchorProjectionWidget.Error):\n        no_class_var = widget.Msg(\"Data has no target variable\")\n        not_enough_class_vars = widget.Msg(\n            \"Target variable is not at least binary\")\n        features_exceeds_instances = widget.Msg(\n            \"Number of features exceeds the number of instances.\")\n        too_many_data_instances = widget.Msg(\"Data is too large.\")\n        constant_data = widget.Msg(\"All data columns are constant.\")\n        not_enough_features = widget.Msg(\"At least two features are required\")\n\n    class Warning(OWAnchorProjectionWidget.Warning):\n        removed_features = widget.Msg(\"Categorical features with more than\"\n                                      \" two values are not shown.\")\n\n    def __init__(self):\n        OWAnchorProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n\n    def _add_controls(self):\n        self.__add_controls_start_box()\n        super()._add_controls()\n        self.gui.add_control(\n            self._effects_box, gui.hSlider, \"Hide radius:\", master=self.graph,\n            value=\"hide_radius\", minValue=0, maxValue=100, step=10,\n            createLabel=False, callback=self.__radius_slider_changed\n        )\n\n    def __add_controls_start_box(self):\n        box = gui.vBox(self.controlArea, box=True)\n        gui.comboBox(\n            box, self, \"initialization\", label=\"Initialization:\",\n            items=InitType.items(), orientation=Qt.Horizontal,\n            labelWidth=90, callback=self.__init_combo_changed)\n        self.run_button = gui.button(box, self, \"Start\", self._toggle_run)\n\n    @property\n    def effective_variables(self):\n        return [a for a in self.data.domain.attributes\n                if a.is_continuous or a.is_discrete and len(a.values) == 2]\n\n    def __radius_slider_changed(self):\n        self.graph.update_radius()\n\n    def __init_combo_changed(self):\n        self.Error.proj_error.clear()\n        self.init_projection()\n        self.setup_plot()\n        self.commit()\n        if self.task is not None:\n            self._run()\n\n    def _toggle_run(self):\n        if self.task is not None:\n            self.cancel()\n            self.graph.set_sample_size(None)\n            self.run_button.setText(\"Resume\")\n            self.commit()\n        else:\n            self._run()\n\n    def _run(self):\n        if self.data is None:\n            return\n        self.graph.set_sample_size(self.SAMPLE_SIZE)\n        self.run_button.setText(\"Stop\")\n        self.start(run_freeviz, self.effective_data, self.projector)\n\n    # ConcurrentWidgetMixin\n    def on_partial_result(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.update_coordinates()\n        self.graph.update_density()\n\n    def on_done(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n        self.commit()\n\n    def on_exception(self, ex: Exception):\n        self.Error.proj_error(ex)\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n\n    # OWAnchorProjectionWidget\n    def set_data(self, data):\n        super().set_data(data)\n        self.graph.set_sample_size(None)\n        if self._invalidated:\n            self.init_projection()\n\n    def init_projection(self):\n        if self.data is None:\n            return\n        anchors = FreeViz.init_radial(len(self.effective_variables)) \\\n            if self.initialization == InitType.Circular \\\n            else FreeViz.init_random(len(self.effective_variables), 2)\n        self.projector = FreeViz(scale=False, center=False,\n                                 initial=anchors, maxiter=10)\n        data = self.projector.preprocess(self.effective_data)\n        self.projector.domain = data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)\n        self.projection.pre_domain = data.domain\n        self.projection.name = self.projector.name\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        super().check_data()\n        if self.data is not None:\n            class_var, domain = self.data.domain.class_var, self.data.domain\n            if class_var is None:\n                error(self.Error.no_class_var)\n            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:\n                error(self.Error.not_enough_class_vars)\n            elif len(self.data.domain.attributes) < 2:\n                error(self.Error.not_enough_features)\n            elif len(self.data.domain.attributes) > self.data.X.shape[0]:\n                error(self.Error.features_exceeds_instances)\n            elif not np.sum(np.std(self.data.X, axis=0)):\n                error(self.Error.constant_data)\n            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:\n                error(self.Error.too_many_data_instances)\n            else:\n                if len(self.effective_variables) < len(domain.attributes):\n                    self.Warning.removed_features()\n\n    def enable_controls(self):\n        super().enable_controls()\n        self.run_button.setEnabled(self.data is not None)\n        self.run_button.setText(\"Start\")\n\n    def get_coordinates_data(self):\n        embedding = self.get_embedding()\n        if embedding is None:\n            return None, None\n        valid_emb = embedding[self.valid_data]\n        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)\n\n    def _manual_move(self, anchor_idx, x, y):\n        self.projector.initial[anchor_idx] = [x, y]\n        super()._manual_move(anchor_idx, x, y)\n\n    def clear(self):\n        super().clear()\n        self.cancel()\n\n    def onDeleteWidget(self):\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, _settings, version):\n        if version < 3:\n            if \"radius\" in _settings:\n                _settings[\"graph\"][\"hide_radius\"] = _settings[\"radius\"]\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 253,
                            "end_lineno": 275,
                            "parent": {
                                "file_name": "Orange/widgets/visualize/owfreeviz.py",
                                "type": "class",
                                "name": "OWFreeViz",
                                "content": "class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):\n    MAX_INSTANCES = 10000\n\n    name = \"FreeViz\"\n    description = \"Displays FreeViz projection\"\n    icon = \"icons/Freeviz.svg\"\n    priority = 240\n    keywords = [\"viz\"]\n\n    settings_version = 3\n    initialization = settings.Setting(InitType.Circular)\n    GRAPH_CLASS = OWFreeVizGraph\n    graph = settings.SettingProvider(OWFreeVizGraph)\n\n    class Error(OWAnchorProjectionWidget.Error):\n        no_class_var = widget.Msg(\"Data has no target variable\")\n        not_enough_class_vars = widget.Msg(\n            \"Target variable is not at least binary\")\n        features_exceeds_instances = widget.Msg(\n            \"Number of features exceeds the number of instances.\")\n        too_many_data_instances = widget.Msg(\"Data is too large.\")\n        constant_data = widget.Msg(\"All data columns are constant.\")\n        not_enough_features = widget.Msg(\"At least two features are required\")\n\n    class Warning(OWAnchorProjectionWidget.Warning):\n        removed_features = widget.Msg(\"Categorical features with more than\"\n                                      \" two values are not shown.\")\n\n    def __init__(self):\n        OWAnchorProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n\n    def _add_controls(self):\n        self.__add_controls_start_box()\n        super()._add_controls()\n        self.gui.add_control(\n            self._effects_box, gui.hSlider, \"Hide radius:\", master=self.graph,\n            value=\"hide_radius\", minValue=0, maxValue=100, step=10,\n            createLabel=False, callback=self.__radius_slider_changed\n        )\n\n    def __add_controls_start_box(self):\n        box = gui.vBox(self.controlArea, box=True)\n        gui.comboBox(\n            box, self, \"initialization\", label=\"Initialization:\",\n            items=InitType.items(), orientation=Qt.Horizontal,\n            labelWidth=90, callback=self.__init_combo_changed)\n        self.run_button = gui.button(box, self, \"Start\", self._toggle_run)\n\n    @property\n    def effective_variables(self):\n        return [a for a in self.data.domain.attributes\n                if a.is_continuous or a.is_discrete and len(a.values) == 2]\n\n    def __radius_slider_changed(self):\n        self.graph.update_radius()\n\n    def __init_combo_changed(self):\n        self.Error.proj_error.clear()\n        self.init_projection()\n        self.setup_plot()\n        self.commit()\n        if self.task is not None:\n            self._run()\n\n    def _toggle_run(self):\n        if self.task is not None:\n            self.cancel()\n            self.graph.set_sample_size(None)\n            self.run_button.setText(\"Resume\")\n            self.commit()\n        else:\n            self._run()\n\n    def _run(self):\n        if self.data is None:\n            return\n        self.graph.set_sample_size(self.SAMPLE_SIZE)\n        self.run_button.setText(\"Stop\")\n        self.start(run_freeviz, self.effective_data, self.projector)\n\n    # ConcurrentWidgetMixin\n    def on_partial_result(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.update_coordinates()\n        self.graph.update_density()\n\n    def on_done(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n        self.commit()\n\n    def on_exception(self, ex: Exception):\n        self.Error.proj_error(ex)\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n\n    # OWAnchorProjectionWidget\n    def set_data(self, data):\n        super().set_data(data)\n        self.graph.set_sample_size(None)\n        if self._invalidated:\n            self.init_projection()\n\n    def init_projection(self):\n        if self.data is None:\n            return\n        anchors = FreeViz.init_radial(len(self.effective_variables)) \\\n            if self.initialization == InitType.Circular \\\n            else FreeViz.init_random(len(self.effective_variables), 2)\n        self.projector = FreeViz(scale=False, center=False,\n                                 initial=anchors, maxiter=10)\n        data = self.projector.preprocess(self.effective_data)\n        self.projector.domain = data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)\n        self.projection.pre_domain = data.domain\n        self.projection.name = self.projector.name\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        super().check_data()\n        if self.data is not None:\n            class_var, domain = self.data.domain.class_var, self.data.domain\n            if class_var is None:\n                error(self.Error.no_class_var)\n            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:\n                error(self.Error.not_enough_class_vars)\n            elif len(self.data.domain.attributes) < 2:\n                error(self.Error.not_enough_features)\n            elif len(self.data.domain.attributes) > self.data.X.shape[0]:\n                error(self.Error.features_exceeds_instances)\n            elif not np.sum(np.std(self.data.X, axis=0)):\n                error(self.Error.constant_data)\n            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:\n                error(self.Error.too_many_data_instances)\n            else:\n                if len(self.effective_variables) < len(domain.attributes):\n                    self.Warning.removed_features()\n\n    def enable_controls(self):\n        super().enable_controls()\n        self.run_button.setEnabled(self.data is not None)\n        self.run_button.setText(\"Start\")\n\n    def get_coordinates_data(self):\n        embedding = self.get_embedding()\n        if embedding is None:\n            return None, None\n        valid_emb = embedding[self.valid_data]\n        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)\n\n    def _manual_move(self, anchor_idx, x, y):\n        self.projector.initial[anchor_idx] = [x, y]\n        super()._manual_move(anchor_idx, x, y)\n\n    def clear(self):\n        super().clear()\n        self.cancel()\n\n    def onDeleteWidget(self):\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, _settings, version):\n        if version < 3:\n            if \"radius\" in _settings:\n                _settings[\"graph\"][\"hide_radius\"] = _settings[\"radius\"]\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 127,
                                "end_lineno": 314,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nimport unittest\nfrom unittest.mock import Mock\n\nimport numpy as np\n\nfrom Orange.data import Table\nfrom Orange.projection import FreeViz\nfrom Orange.projection.freeviz import FreeVizModel\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, AnchorProjectionWidgetTestMixin\n)\nfrom Orange.widgets.tests.utils import simulate\nfrom Orange.widgets.visualize.owfreeviz import OWFreeViz, Result, run_freeviz\n\n\nclass TestOWFreeViz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                    WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(OWFreeViz)\n\n    def tearDown(self):\n        self.widget.onDeleteWidget()\n        super().tearDown()\n\n    def test_error_msg(self):\n        data = self.data[:, list(range(len(self.data.domain.attributes)))]\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        data = self.data[:40]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n\n    def test_optimization(self):\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_cancelled(self):\n        self.test_optimization()\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Resume\")\n\n    def test_optimization_reset(self):\n        self.test_optimization()\n        init = self.widget.controls.initialization\n        simulate.combobox_activate_index(init, 0)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        simulate.combobox_activate_index(init, 1)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_finish(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10].copy())\n        output1 = self.get_output(self.widget.Outputs.components)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        self.wait_until_finished()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n        output2 = self.get_output(self.widget.Outputs.components)\n        self.assertTrue((output1.X != output2.X).any())\n\n    def test_optimization_no_data(self):\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n\n    def test_constant_data(self):\n        data = Table(\"titanic\")[56:59]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.run_button.click()\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        GH-2780\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        self.widget.graph.controls.hide_radius.setSliderPosition(3)\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1]]).astype(float)\n        np.testing.assert_array_almost_equal(components.X, X)\n        metas = [[\"freeviz-x\"], [\"freeviz-y\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[1, 2], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X, array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_features.is_shown())\n        self.widget.run_button.click()\n\n\nclass TestOWFreeVizRunner(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.data = Table(\"iris\")\n\n    def setUp(self):\n        anchors = FreeViz.init_radial(len(self.data.domain.attributes))\n        self.projector = projector = FreeViz(scale=False, center=False,\n                                             initial=anchors, maxiter=10)\n        self.projector.domain = self.data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(projector, projector.domain, 2)\n        self.projection.pre_domain = self.data.domain\n\n    def test_Result(self):\n        result = Result(projector=self.projector, projection=self.projection)\n        self.assertIsInstance(result.projector, FreeViz)\n        self.assertIsInstance(result.projection, FreeVizModel)\n\n    def test_run(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n        result = run_freeviz(self.data, self.projector, state)\n        array = np.array([[1.66883742e-01, 9.40395481e-38],\n                          [-8.86817512e-02, 9.96060012e-01],\n                          [6.67450609e-02, -3.97675811e-01],\n                          [-1.44947052e-01, -5.98384200e-01]])\n        np.testing.assert_almost_equal(array.T, result.projection.components_)\n        state.set_status.assert_called_once_with(\"Calculating...\")\n        self.assertGreater(state.set_partial_result.call_count, 40)\n        self.assertGreater(state.set_progress_value.call_count, 40)\n\n    def test_run_do_not_modify_model_inplace(self):\n        state = Mock()\n        state.is_interruption_requested.return_value = True\n        result = run_freeviz(self.data, self.projector, state)\n        state.set_partial_result.assert_called_once()\n        self.assertIs(self.projector, result.projector)\n        self.assertIsNot(self.projection.proj, result.projection.proj)\n        self.assertTrue((self.projection.components_.T !=\n                         result.projection.components_.T).any())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nimport unittest\nfrom unittest.mock import Mock\n\nimport numpy as np\n\nfrom Orange.data import Table, Domain\nfrom Orange.projection import FreeViz\nfrom Orange.projection.freeviz import FreeVizModel\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, AnchorProjectionWidgetTestMixin\n)\nfrom Orange.widgets.tests.utils import simulate\nfrom Orange.widgets.visualize.owfreeviz import OWFreeViz, Result, run_freeviz\n\n\nclass TestOWFreeViz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                    WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(OWFreeViz)\n\n    def tearDown(self):\n        self.widget.onDeleteWidget()\n        super().tearDown()\n\n    def test_error_msg(self):\n        data = self.data[:, list(range(len(self.data.domain.attributes)))]\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        data = self.data[:40]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n\n    def test_number_of_targets(self):\n        data = self.heart_disease\n        domain = data.domain\n\n        no_target = data.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = data.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, no_target)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n    def test_optimization(self):\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_cancelled(self):\n        self.test_optimization()\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Resume\")\n\n    def test_optimization_reset(self):\n        self.test_optimization()\n        init = self.widget.controls.initialization\n        simulate.combobox_activate_index(init, 0)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        simulate.combobox_activate_index(init, 1)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_finish(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10].copy())\n        output1 = self.get_output(self.widget.Outputs.components)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        self.wait_until_finished()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n        output2 = self.get_output(self.widget.Outputs.components)\n        self.assertTrue((output1.X != output2.X).any())\n\n    def test_optimization_no_data(self):\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n\n    def test_constant_data(self):\n        data = Table(\"titanic\")[56:59]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.run_button.click()\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        GH-2780\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        self.widget.graph.controls.hide_radius.setSliderPosition(3)\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1]]).astype(float)\n        np.testing.assert_array_almost_equal(components.X, X)\n        metas = [[\"freeviz-x\"], [\"freeviz-y\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[1, 2], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X, array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_features.is_shown())\n        self.widget.run_button.click()\n\n\nclass TestOWFreeVizRunner(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.data = Table(\"iris\")\n\n    def setUp(self):\n        anchors = FreeViz.init_radial(len(self.data.domain.attributes))\n        self.projector = projector = FreeViz(scale=False, center=False,\n                                             initial=anchors, maxiter=10)\n        self.projector.domain = self.data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(projector, projector.domain, 2)\n        self.projection.pre_domain = self.data.domain\n\n    def test_Result(self):\n        result = Result(projector=self.projector, projection=self.projection)\n        self.assertIsInstance(result.projector, FreeViz)\n        self.assertIsInstance(result.projection, FreeVizModel)\n\n    def test_run(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n        result = run_freeviz(self.data, self.projector, state)\n        array = np.array([[1.66883742e-01, 9.40395481e-38],\n                          [-8.86817512e-02, 9.96060012e-01],\n                          [6.67450609e-02, -3.97675811e-01],\n                          [-1.44947052e-01, -5.98384200e-01]])\n        np.testing.assert_almost_equal(array.T, result.projection.components_)\n        state.set_status.assert_called_once_with(\"Calculating...\")\n        self.assertGreater(state.set_partial_result.call_count, 40)\n        self.assertGreater(state.set_progress_value.call_count, 40)\n\n    def test_run_do_not_modify_model_inplace(self):\n        state = Mock()\n        state.is_interruption_requested.return_value = True\n        result = run_freeviz(self.data, self.projector, state)\n        state.set_partial_result.assert_called_once()\n        self.assertIs(self.projector, result.projector)\n        self.assertIsNot(self.projection.proj, result.projection.proj)\n        self.assertTrue((self.projection.components_.T !=\n                         result.projection.components_.T).any())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/visualize/tests/test_owfreeviz.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "408eade94",
                "new_commit_hash": "c524847f9",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/visualize/tests/test_owfreeviz.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/visualize/tests/test_owfreeviz.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 5,
                            "length": 7
                        },
                        "new_range": {
                            "start": 5,
                            "length": 7
                        },
                        "section": "from unittest.mock import Mock"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Table",
                                "type": "deleted"
                            },
                            {
                                "content": "from Orange.data import Table, Domain",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.projection import FreeViz",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.projection.freeviz import FreeVizModel",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.tests.base import (",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owfreeviz.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.data import Table, Domain",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 8,
                            "end_lineno": 8,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owfreeviz.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.data import Table",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 8,
                            "end_lineno": 8,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 48,
                            "length": 6
                        },
                        "new_range": {
                            "start": 48,
                            "length": 41
                        },
                        "section": "class TestOWFreeViz(WidgetTest, AnchorProjectionWidgetTestMixin,"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.assertFalse(self.widget.Error.no_class_var.is_shown())",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_number_of_targets(self):",
                                "type": "added"
                            },
                            {
                                "content": "        data = self.heart_disease",
                                "type": "added"
                            },
                            {
                                "content": "        domain = data.domain",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        no_target = data.transform(",
                                "type": "added"
                            },
                            {
                                "content": "            Domain(domain.attributes,",
                                "type": "added"
                            },
                            {
                                "content": "                   []))",
                                "type": "added"
                            },
                            {
                                "content": "        two_targets = data.transform(",
                                "type": "added"
                            },
                            {
                                "content": "            Domain([domain[\"age\"]],",
                                "type": "added"
                            },
                            {
                                "content": "                   [domain[\"gender\"], domain[\"chest pain\"]]))",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, data)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.no_class_var.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, no_target)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(self.widget.Error.no_class_var.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, two_targets)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.no_class_var.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, data)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.no_class_var.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, two_targets)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.no_class_var.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, None)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.no_class_var.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_optimization(self):",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, self.heart_disease)",
                                "type": "context"
                            },
                            {
                                "content": "        self.widget.run_button.click()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owfreeviz.py",
                            "type": "class",
                            "name": "TestOWFreeViz",
                            "content": "class TestOWFreeViz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                    WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(OWFreeViz)\n\n    def tearDown(self):\n        self.widget.onDeleteWidget()\n        super().tearDown()\n\n    def test_error_msg(self):\n        data = self.data[:, list(range(len(self.data.domain.attributes)))]\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        data = self.data[:40]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n\n    def test_number_of_targets(self):\n        data = self.heart_disease\n        domain = data.domain\n\n        no_target = data.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = data.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, no_target)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n    def test_optimization(self):\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_cancelled(self):\n        self.test_optimization()\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Resume\")\n\n    def test_optimization_reset(self):\n        self.test_optimization()\n        init = self.widget.controls.initialization\n        simulate.combobox_activate_index(init, 0)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        simulate.combobox_activate_index(init, 1)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_finish(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10].copy())\n        output1 = self.get_output(self.widget.Outputs.components)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        self.wait_until_finished()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n        output2 = self.get_output(self.widget.Outputs.components)\n        self.assertTrue((output1.X != output2.X).any())\n\n    def test_optimization_no_data(self):\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n\n    def test_constant_data(self):\n        data = Table(\"titanic\")[56:59]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.run_button.click()\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        GH-2780\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        self.widget.graph.controls.hide_radius.setSliderPosition(3)\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1]]).astype(float)\n        np.testing.assert_array_almost_equal(components.X, X)\n        metas = [[\"freeviz-x\"], [\"freeviz-y\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[1, 2], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X, array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_features.is_shown())\n        self.widget.run_button.click()",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 18,
                            "end_lineno": 157,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owfreeviz.py",
                            "type": "method",
                            "name": "TestOWFreeViz.test_number_of_targets",
                            "content": "class TestOWFreeViz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                    WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(OWFreeViz)\n\n    def tearDown(self):\n        self.widget.onDeleteWidget()\n        super().tearDown()\n\n    def test_error_msg(self):\n        data = self.data[:, list(range(len(self.data.domain.attributes)))]\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        data = self.data[:40]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n\n    def test_number_of_targets(self):\n        data = self.heart_disease\n        domain = data.domain\n\n        no_target = data.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = data.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, no_target)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n    def test_optimization(self):\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_cancelled(self):\n        self.test_optimization()\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Resume\")\n\n    def test_optimization_reset(self):\n        self.test_optimization()\n        init = self.widget.controls.initialization\n        simulate.combobox_activate_index(init, 0)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        simulate.combobox_activate_index(init, 1)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_finish(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10].copy())\n        output1 = self.get_output(self.widget.Outputs.components)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        self.wait_until_finished()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n        output2 = self.get_output(self.widget.Outputs.components)\n        self.assertTrue((output1.X != output2.X).any())\n\n    def test_optimization_no_data(self):\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n\n    def test_constant_data(self):\n        data = Table(\"titanic\")[56:59]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.run_button.click()\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        GH-2780\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        self.widget.graph.controls.hide_radius.setSliderPosition(3)\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1]]).astype(float)\n        np.testing.assert_array_almost_equal(components.X, X)\n        metas = [[\"freeviz-x\"], [\"freeviz-y\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[1, 2], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X, array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_features.is_shown())\n        self.widget.run_button.click()",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 51,
                            "end_lineno": 84,
                            "parent": {
                                "file_name": "Orange/widgets/visualize/tests/test_owfreeviz.py",
                                "type": "class",
                                "name": "TestOWFreeViz",
                                "content": "class TestOWFreeViz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                    WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(OWFreeViz)\n\n    def tearDown(self):\n        self.widget.onDeleteWidget()\n        super().tearDown()\n\n    def test_error_msg(self):\n        data = self.data[:, list(range(len(self.data.domain.attributes)))]\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        data = self.data[:40]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n\n    def test_number_of_targets(self):\n        data = self.heart_disease\n        domain = data.domain\n\n        no_target = data.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = data.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, no_target)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n    def test_optimization(self):\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_cancelled(self):\n        self.test_optimization()\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Resume\")\n\n    def test_optimization_reset(self):\n        self.test_optimization()\n        init = self.widget.controls.initialization\n        simulate.combobox_activate_index(init, 0)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        simulate.combobox_activate_index(init, 1)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_finish(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10].copy())\n        output1 = self.get_output(self.widget.Outputs.components)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        self.wait_until_finished()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n        output2 = self.get_output(self.widget.Outputs.components)\n        self.assertTrue((output1.X != output2.X).any())\n\n    def test_optimization_no_data(self):\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n\n    def test_constant_data(self):\n        data = Table(\"titanic\")[56:59]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.run_button.click()\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        GH-2780\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        self.widget.graph.controls.hide_radius.setSliderPosition(3)\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1]]).astype(float)\n        np.testing.assert_array_almost_equal(components.X, X)\n        metas = [[\"freeviz-x\"], [\"freeviz-y\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[1, 2], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X, array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_features.is_shown())\n        self.widget.run_button.click()",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 18,
                                "end_lineno": 157,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "6b465291adff43e5696432561e0a8ba0bc743934^",
    "new_commit_hash": "6b465291adff43e5696432561e0a8ba0bc743934",
    "commit_message": "Learners and FreeViz: A better warning about (single) target variable",
    "commit_date": "2021-02-12T10:37:45+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "6b465291adff43e5696432561e0a8ba0bc743934",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nimport unittest\nfrom unittest.mock import Mock\n\nimport numpy as np\n\nfrom Orange.data import Table, Domain\nfrom Orange.projection import FreeViz\nfrom Orange.projection.freeviz import FreeVizModel\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, AnchorProjectionWidgetTestMixin\n)\nfrom Orange.widgets.tests.utils import simulate\nfrom Orange.widgets.visualize.owfreeviz import OWFreeViz, Result, run_freeviz\n\n\nclass TestOWFreeViz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                    WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        super().setUp()\n        self.widget = self.create_widget(OWFreeViz)\n\n    def tearDown(self):\n        self.widget.onDeleteWidget()\n        super().tearDown()\n\n    def test_error_msg(self):\n        data = self.data[:, list(range(len(self.data.domain.attributes)))]\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        data = self.data[:40]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.not_enough_class_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_class_vars.is_shown())\n\n    def test_number_of_targets(self):\n        data = self.heart_disease\n        domain = data.domain\n\n        no_target = data.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = data.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, no_target)\n        self.assertTrue(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, two_targets)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertTrue(self.widget.Error.multiple_class_vars.is_shown())\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n        self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\n\n    def test_optimization(self):\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_cancelled(self):\n        self.test_optimization()\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Resume\")\n\n    def test_optimization_reset(self):\n        self.test_optimization()\n        init = self.widget.controls.initialization\n        simulate.combobox_activate_index(init, 0)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        simulate.combobox_activate_index(init, 1)\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n\n    def test_optimization_finish(self):\n        self.send_signal(self.widget.Inputs.data, self.data[::10].copy())\n        output1 = self.get_output(self.widget.Outputs.components)\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Stop\")\n        self.wait_until_finished()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n        output2 = self.get_output(self.widget.Outputs.components)\n        self.assertTrue((output1.X != output2.X).any())\n\n    def test_optimization_no_data(self):\n        self.widget.run_button.click()\n        self.assertEqual(self.widget.run_button.text(), \"Start\")\n\n    def test_constant_data(self):\n        data = Table(\"titanic\")[56:59]\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.run_button.click()\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        GH-2780\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        self.widget.graph.controls.hide_radius.setSliderPosition(3)\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1]]).astype(float)\n        np.testing.assert_array_almost_equal(components.X, X)\n        metas = [[\"freeviz-x\"], [\"freeviz-y\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[1, 2], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X, array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_features.is_shown())\n        self.widget.run_button.click()\n\n\nclass TestOWFreeVizRunner(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.data = Table(\"iris\")\n\n    def setUp(self):\n        anchors = FreeViz.init_radial(len(self.data.domain.attributes))\n        self.projector = projector = FreeViz(scale=False, center=False,\n                                             initial=anchors, maxiter=10)\n        self.projector.domain = self.data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(projector, projector.domain, 2)\n        self.projection.pre_domain = self.data.domain\n\n    def test_Result(self):\n        result = Result(projector=self.projector, projection=self.projection)\n        self.assertIsInstance(result.projector, FreeViz)\n        self.assertIsInstance(result.projection, FreeVizModel)\n\n    def test_run(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n        result = run_freeviz(self.data, self.projector, state)\n        array = np.array([[1.66883742e-01, 9.40395481e-38],\n                          [-8.86817512e-02, 9.96060012e-01],\n                          [6.67450609e-02, -3.97675811e-01],\n                          [-1.44947052e-01, -5.98384200e-01]])\n        np.testing.assert_almost_equal(array.T, result.projection.components_)\n        state.set_status.assert_called_once_with(\"Calculating...\")\n        self.assertGreater(state.set_partial_result.call_count, 40)\n        self.assertGreater(state.set_progress_value.call_count, 40)\n\n    def test_run_do_not_modify_model_inplace(self):\n        state = Mock()\n        state.is_interruption_requested.return_value = True\n        result = run_freeviz(self.data, self.projector, state)\n        state.set_partial_result.assert_called_once()\n        self.assertIs(self.projector, result.projector)\n        self.assertIsNot(self.projection.proj, result.projection.proj)\n        self.assertTrue((self.projection.components_.T !=\n                         result.projection.components_.T).any())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
        "from unittest.mock import Mock\n\nimport scipy.sparse as sp\n\n# pylint: disable=missing-docstring, protected-access\nfrom Orange.base import Learner, Model\nfrom Orange.classification import KNNLearner\nfrom Orange.data import Table, Domain\nfrom Orange.modelling import TreeLearner, Fitter\nfrom Orange.preprocess import continuize\nfrom Orange.regression import MeanLearner, LinearRegressionLearner\nfrom Orange.widgets.utils.owlearnerwidget import OWBaseLearner\nfrom Orange.widgets.tests.base import WidgetTest\nfrom Orange.widgets.utils.signals import Output\nfrom Orange.widgets.utils.state_summary import format_summary_details\n\n\nclass TestOWBaseLearner(WidgetTest):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.iris = Table(\"iris\")\n\n    def test_error_on_learning(self):\n        \"\"\"Check that widget shows error message when learner fails\"\"\"\n\n        class FailingLearner(Learner):\n            \"\"\"A learner that fails when given data\"\"\"\n            __returns__ = Model\n\n            def __call__(self, data, *_):\n                if data is not None:\n                    raise ValueError(\"boom\")\n                return Model(Domain([]))\n\n        class OWFailingLearner(OWBaseLearner):\n            \"\"\"Widget for the above learner\"\"\"\n            name = learner_name = \"foo\"\n            LEARNER = FailingLearner\n            auto_apply = True\n\n        self.widget = self.create_widget(OWFailingLearner)\n        self.send_signal(\"Data\", self.iris)\n        self.assertTrue(self.widget.Error.fitting_failed.is_shown())\n        self.send_signal(\"Data\", None)\n        self.assertFalse(self.widget.Error.fitting_failed.is_shown())\n\n    def test_subclasses_do_not_share_outputs(self):\n        class WidgetA(OWBaseLearner, openclass=True):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        class WidgetB(OWBaseLearner):\n            name = \"B\"\n            LEARNER = MeanLearner\n\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertEqual(WidgetB.Outputs.learner.type, MeanLearner)\n\n        class WidgetC(WidgetA):\n            name = \"C\"\n            LEARNER = TreeLearner\n\n            class Outputs(WidgetA.Outputs):\n                test = Output(\"test\", str)\n\n        self.assertEqual(WidgetC.Outputs.learner.type, TreeLearner)\n        self.assertEqual(WidgetC.Outputs.test.name, \"test\")\n        self.assertEqual(WidgetA.Outputs.learner.type, KNNLearner)\n        self.assertFalse(hasattr(WidgetA.Outputs, \"test\"))\n\n    def test_send_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w = self.create_widget(WidgetA)\n        w.send(w.OUTPUT_MODEL_NAME, \"Foo\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Foo\")\n\n        # Old old signal name\n        w.send(\"Predictor\", \"Bar\")\n        self.assertEqual(self.get_output(w.OUTPUT_MODEL_NAME, w), \"Bar\")\n\n    def test_old_style_signals_on_subclass_backward_compatibility(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n            inputs = [(\"A\", None, \"set_data\")]\n            outputs = [(\"A\", None)]\n\n        desc = WidgetA.get_widget_description()\n        inputs = [i.name for i in desc[\"inputs\"]]\n        outputs = [o.name for o in desc[\"outputs\"]]\n\n        self.assertIn(WidgetA.Outputs.learner.name, outputs)\n        self.assertIn(WidgetA.Outputs.model.name, outputs)\n        self.assertIn(\"A\", outputs)\n\n        self.assertIn(WidgetA.Inputs.data.name, inputs)\n        self.assertIn(WidgetA.Inputs.preprocessor.name, inputs)\n        self.assertIn(\"A\", inputs)\n\n    def test_persists_learner_name_in_settings(self):\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n\n        w1 = self.create_widget(WidgetA)\n        w1.learner_name = \"MyWidget\"\n\n        settings = w1.settingsHandler.pack_data(w1)\n        w2 = self.create_widget(WidgetA, settings)\n        self.assertEqual(w2.learner_name, w1.learner_name)\n\n    def test_converts_sparse_targets_to_dense(self):\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = LinearRegressionLearner\n\n        w = self.create_widget(WidgetLR)\n\n        # Orange will want do do one-hot encoding when continuizing discrete variable\n        pp = continuize.DomainContinuizer(\n            multinomial_treatment=continuize.Continuize.AsOrdinal,\n            transform_class=True,\n        )\n        data = self.iris.transform(pp(self.iris))\n        data.Y = sp.csr_matrix(data.Y)\n\n        self.send_signal(w.Inputs.data, data, widget=w)\n        self.assertFalse(any(w.Error.active))\n\n        model = self.get_output(w.Outputs.model, widget=w)\n        self.assertIsNotNone(model)\n\n    def test_summary(self):\n        \"\"\"Check if the status bar is updated when data is received\"\"\"\n        class WidgetA(OWBaseLearner):\n            name = \"A\"\n            LEARNER = KNNLearner\n        widget = self.create_widget(WidgetA)\n        info = widget.info\n        no_input = \"No data on input\"\n\n        self.send_signal(widget.Inputs.data, self.iris)\n        summary, details = \"150\", format_summary_details(self.iris)\n        self.assertEqual(info._StateInfo__input_summary.brief, summary)\n        self.assertEqual(info._StateInfo__input_summary.details, details)\n        self.send_signal(widget.Inputs.data, None)\n        self.assertEqual(info._StateInfo__input_summary.brief, \"-\")\n        self.assertEqual(info._StateInfo__input_summary.details, no_input)\n\n    def test_invalid_number_of_targets(self):\n        class MockLearner(Fitter):\n            name = 'mock'\n            __fits__ = {'classification': Mock()}\n            __returns__ = Mock()\n\n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = MockLearner\n\n        w = self.create_widget(WidgetLR)\n        error = w.Error.data_error\n        heart = Table(\"heart_disease\")\n        domain = heart.domain\n\n        no_target = heart.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = heart.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n\n        self.send_signal(w.Inputs.data, heart)\n        self.assertFalse(error.is_shown())\n        self.assertIs(w.data, heart)\n\n        self.send_signal(w.Inputs.data, no_target)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_no_target = str(error)\n        self.assertIn(\"target\", err_no_target)\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_two_targets = str(error)\n        self.assertIn(\"target\", err_no_target)\n        self.assertNotEqual(err_no_target, err_two_targets)\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertIsNone(w.data)\n        self.assertFalse(error.is_shown())\n\n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n\n        self.send_signal(w.Inputs.data, None)\n        self.assertFalse(error.is_shown())\n"
    ],
    "test_file_names": [
        "test_1.py",
        "test_2.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_contingency.c -o build/temp.linux-x86_64-3.7/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-3.7/Orange/data\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_io.c -o build/temp.linux-x86_64-3.7/Orange/data/_io.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_variable.c -o build/temp.linux-x86_64-3.7/Orange/data/_variable.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/distance/_distance.c -o build/temp.linux-x86_64-3.7/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-3.7/Orange/distance\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._simple_tree' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.28.0.dev0+6b46529 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934\nProcessing dependencies for Orange3==3.28.0.dev0+6b46529\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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.4\nBest match: pyqtgraph 0.12.4\nAdding pyqtgraph 0.12.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for httpx==0.14.3\nBest match: httpx 0.14.3\nAdding httpx 0.14.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for chardet==3.0.4\nBest match: chardet 3.0.4\nAdding chardet 3.0.4 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine==5.15.6\nBest match: PyQtWebEngine 5.15.6\nAdding PyQtWebEngine 5.15.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for PyQt5==5.15.10\nBest match: PyQt5 5.15.10\nAdding PyQt5 5.15.10 to easy-install.pth file\nInstalling pylupdate5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling pyrcc5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling pyuic5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for rfc3986==1.5.0\nBest match: rfc3986 1.5.0\nAdding rfc3986 1.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.10.2\nBest match: httpcore 0.10.2\nAdding httpcore 0.10.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for PyQt5-sip==12.13.0\nBest match: PyQt5-sip 12.13.0\nAdding PyQt5-sip 12.13.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine-Qt5==5.15.16\nBest match: PyQtWebEngine-Qt5 5.15.16\nAdding PyQtWebEngine-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for PyQt5-Qt5==5.15.16\nBest match: PyQt5-Qt5 5.15.16\nAdding PyQt5-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nSearching for h11==0.9.0\nBest match: h11 0.9.0\nAdding h11 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.28.0.dev0+6b46529\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 73ms\nPrepared 18 packages in 46ms\nInstalled 18 packages in 225ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 53 packages in 382ms\nInstalled 47 packages in 860ms\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==3.0.4\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + h11==0.9.0\n + httpcore==0.10.2\n + httpx==0.14.3\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + rfc3986==1.5.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 39 packages in 77ms\nInstalled 13 packages in 67ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + platformdirs==4.0.0\n + pyqtgraph==0.12.4\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 3ms\nInstalled 2 packages in 7ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 51ms\nInstalled 5 packages in 1.27s\n + catboost==1.2.7\n + graphviz==0.20.1\n + plotly==5.18.0\n + tenacity==8.2.3\n + xgboost==1.6.2\nAudited 2 packages in 1ms\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3413:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3413 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4869:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4869 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5615:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5615 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5736:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5736 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5742:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5742 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7202:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7202 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7857:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7857 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7917:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7917 |               __pyx_t_15 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_14 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_6b465291adff43e5696432561e0a8ba0bc743934/.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_6b465291adff43e5696432561e0a8ba0bc743934/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 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_6b465291adff43e5696432561e0a8ba0bc743934\ncollected 55 items\n\nr2e_tests/test_1.py sss......................................            [ 74%]\nr2e_tests/test_2.py sEsEsE..s.ss.....                                    [100%]\n\n==================================== ERRORS ====================================\n______________ ERROR at teardown of WidgetTest.test_image_export _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_image_export>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n______________ ERROR at teardown of WidgetTest.test_minimum_size _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_minimum_size>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n_____________ ERROR at teardown of WidgetTest.test_msg_base_class ______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_msg_base_class>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_attr_label_metas\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_attr_models\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_class_density\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_constant_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_datasets\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_default_attrs\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_discrete_attributes\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_dragging_tooltip\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_embedding_missing_values\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_error_msg\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_handle_primitive_metas\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_hidden_effective_variables\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_image_export\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_in_out_summary\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_invalidated_embedding\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_manual_move\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_none_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_number_of_targets\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_cancelled\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_finish\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_no_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_reset\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_output_components\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_outputs\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_plot_once\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_send_report\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_set_radius_no_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_setup_graph\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_subset_data_color\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_visual_settings\nPASSED r2e_tests/test_1.py::TestOWFreeVizRunner::test_Result\nPASSED r2e_tests/test_1.py::TestOWFreeVizRunner::test_run\nPASSED r2e_tests/test_1.py::TestOWFreeVizRunner::test_run_do_not_modify_model_inplace\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_converts_sparse_targets_to_dense\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_error_on_learning\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_invalid_number_of_targets\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_old_style_signals_on_subclass_backward_compatibility\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_persists_learner_name_in_settings\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_send_backward_compatibility\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_subclasses_do_not_share_outputs\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_summary\nSKIPPED [3] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nERROR r2e_tests/test_2.py::WidgetTest::test_image_export - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_minimum_size - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_msg_base_class - AttributeError: ...\n=================== 46 passed, 9 skipped, 3 errors in 13.13s ===================\nWidgets left: 0    Max widgets: 8026 \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_6b465291adff43e5696432561e0a8ba0bc743934\ncollected 55 items\n\nr2e_tests/test_1.py sss...................F..................            [ 74%]\nr2e_tests/test_2.py sEsEsE..sFss.....                                    [100%]\n\n==================================== ERRORS ====================================\n______________ ERROR at teardown of WidgetTest.test_image_export _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_image_export>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n______________ ERROR at teardown of WidgetTest.test_minimum_size _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_minimum_size>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n_____________ ERROR at teardown of WidgetTest.test_msg_base_class ______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_msg_base_class>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n=================================== FAILURES ===================================\n_____________________ TestOWFreeViz.test_number_of_targets _____________________\n\nself = <r2e_tests.test_1.TestOWFreeViz testMethod=test_number_of_targets>\n\n    def test_number_of_targets(self):\n        data = self.heart_disease\n        domain = data.domain\n    \n        no_target = data.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = data.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n    \n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertFalse(self.widget.Error.no_class_var.is_shown())\n>       self.assertFalse(self.widget.Error.multiple_class_vars.is_shown())\nE       AttributeError: 'Error' object has no attribute 'multiple_class_vars'\n\nr2e_tests/test_1.py:64: AttributeError\n_______________ TestOWBaseLearner.test_invalid_number_of_targets _______________\n\nself = <r2e_tests.test_2.TestOWBaseLearner testMethod=test_invalid_number_of_targets>\n\n    def test_invalid_number_of_targets(self):\n        class MockLearner(Fitter):\n            name = 'mock'\n            __fits__ = {'classification': Mock()}\n            __returns__ = Mock()\n    \n        class WidgetLR(OWBaseLearner):\n            name = \"lr\"\n            LEARNER = MockLearner\n    \n        w = self.create_widget(WidgetLR)\n        error = w.Error.data_error\n        heart = Table(\"heart_disease\")\n        domain = heart.domain\n    \n        no_target = heart.transform(\n            Domain(domain.attributes,\n                   []))\n        two_targets = heart.transform(\n            Domain([domain[\"age\"]],\n                   [domain[\"gender\"], domain[\"chest pain\"]]))\n    \n        self.send_signal(w.Inputs.data, heart)\n        self.assertFalse(error.is_shown())\n        self.assertIs(w.data, heart)\n    \n        self.send_signal(w.Inputs.data, no_target)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_no_target = str(error)\n        self.assertIn(\"target\", err_no_target)\n    \n        self.send_signal(w.Inputs.data, two_targets)\n        self.assertTrue(error.is_shown())\n        self.assertIsNone(w.data)\n        err_two_targets = str(error)\n        self.assertIn(\"target\", err_no_target)\n>       self.assertNotEqual(err_no_target, err_two_targets)\nE       AssertionError: 'Data has no target variable.\\nYou can set a target variable with the Select Columns widget.' == 'Data has no target variable.\\nYou can set a target variable with the Select Columns widget.'\n\nr2e_tests/test_2.py:192: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_attr_label_metas\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_attr_models\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_class_density\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_constant_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_datasets\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_default_attrs\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_discrete_attributes\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_dragging_tooltip\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_embedding_missing_values\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_error_msg\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_handle_primitive_metas\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_hidden_effective_variables\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_image_export\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_in_out_summary\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_invalidated_embedding\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_manual_move\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_none_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_cancelled\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_finish\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_no_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_optimization_reset\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_output_components\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_outputs\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_plot_once\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_send_report\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_set_radius_no_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_setup_graph\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_subset_data_color\nPASSED r2e_tests/test_1.py::TestOWFreeViz::test_visual_settings\nPASSED r2e_tests/test_1.py::TestOWFreeVizRunner::test_Result\nPASSED r2e_tests/test_1.py::TestOWFreeVizRunner::test_run\nPASSED r2e_tests/test_1.py::TestOWFreeVizRunner::test_run_do_not_modify_model_inplace\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_converts_sparse_targets_to_dense\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_error_on_learning\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_old_style_signals_on_subclass_backward_compatibility\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_persists_learner_name_in_settings\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_send_backward_compatibility\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_subclasses_do_not_share_outputs\nPASSED r2e_tests/test_2.py::TestOWBaseLearner::test_summary\nSKIPPED [3] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [3] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nERROR r2e_tests/test_2.py::WidgetTest::test_image_export - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_minimum_size - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_msg_base_class - AttributeError: ...\nFAILED r2e_tests/test_1.py::TestOWFreeViz::test_number_of_targets - Attribute...\nFAILED r2e_tests/test_2.py::TestOWBaseLearner::test_invalid_number_of_targets\n============== 2 failed, 44 passed, 9 skipped, 3 errors in 8.44s ===============\nWidgets left: 0    Max widgets: 8026 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/utils/owlearnerwidget.py Orange/widgets/utils/tests/test_owlearnerwidget.py Orange/widgets/visualize/owfreeviz.py Orange/widgets/visualize/tests/test_owfreeviz.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Widget Fails to Handle Multiple Target Variables Properly

**Description:**
When the input data contains multiple target variables, the widget does not handle it correctly, resulting in unclear error messages and test failures. This behavior makes it difficult for users to understand the root cause and how to resolve the issue.

**Example Buggy Code:**
```python
heart = Table('heart_disease')
domain = heart.domain

# Transform data to include multiple target variables
two_targets = heart.transform(
    Domain([domain['age']],
           [domain['gender'], domain['chest pain']])
)

# Send the transformed data to the widget
self.send_signal(w.Inputs.data, two_targets)
```

**Expected Behavior:**
The widget should detect that multiple target variables are present and display a clear error message informing the user to select a single target variable using the appropriate tool or widget.

**Actual Behavior:**
An `AttributeError` is raised because the widget's error handling does not recognize multiple target variables. The error message is unclear and does not guide the user on how to fix the issue.

**Error Message:**
```
AttributeError: 'Error' object has no attribute 'multiple_class_vars'
```
[/ISSUE]
--- END ISSUE ---

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

--- BEGIN FILE ---
```
### Orange/widgets/utils/owlearnerwidget.py
from copy import deepcopy

from AnyQt.QtCore import QTimer, Qt

from Orange.data import Table
from Orange.modelling import Fitter, Learner, Model
from Orange.preprocess.preprocess import Preprocess
from Orange.statistics import util as ut
from Orange.widgets import gui
from Orange.widgets.settings import Setting
from Orange.widgets.utils import getmembers
from Orange.widgets.utils.signals import Output, Input
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.utils.state_summary import format_summary_details
from Orange.widgets.widget import OWWidget, WidgetMetaClass, Msg


class OWBaseLearnerMeta(WidgetMetaClass):
    """ Meta class for learner widgets

    OWBaseLearner declares two outputs, learner and model with
    generic type (Learner and Model).

    This metaclass ensures that each of the subclasses gets
    its own Outputs class with output that match the corresponding
    learner.
    """
    def __new__(cls, name, bases, attributes, **kwargs):
        def abstract_widget():
            return not attributes.get("name")

        def copy_outputs(template):
            result = type("Outputs", (), {})
            for name, signal in getmembers(template, Output):
                setattr(result, name, deepcopy(signal))
            return result

        obj = super().__new__(cls, name, bases, attributes, **kwargs)
        if abstract_widget():
            return obj

        learner = attributes.get("LEARNER")
        if not learner:
            raise AttributeError(
                "'{}' must declare attribute LEARNER".format(name))

        outputs = obj.Outputs = copy_outputs(obj.Outputs)
        outputs.learner.type = learner
        outputs.model.type = learner.__returns__

        return obj


class OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):
    """Abstract widget for classification/regression learners.

    Notes
    -----
    All learner widgets should define learner class LEARNER.
    LEARNER should have __returns__ attribute.

    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`
    in case LEARNER has extra parameters.

    """
    LEARNER = None
    supports_sparse = True

    learner_name = Setting("", schema_only=True)
    want_main_area = False
    resizing_enabled = False
    auto_apply = Setting(True)

    class Error(OWWidget.Error):
        data_error = Msg("{}")
        fitting_failed = Msg("Fitting failed.\n{}")
        sparse_not_supported = Msg("Sparse data is not supported.")
        out_of_memory = Msg("Out of memory.")

    class Warning(OWWidget.Warning):
        outdated_learner = Msg("Press Apply to submit changes.")

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

    class Outputs:
        learner = Output("Learner", Learner, dynamic=False)
        model = Output("Model", Model, dynamic=False,
                       replaces=["Classifier", "Predictor"])

    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code

    def __init__(self, preprocessors=None):
        super().__init__()
        self.data = None
        self.valid_data = False
        self.learner = None
        self.model = None
        self.preprocessors = preprocessors
        self.outdated_settings = False

        self.info.set_input_summary(self.info.NoInput)

        self.setup_layout()
        QTimer.singleShot(0, getattr(self, "unconditional_apply", self.apply))

    def create_learner(self):
        """Creates a learner with current configuration.

        Returns:
            Learner: an instance of Orange.base.learner subclass.
        """
        return self.LEARNER(preprocessors=self.preprocessors)

    def get_learner_parameters(self):
        """Creates an `OrderedDict` or a sequence of pairs with current model
        configuration.

        Returns:
            OrderedDict or List: (option, value) pairs or dict
        """
        return []

    @Inputs.preprocessor
    def set_preprocessor(self, preprocessor):
        self.preprocessors = preprocessor
        self.apply()

    @Inputs.data
    @check_sql_input
    def set_data(self, data):
        """Set the input train dataset."""
        self.Error.data_error.clear()
        self.data = data
        self.set_input_summary()

        if data is not None and data.domain.class_var is None:
            self.Error.data_error("Data has no target variable.\n"
                                  "You can set a target variable with the Select Columns widget.")
            self.data = None

        self.update_model()

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

    def apply(self):
        """Applies learner and sends new model."""
        self.update_learner()
        self.update_model()

    def update_learner(self):
        self.learner = self.create_learner()
        if self.learner and issubclass(self.LEARNER, Fitter):
            self.learner.use_default_preprocessors = True
        if self.learner is not None:
            self.learner.name = self.learner_name or self.name
        self.Outputs.learner.send(self.learner)
        self.outdated_settings = False
        self.Warning.outdated_learner.clear()

    def show_fitting_failed(self, exc):
        """Show error when fitting fails.
            Derived widgets can override this to show more specific messages."""
        self.Error.fitting_failed(str(exc), shown=exc is not None)

    def update_model(self):
        self.show_fitting_failed(None)
        self.model = None
        if self.check_data():
            try:
                self.model = self.learner(self.data)
            except BaseException as exc:
                self.show_fitting_failed(exc)
            else:
                self.model.name = self.learner_name or self.name
                self.model.instances = self.data
        self.Outputs.model.send(self.model)

    def check_data(self):
        self.valid_data = False
        self.Error.sparse_not_supported.clear()
        if self.data is not None and self.learner is not None:
            self.Error.data_error.clear()
            if not self.learner.check_learner_adequacy(self.data.domain):
                self.Error.data_error(self.learner.learner_adequacy_err_msg)
            elif not len(self.data):
                self.Error.data_error("Dataset is empty.")
            elif len(ut.unique(self.data.Y)) < 2:
                self.Error.data_error("Data contains a single target value.")
            elif self.data.X.size == 0:
                self.Error.data_error("Data has no features to learn from.")
            elif self.data.is_sparse() and not self.supports_sparse:
                self.Error.sparse_not_supported()
            else:
                self.valid_data = True
        return self.valid_data

    def settings_changed(self, *args, **kwargs):
        self.outdated_settings = True
        self.Warning.outdated_learner(shown=not self.auto_apply)
        self.apply()

    def _change_name(self, instance, output):
        if instance:
            instance.name = self.learner_name or self.name
            if self.auto_apply:
                output.send(instance)

    def learner_name_changed(self):
        self._change_name(self.learner, self.Outputs.learner)
        self._change_name(self.model, self.Outputs.model)

    def send_report(self):
        self.report_items((("Name", self.learner_name or self.name),))

        model_parameters = self.get_learner_parameters()
        if model_parameters:
            self.report_items("Model parameters", model_parameters)

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

    # GUI
    def setup_layout(self):
        self.add_learner_name_widget()
        self.add_main_layout()
        # Options specific to target variable type, if supported
        if issubclass(self.LEARNER, Fitter):
            # Only add a classification section if the method is overridden
            if type(self).add_classification_layout is not \
                    OWBaseLearner.add_classification_layout:
                classification_box = gui.widgetBox(
                    self.controlArea, 'Classification')
                self.add_classification_layout(classification_box)
            # Only add a regression section if the method is overridden
            if type(self).add_regression_layout is not \
                    OWBaseLearner.add_regression_layout:
                regression_box = gui.widgetBox(self.controlArea, 'Regression')
                self.add_regression_layout(regression_box)
        self.add_bottom_buttons()

    def add_main_layout(self):
        """Creates layout with the learner configuration widgets.

        Override this method for laying out any learner-specific parameter controls.
        See setup_layout() method for execution order.
        """
        pass

    def add_classification_layout(self, box):
        """Creates layout for classification specific options.

        If a widget outputs a learner dispatcher, sometimes the classification
        and regression learners require different options.
        See `setup_layout()` method for execution order.
        """
        pass

    def add_regression_layout(self, box):
        """Creates layout for regression specific options.

        If a widget outputs a learner dispatcher, sometimes the classification
        and regression learners require different options.
        See `setup_layout()` method for execution order.
        """
        pass

    def add_learner_name_widget(self):
        self.name_line_edit = gui.lineEdit(
            self.controlArea, self, 'learner_name', box='Name',
            placeholderText=self.name,
            tooltip='The name will identify this model in other widgets',
            orientation=Qt.Horizontal, callback=self.learner_name_changed)

    def add_bottom_buttons(self):
        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)

    def send(self, signalName, value, id=None):
        # A subclass might still use the old syntax to send outputs
        # defined on this class
        for _, output in getmembers(self.Outputs, Output):
            if output.name == signalName or signalName in output.replaces:
                output.send(value, id=id)
                return

        super().send(signalName, value, id)

    @classmethod
    def get_widget_description(cls):
        # When a subclass defines defines old-style signals, those override
        # the new-style ones, so we add them manually
        desc = super().get_widget_description()

        if cls.outputs:
            desc["outputs"].extend(cls.get_signals("outputs", True))
        if cls.inputs:
            desc["inputs"].extend(cls.get_signals("inputs", True))
        return desc


### Orange/widgets/visualize/owfreeviz.py
# pylint: disable=too-many-ancestors
from enum import IntEnum
from types import SimpleNamespace as namespace

import numpy as np

from AnyQt.QtCore import Qt, QRectF, QLineF, QPoint
from AnyQt.QtGui import QColor

import pyqtgraph as pg

from Orange.data import Table
from Orange.projection import FreeViz
from Orange.projection.freeviz import FreeVizModel
from Orange.widgets import widget, gui, settings
from Orange.widgets.utils.concurrent import ConcurrentWidgetMixin, TaskState
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.visualize.utils.component import OWGraphWithAnchors
from Orange.widgets.visualize.utils.plotutils import AnchorItem
from Orange.widgets.visualize.utils.widget import OWAnchorProjectionWidget


class Result(namespace):
    projector = None  # type: FreeViz
    projection = None  # type: FreeVizModel


MAX_ITERATIONS = 1000


def run_freeviz(data: Table, projector: FreeViz, state: TaskState):
    res = Result(projector=projector, projection=None)
    step, steps = 0, MAX_ITERATIONS
    initial = res.projector.components_.T
    state.set_status("Calculating...")
    while True:
        # Needs a copy because projection should not be modified inplace.
        # If it is modified inplace, the widget and the thread hold a
        # reference to the same object. When the thread is interrupted it
        # is still modifying the object, but the widget receives it
        # (the modified object) with a delay.
        res.projection = res.projector(data).copy()
        anchors = res.projector.components_.T
        res.projector.initial = anchors

        state.set_partial_result(res)
        if np.allclose(initial, anchors, rtol=1e-5, atol=1e-4):
            return res
        initial = anchors

        step += 1
        state.set_progress_value(100 * step / steps)
        if state.is_interruption_requested():
            return res


class OWFreeVizGraph(OWGraphWithAnchors):
    hide_radius = settings.Setting(0)

    @property
    def scaled_radius(self):
        return self.hide_radius / 100 + 1e-5

    def update_radius(self):
        self.update_circle()
        self.update_anchors()

    def set_view_box_range(self):
        self.view_box.setRange(QRectF(-1.05, -1.05, 2.1, 2.1))

    def closest_draggable_item(self, pos):
        points, *_ = self.master.get_anchors()
        if points is None or not len(points):
            return None
        mask = np.linalg.norm(points, axis=1) > self.scaled_radius
        xi, yi = points[mask].T
        distances = (xi - pos.x()) ** 2 + (yi - pos.y()) ** 2
        if len(distances) and np.min(distances) < self.DISTANCE_DIFF ** 2:
            return np.flatnonzero(mask)[np.argmin(distances)]
        return None

    def update_anchors(self):
        points, labels = self.master.get_anchors()
        if points is None:
            return
        r = self.scaled_radius
        if self.anchor_items is None:
            self.anchor_items = []
            for point, label in zip(points, labels):
                anchor = AnchorItem(line=QLineF(0, 0, *point), text=label)
                anchor.setVisible(np.linalg.norm(point) > r)
                anchor.setPen(pg.mkPen((100, 100, 100)))
                anchor.setFont(self.parameter_setter.anchor_font)
                self.plot_widget.addItem(anchor)
                self.anchor_items.append(anchor)
        else:
            for anchor, point, label in zip(self.anchor_items, points, labels):
                anchor.setLine(QLineF(0, 0, *point))
                anchor.setText(label)
                anchor.setVisible(np.linalg.norm(point) > r)
                anchor.setFont(self.parameter_setter.anchor_font)

    def update_circle(self):
        super().update_circle()
        if self.circle_item is not None:
            r = self.scaled_radius
            self.circle_item.setRect(QRectF(-r, -r, 2 * r, 2 * r))
            pen = pg.mkPen(QColor(Qt.lightGray), width=1, cosmetic=True)
            self.circle_item.setPen(pen)

    def _add_indicator_item(self, anchor_idx):
        x, y = self.anchor_items[anchor_idx].get_xy()
        dx = (self.view_box.childGroup.mapToDevice(QPoint(1, 0)) -
              self.view_box.childGroup.mapToDevice(QPoint(-1, 0))).x()
        self.indicator_item = MoveIndicator(x, y, 600 / dx)
        self.plot_widget.addItem(self.indicator_item)


class InitType(IntEnum):
    Circular, Random = 0, 1

    @staticmethod
    def items():
        return ["Circular", "Random"]


class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):
    MAX_INSTANCES = 10000

    name = "FreeViz"
    description = "Displays FreeViz projection"
    icon = "icons/Freeviz.svg"
    priority = 240
    keywords = ["viz"]

    settings_version = 3
    initialization = settings.Setting(InitType.Circular)
    GRAPH_CLASS = OWFreeVizGraph
    graph = settings.SettingProvider(OWFreeVizGraph)

    class Error(OWAnchorProjectionWidget.Error):
        no_class_var = widget.Msg("Data has no target variable")
        not_enough_class_vars = widget.Msg(
            "Target variable is not at least binary")
        features_exceeds_instances = widget.Msg(
            "Number of features exceeds the number of instances.")
        too_many_data_instances = widget.Msg("Data is too large.")
        constant_data = widget.Msg("All data columns are constant.")
        not_enough_features = widget.Msg("At least two features are required")

    class Warning(OWAnchorProjectionWidget.Warning):
        removed_features = widget.Msg("Categorical features with more than"
                                      " two values are not shown.")

    def __init__(self):
        OWAnchorProjectionWidget.__init__(self)
        ConcurrentWidgetMixin.__init__(self)

    def _add_controls(self):
        self.__add_controls_start_box()
        super()._add_controls()
        self.gui.add_control(
            self._effects_box, gui.hSlider, "Hide radius:", master=self.graph,
            value="hide_radius", minValue=0, maxValue=100, step=10,
            createLabel=False, callback=self.__radius_slider_changed
        )

    def __add_controls_start_box(self):
        box = gui.vBox(self.controlArea, box=True)
        gui.comboBox(
            box, self, "initialization", label="Initialization:",
            items=InitType.items(), orientation=Qt.Horizontal,
            labelWidth=90, callback=self.__init_combo_changed)
        self.run_button = gui.button(box, self, "Start", self._toggle_run)

    @property
    def effective_variables(self):
        return [a for a in self.data.domain.attributes
                if a.is_continuous or a.is_discrete and len(a.values) == 2]

    def __radius_slider_changed(self):
        self.graph.update_radius()

    def __init_combo_changed(self):
        self.Error.proj_error.clear()
        self.init_projection()
        self.setup_plot()
        self.commit()
        if self.task is not None:
            self._run()

    def _toggle_run(self):
        if self.task is not None:
            self.cancel()
            self.graph.set_sample_size(None)
            self.run_button.setText("Resume")
            self.commit()
        else:
            self._run()

    def _run(self):
        if self.data is None:
            return
        self.graph.set_sample_size(self.SAMPLE_SIZE)
        self.run_button.setText("Stop")
        self.start(run_freeviz, self.effective_data, self.projector)

    # ConcurrentWidgetMixin
    def on_partial_result(self, result: Result):
        assert isinstance(result.projector, FreeViz)
        assert isinstance(result.projection, FreeVizModel)
        self.projector = result.projector
        self.projection = result.projection
        self.graph.update_coordinates()
        self.graph.update_density()

    def on_done(self, result: Result):
        assert isinstance(result.projector, FreeViz)
        assert isinstance(result.projection, FreeVizModel)
        self.projector = result.projector
        self.projection = result.projection
        self.graph.set_sample_size(None)
        self.run_button.setText("Start")
        self.commit()

    def on_exception(self, ex: Exception):
        self.Error.proj_error(ex)
        self.graph.set_sample_size(None)
        self.run_button.setText("Start")

    # OWAnchorProjectionWidget
    def set_data(self, data):
        super().set_data(data)
        self.graph.set_sample_size(None)
        if self._invalidated:
            self.init_projection()

    def init_projection(self):
        if self.data is None:
            return
        anchors = FreeViz.init_radial(len(self.effective_variables)) \
            if self.initialization == InitType.Circular \
            else FreeViz.init_random(len(self.effective_variables), 2)
        self.projector = FreeViz(scale=False, center=False,
                                 initial=anchors, maxiter=10)
        data = self.projector.preprocess(self.effective_data)
        self.projector.domain = data.domain
        self.projector.components_ = anchors.T
        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)
        self.projection.pre_domain = data.domain
        self.projection.name = self.projector.name

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

        super().check_data()
        if self.data is not None:
            class_var, domain = self.data.domain.class_var, self.data.domain
            if class_var is None:
                error(self.Error.no_class_var)
            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:
                error(self.Error.not_enough_class_vars)
            elif len(self.data.domain.attributes) < 2:
                error(self.Error.not_enough_features)
            elif len(self.data.domain.attributes) > self.data.X.shape[0]:
                error(self.Error.features_exceeds_instances)
            elif not np.sum(np.std(self.data.X, axis=0)):
                error(self.Error.constant_data)
            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:
                error(self.Error.too_many_data_instances)
            else:
                if len(self.effective_variables) < len(domain.attributes):
                    self.Warning.removed_features()

    def enable_controls(self):
        super().enable_controls()
        self.run_button.setEnabled(self.data is not None)
        self.run_button.setText("Start")

    def get_coordinates_data(self):
        embedding = self.get_embedding()
        if embedding is None:
            return None, None
        valid_emb = embedding[self.valid_data]
        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)

    def _manual_move(self, anchor_idx, x, y):
        self.projector.initial[anchor_idx] = [x, y]
        super()._manual_move(anchor_idx, x, y)

    def clear(self):
        super().clear()
        self.cancel()

    def onDeleteWidget(self):
        self.shutdown()
        super().onDeleteWidget()

    @classmethod
    def migrate_settings(cls, _settings, version):
        if version < 3:
            if "radius" in _settings:
                _settings["graph"]["hide_radius"] = _settings["radius"]

    @classmethod
    def migrate_context(cls, context, version):
        if version < 3:
            values = context.values
            values["attr_color"] = values["graph"]["attr_color"]
            values["attr_size"] = values["graph"]["attr_size"]
            values["attr_shape"] = values["graph"]["attr_shape"]
            values["attr_label"] = values["graph"]["attr_label"]


class MoveIndicator(pg.GraphicsObject):
    def __init__(self, x, y, scene_size, parent=None):
        super().__init__(parent)
        self.arrows = [
            pg.ArrowItem(pos=(x - scene_size * 0.07 * np.cos(np.radians(ang)),
                              y + scene_size * 0.07 * np.sin(np.radians(ang))),
                         parent=self, angle=ang,
                         headLen=13, tipAngle=45,
                         brush=pg.mkColor(128, 128, 128))
            for ang in (0, 90, 180, 270)]

    def paint(self, painter, option, widget):
        pass

    def boundingRect(self):
        return QRectF()


if __name__ == "__main__":  # pragma: no cover
    table = Table("zoo")
    WidgetPreview(OWFreeViz).run(set_data=table, set_subset_data=table[::10])

```
--- 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:** Widget Fails to Handle Multiple Target Variables Properly

**Description:**
When the input data contains multiple target variables, the widget does not handle it correctly, resulting in unclear error messages and test failures. This behavior makes it difficult for users to understand the root cause and how to resolve the issue.

**Example Buggy Code:**
```python
heart = Table('heart_disease')
domain = heart.domain

# Transform data to include multiple target variables
two_targets = heart.transform(
    Domain([domain['age']],
           [domain['gender'], domain['chest pain']])
)

# Send the transformed data to the widget
self.send_signal(w.Inputs.data, two_targets)
```

**Expected Behavior:**
The widget should detect that multiple target variables are present and display a clear error message informing the user to select a single target variable using the appropriate tool or widget.

**Actual Behavior:**
An `AttributeError` is raised because the widget's error handling does not recognize multiple target variables. The error message is unclear and does not guide the user on how to fix the issue.

**Error Message:**
```
AttributeError: 'Error' object has no attribute 'multiple_class_vars'
```
[/ISSUE]
{
    "TestOWFreeViz.test_attr_label_metas": "PASSED",
    "TestOWFreeViz.test_attr_models": "PASSED",
    "TestOWFreeViz.test_class_density": "PASSED",
    "TestOWFreeViz.test_constant_data": "PASSED",
    "TestOWFreeViz.test_datasets": "PASSED",
    "TestOWFreeViz.test_default_attrs": "PASSED",
    "TestOWFreeViz.test_discrete_attributes": "PASSED",
    "TestOWFreeViz.test_dragging_tooltip": "PASSED",
    "TestOWFreeViz.test_embedding_missing_values": "PASSED",
    "TestOWFreeViz.test_error_msg": "PASSED",
    "TestOWFreeViz.test_handle_primitive_metas": "PASSED",
    "TestOWFreeViz.test_hidden_effective_variables": "PASSED",
    "TestOWFreeViz.test_image_export": "PASSED",
    "TestOWFreeViz.test_in_out_summary": "PASSED",
    "TestOWFreeViz.test_invalidated_embedding": "PASSED",
    "TestOWFreeViz.test_manual_move": "PASSED",
    "TestOWFreeViz.test_minimum_size": "PASSED",
    "TestOWFreeViz.test_msg_base_class": "PASSED",
    "TestOWFreeViz.test_none_data": "PASSED",
    "TestOWFreeViz.test_number_of_targets": "PASSED",
    "TestOWFreeViz.test_optimization": "PASSED",
    "TestOWFreeViz.test_optimization_cancelled": "PASSED",
    "TestOWFreeViz.test_optimization_finish": "PASSED",
    "TestOWFreeViz.test_optimization_no_data": "PASSED",
    "TestOWFreeViz.test_optimization_reset": "PASSED",
    "TestOWFreeViz.test_output_components": "PASSED",
    "TestOWFreeViz.test_outputs": "PASSED",
    "TestOWFreeViz.test_plot_once": "PASSED",
    "TestOWFreeViz.test_saved_selection": "PASSED",
    "TestOWFreeViz.test_send_report": "PASSED",
    "TestOWFreeViz.test_set_radius_no_data": "PASSED",
    "TestOWFreeViz.test_setup_graph": "PASSED",
    "TestOWFreeViz.test_sparse_data": "PASSED",
    "TestOWFreeViz.test_subset_data_color": "PASSED",
    "TestOWFreeViz.test_visual_settings": "PASSED",
    "TestOWFreeVizRunner.test_Result": "PASSED",
    "TestOWFreeVizRunner.test_run": "PASSED",
    "TestOWFreeVizRunner.test_run_do_not_modify_model_inplace": "PASSED",
    "TestOWBaseLearner.test_converts_sparse_targets_to_dense": "PASSED",
    "TestOWBaseLearner.test_error_on_learning": "PASSED",
    "TestOWBaseLearner.test_invalid_number_of_targets": "PASSED",
    "TestOWBaseLearner.test_old_style_signals_on_subclass_backward_compatibility": "PASSED",
    "TestOWBaseLearner.test_persists_learner_name_in_settings": "PASSED",
    "TestOWBaseLearner.test_send_backward_compatibility": "PASSED",
    "TestOWBaseLearner.test_subclasses_do_not_share_outputs": "PASSED",
    "TestOWBaseLearner.test_summary": "PASSED",
    "WidgetTest.test_image_export": "ERROR",
    "WidgetTest.test_minimum_size": "ERROR",
    "WidgetTest.test_msg_base_class": "ERROR"
}
diff --git a/Orange/widgets/utils/owlearnerwidget.py b/Orange/widgets/utils/owlearnerwidget.py
index d306500c8..881035183 100644
--- a/Orange/widgets/utils/owlearnerwidget.py
+++ b/Orange/widgets/utils/owlearnerwidget.py
@@ -136,8 +136,14 @@ class OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):
         self.set_input_summary()
 
         if data is not None and data.domain.class_var is None:
-            self.Error.data_error("Data has no target variable.\n"
-                                  "You can set a target variable with the Select Columns widget.")
+            if data.domain.class_vars:
+                self.Error.data_error(
+                    "Data contains multiple target variables.\n"
+                    "Select a single one with the Select Columns widget.")
+            else:
+                self.Error.data_error(
+                    "Data has no target variable.\n"
+                    "Select one with the Select Columns widget.")
             self.data = None
 
         self.update_model()
diff --git a/Orange/widgets/visualize/owfreeviz.py b/Orange/widgets/visualize/owfreeviz.py
index 6d0159029..99387114f 100644
--- a/Orange/widgets/visualize/owfreeviz.py
+++ b/Orange/widgets/visualize/owfreeviz.py
@@ -139,14 +139,16 @@ class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):
     graph = settings.SettingProvider(OWFreeVizGraph)
 
     class Error(OWAnchorProjectionWidget.Error):
-        no_class_var = widget.Msg("Data has no target variable")
+        no_class_var = widget.Msg("Data must have a target variable.")
+        multiple_class_vars = widget.Msg(
+            "Data must have a single target variable.")
         not_enough_class_vars = widget.Msg(
-            "Target variable is not at least binary")
+            "Target variable must have at least two unique values.")
         features_exceeds_instances = widget.Msg(
             "Number of features exceeds the number of instances.")
         too_many_data_instances = widget.Msg("Data is too large.")
         constant_data = widget.Msg("All data columns are constant.")
-        not_enough_features = widget.Msg("At least two features are required")
+        not_enough_features = widget.Msg("At least two features are required.")
 
     class Warning(OWAnchorProjectionWidget.Warning):
         removed_features = widget.Msg("Categorical features with more than"
@@ -257,10 +259,12 @@ class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):
 
         super().check_data()
         if self.data is not None:
-            class_var, domain = self.data.domain.class_var, self.data.domain
-            if class_var is None:
+            class_vars, domain = self.data.domain.class_vars, self.data.domain
+            if not class_vars:
                 error(self.Error.no_class_var)
-            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:
+            elif len(class_vars) > 1:
+                error(self.Error.multiple_class_vars)
+            elif class_vars[0].is_discrete and len(np.unique(self.data.Y)) < 2:
                 error(self.Error.not_enough_class_vars)
             elif len(self.data.domain.attributes) < 2:
                 error(self.Error.not_enough_features)

{"Orange/widgets/utils/owlearnerwidget.py": "from copy import deepcopy\n\nfrom AnyQt.QtCore import QTimer, Qt\n\nfrom Orange.data import Table\nfrom Orange.modelling import Fitter, Learner, Model\nfrom Orange.preprocess.preprocess import Preprocess\nfrom Orange.statistics import util as ut\nfrom Orange.widgets import gui\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils import getmembers\nfrom Orange.widgets.utils.signals import Output, Input\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.widget import OWWidget, WidgetMetaClass, Msg\n\n\nclass OWBaseLearnerMeta(WidgetMetaClass):\n    \"\"\" Meta class for learner widgets\n\n    OWBaseLearner declares two outputs, learner and model with\n    generic type (Learner and Model).\n\n    This metaclass ensures that each of the subclasses gets\n    its own Outputs class with output that match the corresponding\n    learner.\n    \"\"\"\n    def __new__(cls, name, bases, attributes, **kwargs):\n        def abstract_widget():\n            return not attributes.get(\"name\")\n\n        def copy_outputs(template):\n            result = type(\"Outputs\", (), {})\n            for name, signal in getmembers(template, Output):\n                setattr(result, name, deepcopy(signal))\n            return result\n\n        obj = super().__new__(cls, name, bases, attributes, **kwargs)\n        if abstract_widget():\n            return obj\n\n        learner = attributes.get(\"LEARNER\")\n        if not learner:\n            raise AttributeError(\n                \"'{}' must declare attribute LEARNER\".format(name))\n\n        outputs = obj.Outputs = copy_outputs(obj.Outputs)\n        outputs.learner.type = learner\n        outputs.model.type = learner.__returns__\n\n        return obj\n\n\nclass OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):\n    \"\"\"Abstract widget for classification/regression learners.\n\n    Notes\n    -----\n    All learner widgets should define learner class LEARNER.\n    LEARNER should have __returns__ attribute.\n\n    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`\n    in case LEARNER has extra parameters.\n\n    \"\"\"\n    LEARNER = None\n    supports_sparse = True\n\n    learner_name = Setting(\"\", schema_only=True)\n    want_main_area = False\n    resizing_enabled = False\n    auto_apply = Setting(True)\n\n    class Error(OWWidget.Error):\n        data_error = Msg(\"{}\")\n        fitting_failed = Msg(\"Fitting failed.\\n{}\")\n        sparse_not_supported = Msg(\"Sparse data is not supported.\")\n        out_of_memory = Msg(\"Out of memory.\")\n\n    class Warning(OWWidget.Warning):\n        outdated_learner = Msg(\"Press Apply to submit changes.\")\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n        preprocessor = Input(\"Preprocessor\", Preprocess)\n\n    class Outputs:\n        learner = Output(\"Learner\", Learner, dynamic=False)\n        model = Output(\"Model\", Model, dynamic=False,\n                       replaces=[\"Classifier\", \"Predictor\"])\n\n    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code\n\n    def __init__(self, preprocessors=None):\n        super().__init__()\n        self.data = None\n        self.valid_data = False\n        self.learner = None\n        self.model = None\n        self.preprocessors = preprocessors\n        self.outdated_settings = False\n\n        self.info.set_input_summary(self.info.NoInput)\n\n        self.setup_layout()\n        QTimer.singleShot(0, getattr(self, \"unconditional_apply\", self.apply))\n\n    def create_learner(self):\n        \"\"\"Creates a learner with current configuration.\n\n        Returns:\n            Learner: an instance of Orange.base.learner subclass.\n        \"\"\"\n        return self.LEARNER(preprocessors=self.preprocessors)\n\n    def get_learner_parameters(self):\n        \"\"\"Creates an `OrderedDict` or a sequence of pairs with current model\n        configuration.\n\n        Returns:\n            OrderedDict or List: (option, value) pairs or dict\n        \"\"\"\n        return []\n\n    @Inputs.preprocessor\n    def set_preprocessor(self, preprocessor):\n        self.preprocessors = preprocessor\n        self.apply()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        \"\"\"Set the input train dataset.\"\"\"\n        self.Error.data_error.clear()\n        self.data = data\n        self.set_input_summary()\n\n        if data is not None and data.domain.class_var is None:\n            self.Error.data_error(\"Data has no target variable.\\n\"\n                                  \"You can set a target variable with the Select Columns widget.\")\n            self.data = None\n\n        self.update_model()\n\n    def set_input_summary(self):\n        summary = len(self.data) if self.data else self.info.NoInput\n        details = format_summary_details(self.data) if self.data else \"\"\n        self.info.set_input_summary(summary, details)\n\n    def apply(self):\n        \"\"\"Applies learner and sends new model.\"\"\"\n        self.update_learner()\n        self.update_model()\n\n    def update_learner(self):\n        self.learner = self.create_learner()\n        if self.learner and issubclass(self.LEARNER, Fitter):\n            self.learner.use_default_preprocessors = True\n        if self.learner is not None:\n            self.learner.name = self.learner_name or self.name\n        self.Outputs.learner.send(self.learner)\n        self.outdated_settings = False\n        self.Warning.outdated_learner.clear()\n\n    def show_fitting_failed(self, exc):\n        \"\"\"Show error when fitting fails.\n            Derived widgets can override this to show more specific messages.\"\"\"\n        self.Error.fitting_failed(str(exc), shown=exc is not None)\n\n    def update_model(self):\n        self.show_fitting_failed(None)\n        self.model = None\n        if self.check_data():\n            try:\n                self.model = self.learner(self.data)\n            except BaseException as exc:\n                self.show_fitting_failed(exc)\n            else:\n                self.model.name = self.learner_name or self.name\n                self.model.instances = self.data\n        self.Outputs.model.send(self.model)\n\n    def check_data(self):\n        self.valid_data = False\n        self.Error.sparse_not_supported.clear()\n        if self.data is not None and self.learner is not None:\n            self.Error.data_error.clear()\n            if not self.learner.check_learner_adequacy(self.data.domain):\n                self.Error.data_error(self.learner.learner_adequacy_err_msg)\n            elif not len(self.data):\n                self.Error.data_error(\"Dataset is empty.\")\n            elif len(ut.unique(self.data.Y)) < 2:\n                self.Error.data_error(\"Data contains a single target value.\")\n            elif self.data.X.size == 0:\n                self.Error.data_error(\"Data has no features to learn from.\")\n            elif self.data.is_sparse() and not self.supports_sparse:\n                self.Error.sparse_not_supported()\n            else:\n                self.valid_data = True\n        return self.valid_data\n\n    def settings_changed(self, *args, **kwargs):\n        self.outdated_settings = True\n        self.Warning.outdated_learner(shown=not self.auto_apply)\n        self.apply()\n\n    def _change_name(self, instance, output):\n        if instance:\n            instance.name = self.learner_name or self.name\n            if self.auto_apply:\n                output.send(instance)\n\n    def learner_name_changed(self):\n        self._change_name(self.learner, self.Outputs.learner)\n        self._change_name(self.model, self.Outputs.model)\n\n    def send_report(self):\n        self.report_items(((\"Name\", self.learner_name or self.name),))\n\n        model_parameters = self.get_learner_parameters()\n        if model_parameters:\n            self.report_items(\"Model parameters\", model_parameters)\n\n        if self.data:\n            self.report_data(\"Data\", self.data)\n\n    # GUI\n    def setup_layout(self):\n        self.add_learner_name_widget()\n        self.add_main_layout()\n        # Options specific to target variable type, if supported\n        if issubclass(self.LEARNER, Fitter):\n            # Only add a classification section if the method is overridden\n            if type(self).add_classification_layout is not \\\n                    OWBaseLearner.add_classification_layout:\n                classification_box = gui.widgetBox(\n                    self.controlArea, 'Classification')\n                self.add_classification_layout(classification_box)\n            # Only add a regression section if the method is overridden\n            if type(self).add_regression_layout is not \\\n                    OWBaseLearner.add_regression_layout:\n                regression_box = gui.widgetBox(self.controlArea, 'Regression')\n                self.add_regression_layout(regression_box)\n        self.add_bottom_buttons()\n\n    def add_main_layout(self):\n        \"\"\"Creates layout with the learner configuration widgets.\n\n        Override this method for laying out any learner-specific parameter controls.\n        See setup_layout() method for execution order.\n        \"\"\"\n        pass\n\n    def add_classification_layout(self, box):\n        \"\"\"Creates layout for classification specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_regression_layout(self, box):\n        \"\"\"Creates layout for regression specific options.\n\n        If a widget outputs a learner dispatcher, sometimes the classification\n        and regression learners require different options.\n        See `setup_layout()` method for execution order.\n        \"\"\"\n        pass\n\n    def add_learner_name_widget(self):\n        self.name_line_edit = gui.lineEdit(\n            self.controlArea, self, 'learner_name', box='Name',\n            placeholderText=self.name,\n            tooltip='The name will identify this model in other widgets',\n            orientation=Qt.Horizontal, callback=self.learner_name_changed)\n\n    def add_bottom_buttons(self):\n        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)\n\n    def send(self, signalName, value, id=None):\n        # A subclass might still use the old syntax to send outputs\n        # defined on this class\n        for _, output in getmembers(self.Outputs, Output):\n            if output.name == signalName or signalName in output.replaces:\n                output.send(value, id=id)\n                return\n\n        super().send(signalName, value, id)\n\n    @classmethod\n    def get_widget_description(cls):\n        # When a subclass defines defines old-style signals, those override\n        # the new-style ones, so we add them manually\n        desc = super().get_widget_description()\n\n        if cls.outputs:\n            desc[\"outputs\"].extend(cls.get_signals(\"outputs\", True))\n        if cls.inputs:\n            desc[\"inputs\"].extend(cls.get_signals(\"inputs\", True))\n        return desc\n", "Orange/widgets/visualize/owfreeviz.py": "# pylint: disable=too-many-ancestors\nfrom enum import IntEnum\nfrom types import SimpleNamespace as namespace\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt, QRectF, QLineF, QPoint\nfrom AnyQt.QtGui import QColor\n\nimport pyqtgraph as pg\n\nfrom Orange.data import Table\nfrom Orange.projection import FreeViz\nfrom Orange.projection.freeviz import FreeVizModel\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.utils.concurrent import ConcurrentWidgetMixin, TaskState\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.utils.component import OWGraphWithAnchors\nfrom Orange.widgets.visualize.utils.plotutils import AnchorItem\nfrom Orange.widgets.visualize.utils.widget import OWAnchorProjectionWidget\n\n\nclass Result(namespace):\n    projector = None  # type: FreeViz\n    projection = None  # type: FreeVizModel\n\n\nMAX_ITERATIONS = 1000\n\n\ndef run_freeviz(data: Table, projector: FreeViz, state: TaskState):\n    res = Result(projector=projector, projection=None)\n    step, steps = 0, MAX_ITERATIONS\n    initial = res.projector.components_.T\n    state.set_status(\"Calculating...\")\n    while True:\n        # Needs a copy because projection should not be modified inplace.\n        # If it is modified inplace, the widget and the thread hold a\n        # reference to the same object. When the thread is interrupted it\n        # is still modifying the object, but the widget receives it\n        # (the modified object) with a delay.\n        res.projection = res.projector(data).copy()\n        anchors = res.projector.components_.T\n        res.projector.initial = anchors\n\n        state.set_partial_result(res)\n        if np.allclose(initial, anchors, rtol=1e-5, atol=1e-4):\n            return res\n        initial = anchors\n\n        step += 1\n        state.set_progress_value(100 * step / steps)\n        if state.is_interruption_requested():\n            return res\n\n\nclass OWFreeVizGraph(OWGraphWithAnchors):\n    hide_radius = settings.Setting(0)\n\n    @property\n    def scaled_radius(self):\n        return self.hide_radius / 100 + 1e-5\n\n    def update_radius(self):\n        self.update_circle()\n        self.update_anchors()\n\n    def set_view_box_range(self):\n        self.view_box.setRange(QRectF(-1.05, -1.05, 2.1, 2.1))\n\n    def closest_draggable_item(self, pos):\n        points, *_ = self.master.get_anchors()\n        if points is None or not len(points):\n            return None\n        mask = np.linalg.norm(points, axis=1) > self.scaled_radius\n        xi, yi = points[mask].T\n        distances = (xi - pos.x()) ** 2 + (yi - pos.y()) ** 2\n        if len(distances) and np.min(distances) < self.DISTANCE_DIFF ** 2:\n            return np.flatnonzero(mask)[np.argmin(distances)]\n        return None\n\n    def update_anchors(self):\n        points, labels = self.master.get_anchors()\n        if points is None:\n            return\n        r = self.scaled_radius\n        if self.anchor_items is None:\n            self.anchor_items = []\n            for point, label in zip(points, labels):\n                anchor = AnchorItem(line=QLineF(0, 0, *point), text=label)\n                anchor.setVisible(np.linalg.norm(point) > r)\n                anchor.setPen(pg.mkPen((100, 100, 100)))\n                anchor.setFont(self.parameter_setter.anchor_font)\n                self.plot_widget.addItem(anchor)\n                self.anchor_items.append(anchor)\n        else:\n            for anchor, point, label in zip(self.anchor_items, points, labels):\n                anchor.setLine(QLineF(0, 0, *point))\n                anchor.setText(label)\n                anchor.setVisible(np.linalg.norm(point) > r)\n                anchor.setFont(self.parameter_setter.anchor_font)\n\n    def update_circle(self):\n        super().update_circle()\n        if self.circle_item is not None:\n            r = self.scaled_radius\n            self.circle_item.setRect(QRectF(-r, -r, 2 * r, 2 * r))\n            pen = pg.mkPen(QColor(Qt.lightGray), width=1, cosmetic=True)\n            self.circle_item.setPen(pen)\n\n    def _add_indicator_item(self, anchor_idx):\n        x, y = self.anchor_items[anchor_idx].get_xy()\n        dx = (self.view_box.childGroup.mapToDevice(QPoint(1, 0)) -\n              self.view_box.childGroup.mapToDevice(QPoint(-1, 0))).x()\n        self.indicator_item = MoveIndicator(x, y, 600 / dx)\n        self.plot_widget.addItem(self.indicator_item)\n\n\nclass InitType(IntEnum):\n    Circular, Random = 0, 1\n\n    @staticmethod\n    def items():\n        return [\"Circular\", \"Random\"]\n\n\nclass OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):\n    MAX_INSTANCES = 10000\n\n    name = \"FreeViz\"\n    description = \"Displays FreeViz projection\"\n    icon = \"icons/Freeviz.svg\"\n    priority = 240\n    keywords = [\"viz\"]\n\n    settings_version = 3\n    initialization = settings.Setting(InitType.Circular)\n    GRAPH_CLASS = OWFreeVizGraph\n    graph = settings.SettingProvider(OWFreeVizGraph)\n\n    class Error(OWAnchorProjectionWidget.Error):\n        no_class_var = widget.Msg(\"Data has no target variable\")\n        not_enough_class_vars = widget.Msg(\n            \"Target variable is not at least binary\")\n        features_exceeds_instances = widget.Msg(\n            \"Number of features exceeds the number of instances.\")\n        too_many_data_instances = widget.Msg(\"Data is too large.\")\n        constant_data = widget.Msg(\"All data columns are constant.\")\n        not_enough_features = widget.Msg(\"At least two features are required\")\n\n    class Warning(OWAnchorProjectionWidget.Warning):\n        removed_features = widget.Msg(\"Categorical features with more than\"\n                                      \" two values are not shown.\")\n\n    def __init__(self):\n        OWAnchorProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n\n    def _add_controls(self):\n        self.__add_controls_start_box()\n        super()._add_controls()\n        self.gui.add_control(\n            self._effects_box, gui.hSlider, \"Hide radius:\", master=self.graph,\n            value=\"hide_radius\", minValue=0, maxValue=100, step=10,\n            createLabel=False, callback=self.__radius_slider_changed\n        )\n\n    def __add_controls_start_box(self):\n        box = gui.vBox(self.controlArea, box=True)\n        gui.comboBox(\n            box, self, \"initialization\", label=\"Initialization:\",\n            items=InitType.items(), orientation=Qt.Horizontal,\n            labelWidth=90, callback=self.__init_combo_changed)\n        self.run_button = gui.button(box, self, \"Start\", self._toggle_run)\n\n    @property\n    def effective_variables(self):\n        return [a for a in self.data.domain.attributes\n                if a.is_continuous or a.is_discrete and len(a.values) == 2]\n\n    def __radius_slider_changed(self):\n        self.graph.update_radius()\n\n    def __init_combo_changed(self):\n        self.Error.proj_error.clear()\n        self.init_projection()\n        self.setup_plot()\n        self.commit()\n        if self.task is not None:\n            self._run()\n\n    def _toggle_run(self):\n        if self.task is not None:\n            self.cancel()\n            self.graph.set_sample_size(None)\n            self.run_button.setText(\"Resume\")\n            self.commit()\n        else:\n            self._run()\n\n    def _run(self):\n        if self.data is None:\n            return\n        self.graph.set_sample_size(self.SAMPLE_SIZE)\n        self.run_button.setText(\"Stop\")\n        self.start(run_freeviz, self.effective_data, self.projector)\n\n    # ConcurrentWidgetMixin\n    def on_partial_result(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.update_coordinates()\n        self.graph.update_density()\n\n    def on_done(self, result: Result):\n        assert isinstance(result.projector, FreeViz)\n        assert isinstance(result.projection, FreeVizModel)\n        self.projector = result.projector\n        self.projection = result.projection\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n        self.commit()\n\n    def on_exception(self, ex: Exception):\n        self.Error.proj_error(ex)\n        self.graph.set_sample_size(None)\n        self.run_button.setText(\"Start\")\n\n    # OWAnchorProjectionWidget\n    def set_data(self, data):\n        super().set_data(data)\n        self.graph.set_sample_size(None)\n        if self._invalidated:\n            self.init_projection()\n\n    def init_projection(self):\n        if self.data is None:\n            return\n        anchors = FreeViz.init_radial(len(self.effective_variables)) \\\n            if self.initialization == InitType.Circular \\\n            else FreeViz.init_random(len(self.effective_variables), 2)\n        self.projector = FreeViz(scale=False, center=False,\n                                 initial=anchors, maxiter=10)\n        data = self.projector.preprocess(self.effective_data)\n        self.projector.domain = data.domain\n        self.projector.components_ = anchors.T\n        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)\n        self.projection.pre_domain = data.domain\n        self.projection.name = self.projector.name\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        super().check_data()\n        if self.data is not None:\n            class_var, domain = self.data.domain.class_var, self.data.domain\n            if class_var is None:\n                error(self.Error.no_class_var)\n            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:\n                error(self.Error.not_enough_class_vars)\n            elif len(self.data.domain.attributes) < 2:\n                error(self.Error.not_enough_features)\n            elif len(self.data.domain.attributes) > self.data.X.shape[0]:\n                error(self.Error.features_exceeds_instances)\n            elif not np.sum(np.std(self.data.X, axis=0)):\n                error(self.Error.constant_data)\n            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:\n                error(self.Error.too_many_data_instances)\n            else:\n                if len(self.effective_variables) < len(domain.attributes):\n                    self.Warning.removed_features()\n\n    def enable_controls(self):\n        super().enable_controls()\n        self.run_button.setEnabled(self.data is not None)\n        self.run_button.setText(\"Start\")\n\n    def get_coordinates_data(self):\n        embedding = self.get_embedding()\n        if embedding is None:\n            return None, None\n        valid_emb = embedding[self.valid_data]\n        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)\n\n    def _manual_move(self, anchor_idx, x, y):\n        self.projector.initial[anchor_idx] = [x, y]\n        super()._manual_move(anchor_idx, x, y)\n\n    def clear(self):\n        super().clear()\n        self.cancel()\n\n    def onDeleteWidget(self):\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, _settings, version):\n        if version < 3:\n            if \"radius\" in _settings:\n                _settings[\"graph\"][\"hide_radius\"] = _settings[\"radius\"]\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]\n\n\nclass MoveIndicator(pg.GraphicsObject):\n    def __init__(self, x, y, scene_size, parent=None):\n        super().__init__(parent)\n        self.arrows = [\n            pg.ArrowItem(pos=(x - scene_size * 0.07 * np.cos(np.radians(ang)),\n                              y + scene_size * 0.07 * np.sin(np.radians(ang))),\n                         parent=self, angle=ang,\n                         headLen=13, tipAngle=45,\n                         brush=pg.mkColor(128, 128, 128))\n            for ang in (0, 90, 180, 270)]\n\n    def paint(self, painter, option, widget):\n        pass\n\n    def boundingRect(self):\n        return QRectF()\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    table = Table(\"zoo\")\n    WidgetPreview(OWFreeViz).run(set_data=table, set_subset_data=table[::10])\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:** Widget Fails to Handle Multiple Target Variables Properly

**Description:**
When the input data contains multiple target variables, the widget does not handle it correctly, resulting in unclear error messages and test failures. This behavior makes it difficult for users to understand the root cause and how to resolve the issue.

**Example Buggy Code:**
```python
heart = Table('heart_disease')
domain = heart.domain

# Transform data to include multiple target variables
two_targets = heart.transform(
    Domain([domain['age']],
           [domain['gender'], domain['chest pain']])
)

# Send the transformed data to the widget
self.send_signal(w.Inputs.data, two_targets)
```

**Expected Behavior:**
The widget should detect that multiple target variables are present and display a clear error message informing the user to select a single target variable using the appropriate tool or widget.

**Actual Behavior:**
An `AttributeError` is raised because the widget's error handling does not recognize multiple target variables. The error message is unclear and does not guide the user on how to fix the issue.

**Error Message:**
```
AttributeError: 'Error' object has no attribute 'multiple_class_vars'
```
[/ISSUE]
--- END ISSUE ---

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

--- BEGIN FILE ---
```
### Orange/widgets/utils/owlearnerwidget.py
from copy import deepcopy

from AnyQt.QtCore import QTimer, Qt

from Orange.data import Table
from Orange.modelling import Fitter, Learner, Model
from Orange.preprocess.preprocess import Preprocess
from Orange.statistics import util as ut
from Orange.widgets import gui
from Orange.widgets.settings import Setting
from Orange.widgets.utils import getmembers
from Orange.widgets.utils.signals import Output, Input
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.utils.state_summary import format_summary_details
from Orange.widgets.widget import OWWidget, WidgetMetaClass, Msg


class OWBaseLearnerMeta(WidgetMetaClass):
    """ Meta class for learner widgets

    OWBaseLearner declares two outputs, learner and model with
    generic type (Learner and Model).

    This metaclass ensures that each of the subclasses gets
    its own Outputs class with output that match the corresponding
    learner.
    """
    def __new__(cls, name, bases, attributes, **kwargs):
        def abstract_widget():
            return not attributes.get("name")

        def copy_outputs(template):
            result = type("Outputs", (), {})
            for name, signal in getmembers(template, Output):
                setattr(result, name, deepcopy(signal))
            return result

        obj = super().__new__(cls, name, bases, attributes, **kwargs)
        if abstract_widget():
            return obj

        learner = attributes.get("LEARNER")
        if not learner:
            raise AttributeError(
                "'{}' must declare attribute LEARNER".format(name))

        outputs = obj.Outputs = copy_outputs(obj.Outputs)
        outputs.learner.type = learner
        outputs.model.type = learner.__returns__

        return obj


class OWBaseLearner(OWWidget, metaclass=OWBaseLearnerMeta, openclass=True):
    """Abstract widget for classification/regression learners.

    Notes
    -----
    All learner widgets should define learner class LEARNER.
    LEARNER should have __returns__ attribute.

    Overwrite `create_learner`, `add_main_layout` and `get_learner_parameters`
    in case LEARNER has extra parameters.

    """
    LEARNER = None
    supports_sparse = True

    learner_name = Setting("", schema_only=True)
    want_main_area = False
    resizing_enabled = False
    auto_apply = Setting(True)

    class Error(OWWidget.Error):
        data_error = Msg("{}")
        fitting_failed = Msg("Fitting failed.\n{}")
        sparse_not_supported = Msg("Sparse data is not supported.")
        out_of_memory = Msg("Out of memory.")

    class Warning(OWWidget.Warning):
        outdated_learner = Msg("Press Apply to submit changes.")

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

    class Outputs:
        learner = Output("Learner", Learner, dynamic=False)
        model = Output("Model", Model, dynamic=False,
                       replaces=["Classifier", "Predictor"])

    OUTPUT_MODEL_NAME = Outputs.model.name  # Attr for backcompat w/ self.send() code

    def __init__(self, preprocessors=None):
        super().__init__()
        self.data = None
        self.valid_data = False
        self.learner = None
        self.model = None
        self.preprocessors = preprocessors
        self.outdated_settings = False

        self.info.set_input_summary(self.info.NoInput)

        self.setup_layout()
        QTimer.singleShot(0, getattr(self, "unconditional_apply", self.apply))

    def create_learner(self):
        """Creates a learner with current configuration.

        Returns:
            Learner: an instance of Orange.base.learner subclass.
        """
        return self.LEARNER(preprocessors=self.preprocessors)

    def get_learner_parameters(self):
        """Creates an `OrderedDict` or a sequence of pairs with current model
        configuration.

        Returns:
            OrderedDict or List: (option, value) pairs or dict
        """
        return []

    @Inputs.preprocessor
    def set_preprocessor(self, preprocessor):
        self.preprocessors = preprocessor
        self.apply()

    @Inputs.data
    @check_sql_input
    def set_data(self, data):
        """Set the input train dataset."""
        self.Error.data_error.clear()
        self.data = data
        self.set_input_summary()

        if data is not None and data.domain.class_var is None:
            self.Error.data_error("Data has no target variable.\n"
                                  "You can set a target variable with the Select Columns widget.")
            self.data = None

        self.update_model()

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

    def apply(self):
        """Applies learner and sends new model."""
        self.update_learner()
        self.update_model()

    def update_learner(self):
        self.learner = self.create_learner()
        if self.learner and issubclass(self.LEARNER, Fitter):
            self.learner.use_default_preprocessors = True
        if self.learner is not None:
            self.learner.name = self.learner_name or self.name
        self.Outputs.learner.send(self.learner)
        self.outdated_settings = False
        self.Warning.outdated_learner.clear()

    def show_fitting_failed(self, exc):
        """Show error when fitting fails.
            Derived widgets can override this to show more specific messages."""
        self.Error.fitting_failed(str(exc), shown=exc is not None)

    def update_model(self):
        self.show_fitting_failed(None)
        self.model = None
        if self.check_data():
            try:
                self.model = self.learner(self.data)
            except BaseException as exc:
                self.show_fitting_failed(exc)
            else:
                self.model.name = self.learner_name or self.name
                self.model.instances = self.data
        self.Outputs.model.send(self.model)

    def check_data(self):
        self.valid_data = False
        self.Error.sparse_not_supported.clear()
        if self.data is not None and self.learner is not None:
            self.Error.data_error.clear()
            if not self.learner.check_learner_adequacy(self.data.domain):
                self.Error.data_error(self.learner.learner_adequacy_err_msg)
            elif not len(self.data):
                self.Error.data_error("Dataset is empty.")
            elif len(ut.unique(self.data.Y)) < 2:
                self.Error.data_error("Data contains a single target value.")
            elif self.data.X.size == 0:
                self.Error.data_error("Data has no features to learn from.")
            elif self.data.is_sparse() and not self.supports_sparse:
                self.Error.sparse_not_supported()
            else:
                self.valid_data = True
        return self.valid_data

    def settings_changed(self, *args, **kwargs):
        self.outdated_settings = True
        self.Warning.outdated_learner(shown=not self.auto_apply)
        self.apply()

    def _change_name(self, instance, output):
        if instance:
            instance.name = self.learner_name or self.name
            if self.auto_apply:
                output.send(instance)

    def learner_name_changed(self):
        self._change_name(self.learner, self.Outputs.learner)
        self._change_name(self.model, self.Outputs.model)

    def send_report(self):
        self.report_items((("Name", self.learner_name or self.name),))

        model_parameters = self.get_learner_parameters()
        if model_parameters:
            self.report_items("Model parameters", model_parameters)

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

    # GUI
    def setup_layout(self):
        self.add_learner_name_widget()
        self.add_main_layout()
        # Options specific to target variable type, if supported
        if issubclass(self.LEARNER, Fitter):
            # Only add a classification section if the method is overridden
            if type(self).add_classification_layout is not \
                    OWBaseLearner.add_classification_layout:
                classification_box = gui.widgetBox(
                    self.controlArea, 'Classification')
                self.add_classification_layout(classification_box)
            # Only add a regression section if the method is overridden
            if type(self).add_regression_layout is not \
                    OWBaseLearner.add_regression_layout:
                regression_box = gui.widgetBox(self.controlArea, 'Regression')
                self.add_regression_layout(regression_box)
        self.add_bottom_buttons()

    def add_main_layout(self):
        """Creates layout with the learner configuration widgets.

        Override this method for laying out any learner-specific parameter controls.
        See setup_layout() method for execution order.
        """
        pass

    def add_classification_layout(self, box):
        """Creates layout for classification specific options.

        If a widget outputs a learner dispatcher, sometimes the classification
        and regression learners require different options.
        See `setup_layout()` method for execution order.
        """
        pass

    def add_regression_layout(self, box):
        """Creates layout for regression specific options.

        If a widget outputs a learner dispatcher, sometimes the classification
        and regression learners require different options.
        See `setup_layout()` method for execution order.
        """
        pass

    def add_learner_name_widget(self):
        self.name_line_edit = gui.lineEdit(
            self.controlArea, self, 'learner_name', box='Name',
            placeholderText=self.name,
            tooltip='The name will identify this model in other widgets',
            orientation=Qt.Horizontal, callback=self.learner_name_changed)

    def add_bottom_buttons(self):
        self.apply_button = gui.auto_apply(self.controlArea, self, commit=self.apply)

    def send(self, signalName, value, id=None):
        # A subclass might still use the old syntax to send outputs
        # defined on this class
        for _, output in getmembers(self.Outputs, Output):
            if output.name == signalName or signalName in output.replaces:
                output.send(value, id=id)
                return

        super().send(signalName, value, id)

    @classmethod
    def get_widget_description(cls):
        # When a subclass defines defines old-style signals, those override
        # the new-style ones, so we add them manually
        desc = super().get_widget_description()

        if cls.outputs:
            desc["outputs"].extend(cls.get_signals("outputs", True))
        if cls.inputs:
            desc["inputs"].extend(cls.get_signals("inputs", True))
        return desc


### Orange/widgets/visualize/owfreeviz.py
# pylint: disable=too-many-ancestors
from enum import IntEnum
from types import SimpleNamespace as namespace

import numpy as np

from AnyQt.QtCore import Qt, QRectF, QLineF, QPoint
from AnyQt.QtGui import QColor

import pyqtgraph as pg

from Orange.data import Table
from Orange.projection import FreeViz
from Orange.projection.freeviz import FreeVizModel
from Orange.widgets import widget, gui, settings
from Orange.widgets.utils.concurrent import ConcurrentWidgetMixin, TaskState
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.visualize.utils.component import OWGraphWithAnchors
from Orange.widgets.visualize.utils.plotutils import AnchorItem
from Orange.widgets.visualize.utils.widget import OWAnchorProjectionWidget


class Result(namespace):
    projector = None  # type: FreeViz
    projection = None  # type: FreeVizModel


MAX_ITERATIONS = 1000


def run_freeviz(data: Table, projector: FreeViz, state: TaskState):
    res = Result(projector=projector, projection=None)
    step, steps = 0, MAX_ITERATIONS
    initial = res.projector.components_.T
    state.set_status("Calculating...")
    while True:
        # Needs a copy because projection should not be modified inplace.
        # If it is modified inplace, the widget and the thread hold a
        # reference to the same object. When the thread is interrupted it
        # is still modifying the object, but the widget receives it
        # (the modified object) with a delay.
        res.projection = res.projector(data).copy()
        anchors = res.projector.components_.T
        res.projector.initial = anchors

        state.set_partial_result(res)
        if np.allclose(initial, anchors, rtol=1e-5, atol=1e-4):
            return res
        initial = anchors

        step += 1
        state.set_progress_value(100 * step / steps)
        if state.is_interruption_requested():
            return res


class OWFreeVizGraph(OWGraphWithAnchors):
    hide_radius = settings.Setting(0)

    @property
    def scaled_radius(self):
        return self.hide_radius / 100 + 1e-5

    def update_radius(self):
        self.update_circle()
        self.update_anchors()

    def set_view_box_range(self):
        self.view_box.setRange(QRectF(-1.05, -1.05, 2.1, 2.1))

    def closest_draggable_item(self, pos):
        points, *_ = self.master.get_anchors()
        if points is None or not len(points):
            return None
        mask = np.linalg.norm(points, axis=1) > self.scaled_radius
        xi, yi = points[mask].T
        distances = (xi - pos.x()) ** 2 + (yi - pos.y()) ** 2
        if len(distances) and np.min(distances) < self.DISTANCE_DIFF ** 2:
            return np.flatnonzero(mask)[np.argmin(distances)]
        return None

    def update_anchors(self):
        points, labels = self.master.get_anchors()
        if points is None:
            return
        r = self.scaled_radius
        if self.anchor_items is None:
            self.anchor_items = []
            for point, label in zip(points, labels):
                anchor = AnchorItem(line=QLineF(0, 0, *point), text=label)
                anchor.setVisible(np.linalg.norm(point) > r)
                anchor.setPen(pg.mkPen((100, 100, 100)))
                anchor.setFont(self.parameter_setter.anchor_font)
                self.plot_widget.addItem(anchor)
                self.anchor_items.append(anchor)
        else:
            for anchor, point, label in zip(self.anchor_items, points, labels):
                anchor.setLine(QLineF(0, 0, *point))
                anchor.setText(label)
                anchor.setVisible(np.linalg.norm(point) > r)
                anchor.setFont(self.parameter_setter.anchor_font)

    def update_circle(self):
        super().update_circle()
        if self.circle_item is not None:
            r = self.scaled_radius
            self.circle_item.setRect(QRectF(-r, -r, 2 * r, 2 * r))
            pen = pg.mkPen(QColor(Qt.lightGray), width=1, cosmetic=True)
            self.circle_item.setPen(pen)

    def _add_indicator_item(self, anchor_idx):
        x, y = self.anchor_items[anchor_idx].get_xy()
        dx = (self.view_box.childGroup.mapToDevice(QPoint(1, 0)) -
              self.view_box.childGroup.mapToDevice(QPoint(-1, 0))).x()
        self.indicator_item = MoveIndicator(x, y, 600 / dx)
        self.plot_widget.addItem(self.indicator_item)


class InitType(IntEnum):
    Circular, Random = 0, 1

    @staticmethod
    def items():
        return ["Circular", "Random"]


class OWFreeViz(OWAnchorProjectionWidget, ConcurrentWidgetMixin):
    MAX_INSTANCES = 10000

    name = "FreeViz"
    description = "Displays FreeViz projection"
    icon = "icons/Freeviz.svg"
    priority = 240
    keywords = ["viz"]

    settings_version = 3
    initialization = settings.Setting(InitType.Circular)
    GRAPH_CLASS = OWFreeVizGraph
    graph = settings.SettingProvider(OWFreeVizGraph)

    class Error(OWAnchorProjectionWidget.Error):
        no_class_var = widget.Msg("Data has no target variable")
        not_enough_class_vars = widget.Msg(
            "Target variable is not at least binary")
        features_exceeds_instances = widget.Msg(
            "Number of features exceeds the number of instances.")
        too_many_data_instances = widget.Msg("Data is too large.")
        constant_data = widget.Msg("All data columns are constant.")
        not_enough_features = widget.Msg("At least two features are required")

    class Warning(OWAnchorProjectionWidget.Warning):
        removed_features = widget.Msg("Categorical features with more than"
                                      " two values are not shown.")

    def __init__(self):
        OWAnchorProjectionWidget.__init__(self)
        ConcurrentWidgetMixin.__init__(self)

    def _add_controls(self):
        self.__add_controls_start_box()
        super()._add_controls()
        self.gui.add_control(
            self._effects_box, gui.hSlider, "Hide radius:", master=self.graph,
            value="hide_radius", minValue=0, maxValue=100, step=10,
            createLabel=False, callback=self.__radius_slider_changed
        )

    def __add_controls_start_box(self):
        box = gui.vBox(self.controlArea, box=True)
        gui.comboBox(
            box, self, "initialization", label="Initialization:",
            items=InitType.items(), orientation=Qt.Horizontal,
            labelWidth=90, callback=self.__init_combo_changed)
        self.run_button = gui.button(box, self, "Start", self._toggle_run)

    @property
    def effective_variables(self):
        return [a for a in self.data.domain.attributes
                if a.is_continuous or a.is_discrete and len(a.values) == 2]

    def __radius_slider_changed(self):
        self.graph.update_radius()

    def __init_combo_changed(self):
        self.Error.proj_error.clear()
        self.init_projection()
        self.setup_plot()
        self.commit()
        if self.task is not None:
            self._run()

    def _toggle_run(self):
        if self.task is not None:
            self.cancel()
            self.graph.set_sample_size(None)
            self.run_button.setText("Resume")
            self.commit()
        else:
            self._run()

    def _run(self):
        if self.data is None:
            return
        self.graph.set_sample_size(self.SAMPLE_SIZE)
        self.run_button.setText("Stop")
        self.start(run_freeviz, self.effective_data, self.projector)

    # ConcurrentWidgetMixin
    def on_partial_result(self, result: Result):
        assert isinstance(result.projector, FreeViz)
        assert isinstance(result.projection, FreeVizModel)
        self.projector = result.projector
        self.projection = result.projection
        self.graph.update_coordinates()
        self.graph.update_density()

    def on_done(self, result: Result):
        assert isinstance(result.projector, FreeViz)
        assert isinstance(result.projection, FreeVizModel)
        self.projector = result.projector
        self.projection = result.projection
        self.graph.set_sample_size(None)
        self.run_button.setText("Start")
        self.commit()

    def on_exception(self, ex: Exception):
        self.Error.proj_error(ex)
        self.graph.set_sample_size(None)
        self.run_button.setText("Start")

    # OWAnchorProjectionWidget
    def set_data(self, data):
        super().set_data(data)
        self.graph.set_sample_size(None)
        if self._invalidated:
            self.init_projection()

    def init_projection(self):
        if self.data is None:
            return
        anchors = FreeViz.init_radial(len(self.effective_variables)) \
            if self.initialization == InitType.Circular \
            else FreeViz.init_random(len(self.effective_variables), 2)
        self.projector = FreeViz(scale=False, center=False,
                                 initial=anchors, maxiter=10)
        data = self.projector.preprocess(self.effective_data)
        self.projector.domain = data.domain
        self.projector.components_ = anchors.T
        self.projection = FreeVizModel(self.projector, self.projector.domain, 2)
        self.projection.pre_domain = data.domain
        self.projection.name = self.projector.name

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

        super().check_data()
        if self.data is not None:
            class_var, domain = self.data.domain.class_var, self.data.domain
            if class_var is None:
                error(self.Error.no_class_var)
            elif class_var.is_discrete and len(np.unique(self.data.Y)) < 2:
                error(self.Error.not_enough_class_vars)
            elif len(self.data.domain.attributes) < 2:
                error(self.Error.not_enough_features)
            elif len(self.data.domain.attributes) > self.data.X.shape[0]:
                error(self.Error.features_exceeds_instances)
            elif not np.sum(np.std(self.data.X, axis=0)):
                error(self.Error.constant_data)
            elif np.sum(np.all(np.isfinite(self.data.X), axis=1)) > self.MAX_INSTANCES:
                error(self.Error.too_many_data_instances)
            else:
                if len(self.effective_variables) < len(domain.attributes):
                    self.Warning.removed_features()

    def enable_controls(self):
        super().enable_controls()
        self.run_button.setEnabled(self.data is not None)
        self.run_button.setText("Start")

    def get_coordinates_data(self):
        embedding = self.get_embedding()
        if embedding is None:
            return None, None
        valid_emb = embedding[self.valid_data]
        return valid_emb.T / (np.max(np.linalg.norm(valid_emb, axis=1)) or 1)

    def _manual_move(self, anchor_idx, x, y):
        self.projector.initial[anchor_idx] = [x, y]
        super()._manual_move(anchor_idx, x, y)

    def clear(self):
        super().clear()
        self.cancel()

    def onDeleteWidget(self):
        self.shutdown()
        super().onDeleteWidget()

    @classmethod
    def migrate_settings(cls, _settings, version):
        if version < 3:
            if "radius" in _settings:
                _settings["graph"]["hide_radius"] = _settings["radius"]

    @classmethod
    def migrate_context(cls, context, version):
        if version < 3:
            values = context.values
            values["attr_color"] = values["graph"]["attr_color"]
            values["attr_size"] = values["graph"]["attr_size"]
            values["attr_shape"] = values["graph"]["attr_shape"]
            values["attr_label"] = values["graph"]["attr_label"]


class MoveIndicator(pg.GraphicsObject):
    def __init__(self, x, y, scene_size, parent=None):
        super().__init__(parent)
        self.arrows = [
            pg.ArrowItem(pos=(x - scene_size * 0.07 * np.cos(np.radians(ang)),
                              y + scene_size * 0.07 * np.sin(np.radians(ang))),
                         parent=self, angle=ang,
                         headLen=13, tipAngle=45,
                         brush=pg.mkColor(128, 128, 128))
            for ang in (0, 90, 180, 270)]

    def paint(self, painter, option, widget):
        pass

    def boundingRect(self):
        return QRectF()


if __name__ == "__main__":  # pragma: no cover
    table = Table("zoo")
    WidgetPreview(OWFreeViz).run(set_data=table, set_subset_data=table[::10])

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