{
    "file_diffs": [
        {
            "old_file_content": "from functools import partial\nfrom types import SimpleNamespace\nfrom typing import NamedTuple, Dict, List\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QSize, QAbstractListModel, QObject, \\\n    QItemSelectionModel\nfrom AnyQt.QtGui import QColor\nfrom AnyQt.QtWidgets import QButtonGroup, QRadioButton, QListView\n\nfrom orangewidget.utils import listview\nfrom orangewidget.utils.itemmodels import SeparatedListDelegate, \\\n    LabelledSeparator\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table\nfrom Orange.preprocess import Continuize as Continuizer\nfrom Orange.preprocess.transformation import Identity, Indicator, Normalizer\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils.itemmodels import DomainModel\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\n\nclass MethodDesc(NamedTuple):\n    id_: int\n    label: str  # Label used for radio button\n    short_desc: str  # Short description for list views\n    tooltip: str  # Tooltip for radio button\n    supports_sparse: bool = True\n\n\nDefaultKey = \"\"\nDefaultId = 99\nBackCompatClass = object()\n\nContinuize = SimpleNamespace(\n    Default=DefaultId,\n    **{v.name: v.value for v in Continuizer.MultinomialTreatment})\n\nDiscreteOptions: Dict[int, MethodDesc] = {\n    method.id_: method\n    for method in (\n        MethodDesc(\n            Continuize.Default, \"Use preset\", \"preset\",\n            \"Treat the variable as defined in preset\"),\n        MethodDesc(\n            Continuize.Leave, \"Keep categorical\", \"keep as is\",\n            \"Keep the variable discrete\"),\n        MethodDesc(\n            Continuize.FirstAsBase, \"First value as base\", \"first as base\",\n            \"One indicator variable for each value except the first\"),\n        MethodDesc(\n            Continuize.FrequentAsBase, \"Most frequent as base\", \"frequent as base\",\n            \"One indicator variable for each value except the most frequent\",\n            False),\n        MethodDesc(\n            Continuize.Indicators, \"One-hot encoding\", \"one-hot\",\n            \"One indicator variable for each value\",\n            False),\n        MethodDesc(\n            Continuize.RemoveMultinomial, \"Remove if more than 2 values\", \"remove if >2\",\n            \"Remove variables with more than two values; indicator otherwise\"),\n        MethodDesc(\n            Continuize.Remove, \"Remove\", \"remove\",\n            \"Remove variable\"),\n        MethodDesc(\n            Continuize.AsOrdinal, \"Treat as ordinal\", \"as ordinal\",\n            \"Each value gets a consecutive number from 0 to number of values - 1\"),\n        MethodDesc(\n            Continuize.AsNormalizedOrdinal, \"Treat as normalized ordinal\", \"as norm. ordinal\",\n            \"Same as above, but scaled to [0, 1]\")\n    )}\n\nContinuizationDefault = Continuize.FirstAsBase\n\n\nNormalize = SimpleNamespace(Default=DefaultId,\n                            Leave=0, Standardize=1, Center=2, Scale=3,\n                            Normalize11=4, Normalize01=5)\n\nContinuousOptions: Dict[int, MethodDesc] = {\n    method.id_: method\n    for method in (\n        MethodDesc(\n            Normalize.Default, \"Use preset\", \"preset\",\n            \"Treat the variable as defined in 'default setting'\"),\n        MethodDesc(\n            Normalize.Leave, \"Keep as it is\", \"no change\",\n            \"Keep the variable as it is\"),\n        MethodDesc(\n            Normalize.Standardize, \"Standardize to μ=0, σ²=1\", \"standardize\",\n            \"Subtract the mean and divide by standard deviation\",\n            False),\n        MethodDesc(\n            Normalize.Center, \"Center to μ=0\", \"center\",\n            \"Subtract the mean\",\n            False),\n        MethodDesc(\n            Normalize.Scale, \"Scale to σ²=1\", \"scale\",\n            \"Divide by standard deviation\"),\n        MethodDesc(\n            Normalize.Normalize11, \"Normalize to interval [-1, 1]\", \"to [-1, 1]\",\n            \"Linear transformation into interval [-1, 1]\",\n            False),\n        MethodDesc(\n            Normalize.Normalize01, \"Normalize to interval [0, 1]\", \"to [0, 1]\",\n            \"Linear transformation into interval [0, 1]\",\n            False),\n    )}\n\nNormalizationDefault = Normalize.Leave\n\n\nclass ContDomainModel(DomainModel):\n    HintRole = next(gui.OrangeUserRole)\n    FilterRole = next(gui.OrangeUserRole)\n    \"\"\"Domain model that adds description of chosen methods\"\"\"\n    def __init__(self, valid_type):\n        super().__init__(\n            order=(DomainModel.ATTRIBUTES,\n                   LabelledSeparator(\"Meta attributes\"), DomainModel.METAS,\n                   LabelledSeparator(\"Targets\"), DomainModel.CLASSES),\n            valid_types=(valid_type, ), strict_type=True)\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.ToolTipRole:\n            return None\n        if role == self.FilterRole:\n            name = super().data(index, Qt.DisplayRole)\n            if not isinstance(name, str):\n                return None\n            hint = index.data(self.HintRole)\n            if hint is None:\n                return name\n            return f\"{name} {hint[0]}\"\n        value = super().data(index, role)\n        if role == Qt.DisplayRole:\n            if isinstance(value, LabelledSeparator):\n                return None\n            return value, *(index.data(self.HintRole) or (\"\", False))\n        return value\n\n\nclass DefaultContModel(QAbstractListModel):\n    \"\"\"A model used for showing \"Default settings\" above the list view\"\"\"\n    icon = None\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        if DefaultContModel.icon is None:\n            DefaultContModel.icon = gui.createAttributePixmap(\n                \"★\", QColor(0, 0, 0, 0), Qt.black)\n        self.method = \"\"\n\n    @staticmethod\n    def rowCount(parent):\n        return 0 if parent.isValid() else 1\n\n    @staticmethod\n    def columnCount(parent):\n        return 0 if parent.isValid() else 1\n\n    def data(self, _, role=Qt.DisplayRole):\n        if role == Qt.DisplayRole:\n            return f\"Preset: {self.method}\"\n        elif role == Qt.DecorationRole:\n            return self.icon\n        elif role == Qt.ToolTipRole:\n            return \"Default for variables without specific settings\"\n        return None\n\n    def setMethod(self, method):\n        self.method = method\n        self.dataChanged.emit(self.index(0, 0), self.index(0, 0))\n\n\nclass ListViewSearch(listview.ListViewSearch):\n    \"\"\"\n    A list view with two components shown above it:\n    - a listview containing a single item representing default settings\n    - a filter for search\n\n    The class is based on listview.ListViewSearch and needs to have the same\n    name in order to override its private method __layout.\n\n    Inherited __init__ calls __layout, so `default_view` must be constructed\n    there. Construction before calling super().__init__ doesn't work because\n    PyQt does not allow it.\n    \"\"\"\n    class Delegate(SeparatedListDelegate):\n        \"\"\"\n        A delegate that shows items (variables) with specific settings in bold\n        \"\"\"\n        def __init__(self, *args, **kwargs):\n            super().__init__(*args, **kwargs)\n            self._default_hints = False\n\n        def initStyleOption(self, option, index):\n            super().initStyleOption(option, index)\n            hint = index.data(ContDomainModel.HintRole)\n            option.font.setBold(hint is not None and hint[1])\n\n        def set_default_hints(self, show):\n            self._default_hints = show\n\n        def displayText(self, value, _):\n            if value is None:\n                return None\n            name, hint, nondefault = value\n            if self._default_hints or nondefault:\n                name += f\": {hint}\"\n            return name\n\n    def __init__(self, *args, **kwargs):\n        self.default_view = None\n        super().__init__(preferred_size=QSize(350, -1), *args, **kwargs)\n        self.setItemDelegate(self.Delegate(self))\n        self.force_hints = False\n\n    def select_default(self):\n        \"\"\"Select the item representing default settings\"\"\"\n        self.default_view.selectionModel().select(\n            self.default_view.model().index(0),\n            QItemSelectionModel.Select)\n\n    def set_default_method(self, method):\n        self.default_view.model().setMethod(method)\n\n    # pylint: disable=unused-private-member\n    def __layout(self):\n        if self.default_view is None:  # __layout was called from __init__\n            view = self.default_view = QListView(self)\n            view.setModel(DefaultContModel())\n            self.filterProxyModel().setFilterRole(ContDomainModel.FilterRole)\n            view.verticalScrollBar().setDisabled(True)\n            view.horizontalScrollBar().setDisabled(True)\n            view.setHorizontalScrollBarPolicy(\n                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)\n            view.setVerticalScrollBarPolicy(\n                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)\n            font = view.font()\n            font.setBold(True)\n            view.setFont(font)\n        else:\n            view = self.default_view\n\n        # Put the list view with default on top\n        margins = self.viewportMargins()\n        def_height = view.sizeHintForRow(0) + 2 * view.spacing() + 2\n        view.setGeometry(0, 0, self.geometry().width(), def_height)\n        view.setFixedHeight(def_height)\n\n        # Then search\n        search = self.__search\n        src_height = search.sizeHint().height()\n        size = self.size()\n        search.setGeometry(0, def_height + 2, size.width(), src_height)\n\n        # Then the real list view\n        margins.setTop(def_height + 2 + src_height)\n        self.setViewportMargins(margins)\n\n    def event(self, ev):\n        if ev.type() == ev.ToolTip:\n            self.itemDelegate().set_default_hints(True)\n            self.viewport().update()\n            return True\n        return super().event(ev)\n\n    def leaveEvent(self, _):\n        self.itemDelegate().set_default_hints(False)\n        self.viewport().update()\n\n\nclass OWContinuize(widget.OWWidget):\n    # Many false positives for `hints`; pylint ignores type annotations\n    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation\n    # pylint: disable=unsupported-membership-test, unsupported-delete-operation\n    name = \"Continuize\"\n    description = (\"Transform categorical attributes into numeric and, \" +\n                   \"optionally, scale numeric values.\")\n    icon = \"icons/Continuize.svg\"\n    category = \"Transform\"\n    keywords = \"continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast\"\n    priority = 2120\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n\n    class Error(widget.OWWidget.Error):\n        unsupported_sparse = \\\n            widget.Msg(\"Some chosen methods do support sparse data: {}\")\n\n    want_control_area = False\n\n    settings_version = 3\n    disc_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: ContinuizationDefault}, schema_only=True)\n    cont_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: NormalizationDefault}, schema_only=True)\n    autosend = Setting(True)\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self._var_cache = {}\n\n        def create(title, vartype, methods):\n            hbox = gui.hBox(box, title)\n            view = ListViewSearch(\n                selectionMode=ListViewSearch.ExtendedSelection,\n                uniformItemSizes=True)\n            view.setModel(ContDomainModel(vartype))\n            view.selectionModel().selectionChanged.connect(\n                lambda: self._on_var_selection_changed(view))\n            view.default_view.selectionModel().selectionChanged.connect(\n                lambda selected: self._on_default_selected(view, selected))\n            hbox.layout().addWidget(view)\n\n            bbox = gui.vBox(hbox)\n            bgroup = QButtonGroup(self)\n            bgroup.idClicked.connect(self._on_radio_clicked)\n            for desc in methods.values():\n                button = QRadioButton(desc.label)\n                button.setToolTip(desc.tooltip)\n                bgroup.addButton(button, desc.id_)\n                bbox.layout().addWidget(button)\n            bbox.layout().addStretch(1)\n            return hbox, view, bbox, bgroup\n\n        box = gui.vBox(self.mainArea, True, spacing=8)\n        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \\\n            create(\"Categorical Variables\", DiscreteVariable, DiscreteOptions)\n        self.disc_view.set_default_method(\n            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)\n        self.disc_view.select_default()\n\n        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \\\n            create(\"Numeric Variables\", ContinuousVariable, ContinuousOptions)\n        self.cont_view.set_default_method(\n            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)\n        self.cont_view.select_default()\n\n        boxes = (self.disc_radios, self.cont_radios)\n        width = max(box.sizeHint().width() for box in boxes)\n        for box in boxes:\n            box.setFixedWidth(width)\n\n        box = gui.hBox(self.mainArea)\n        gui.button(\n            box, self, \"Reset All\", callback=self._on_reset_hints,\n            autoDefault=False)\n        gui.rubber(box)\n        gui.auto_apply(box, self, \"autosend\")\n\n    def _on_var_selection_changed(self, view):\n        if not view.selectionModel().selectedIndexes():\n            # Prevent infinite recursion (with _on_default_selected)\n            return\n        view.default_view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def _on_default_selected(self, view, selected):\n        if not selected:\n            # Prevent infinite recursion (with _var_selection_selected)\n            return\n        view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def selected_vars(self, view) -> List[str]:\n        \"\"\"\n        Return selected variables\n\n        If 'Default settings' are selected, this returns DefaultKey\n        \"\"\"\n        model = view.model()\n        return [model[index.row()]\n                for index in view.selectionModel().selectedRows()]\n\n    def _update_radios(self, view):\n        if view is self.disc_view:\n            group, hints = self.disc_group, self.disc_var_hints\n        else:\n            group, hints = self.cont_group, self.cont_var_hints\n\n        selvars = self.selected_vars(view)\n        if not selvars:\n            self._check_button(group, hints[DefaultKey], True)\n            self._set_radio_enabled(group, DefaultId, False)\n            return\n\n        self._set_radio_enabled(group, DefaultId, True)\n        options = {hints.get(var.name, self.default_for_var(var))\n                   for var in selvars}\n        if len(options) == 1:\n            self._check_button(group, options.pop(), True)\n        else:\n            self._uncheck_all_buttons(group)\n\n    @staticmethod\n    def _uncheck_all_buttons(group: QButtonGroup):\n        button = group.checkedButton()\n        if button is not None:\n            group.setExclusive(False)\n            button.setChecked(False)\n            group.setExclusive(True)\n\n    def _set_radio_enabled(\n            self, group: QButtonGroup, method_id: int, value: bool):\n        if group.button(method_id).isChecked() and not value:\n            self._uncheck_all_buttons(group)\n        group.button(method_id).setEnabled(value)\n\n    @staticmethod\n    def _check_button(group: QButtonGroup, method_id: int, checked: bool):\n        group.button(method_id).setChecked(checked)\n\n    def _on_radio_clicked(self, method_id: int):\n        if QObject().sender() is self.disc_group:\n            view, hints, methods = \\\n                self.disc_view, self.disc_var_hints, DiscreteOptions\n            leave_id = Continuize.Leave\n        else:\n            view, hints, methods = \\\n                self.cont_view, self.cont_var_hints, ContinuousOptions\n            leave_id = Normalize.Leave\n        selvars = self.selected_vars(view)\n        if not selvars:\n            hints[DefaultKey] = method_id\n            view.set_default_method(methods[method_id].short_desc)\n        else:\n            keys = [var.name for var in selvars]\n            indexes = view.selectionModel().selectedIndexes()\n            model = view.model()\n            # These two keys may delete values from dict, hence we must loop\n            if method_id in (DefaultId, leave_id):\n                for key in keys:\n                    # Attributes do not store the hint if it equals Default;\n                    # metas and targets do not store it if it is Leave\n                    if method_id == (DefaultId if self.is_attr(key) else leave_id):\n                        if key in hints:\n                            del hints[key]\n                    else:\n                        hints[key] = method_id\n            else:\n                hints.update(dict.fromkeys(keys, method_id))\n            desc = methods[method_id].short_desc\n            for index, var in zip(indexes, selvars):\n                show = method_id != self.default_for_var(var)\n                model.setData(index, (desc, show), model.HintRole)\n        self.commit.deferred()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.data = data\n        self._var_cache.clear()\n        domain = data.domain if data else None\n        self.disc_view.model().set_domain(domain)\n        self.cont_view.model().set_domain(domain)\n        if data:\n            # Clean up hints only when receiving new data, not on disconnection\n            self._set_hints()\n        self.commit.now()\n\n    def _set_hints(self):\n        assert self.data\n\n        # Backward compatibility for settings < 3\n        class_treatment = self.disc_var_hints.get(BackCompatClass, None)\n        if class_treatment is not None \\\n                and self.data.domain.class_var is not None:\n            self.disc_var_hints[self.data.domain.class_var.name] \\\n                = class_treatment\n\n        for hints, model, options in (\n                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),\n                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):\n            filtered = {DefaultKey: hints[DefaultKey]}\n            for i, var in enumerate(model):\n                if isinstance(var, LabelledSeparator):\n                    continue\n                default = self.default_for_var(var)\n                method_id = hints.get(var.name, default)\n                nondefault = method_id != default\n                if nondefault:\n                    filtered[var.name] = method_id\n                model.setData(\n                    model.index(i, 0),\n                    (options[method_id].short_desc, nondefault),\n                    model.HintRole)\n            hints.clear()\n            hints.update(filtered)\n\n    def _on_reset_hints(self):\n        if not self.data:\n            return\n        self.cont_var_hints.clear()\n        self.disc_var_hints.clear()\n        self.disc_var_hints[DefaultKey] = ContinuizationDefault\n        self.cont_var_hints[DefaultKey] = NormalizationDefault\n        self._set_hints()\n        self.cont_view.set_default_method(\n            ContinuousOptions[ContinuizationDefault].short_desc)\n        self.disc_view.set_default_method(\n            ContinuousOptions[NormalizationDefault].short_desc)\n\n    @gui.deferred\n    def commit(self):\n        self.Outputs.data.send(self._prepare_output())\n\n    def _prepare_output(self):\n        self.Error.unsupported_sparse.clear()\n        if not self.data:\n            return None\n        if unsupp_sparse := self._unsupported_sparse():\n            if len(unsupp_sparse) == 1:\n                self.Error.unsupported_sparse(unsupp_sparse[0])\n            else:\n                self.Error.unsupported_sparse(\"\\n\" + \", \".join(unsupp_sparse))\n            return None\n\n        domain = self.data.domain\n        attrs = self._create_vars(domain.attributes)\n        class_vars = self._create_vars(domain.class_vars)\n        metas = self._create_vars(domain.metas)\n        return self.data.transform(Domain(attrs, class_vars, metas))\n\n    def _unsupported_sparse(self):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        domain = self.data.domain\n        disc = set()\n        cont = set()\n        # At the time of writing, self.data.Y cannot be sparse (setter for\n        # `Y` converts it to dense, as done in\n        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)\n        # Including it here doesn't hurt, though.\n        for part, attrs in ((self.data.X, domain.attributes),\n                            (self.data.Y, domain.class_vars),\n                            (self.data.metas, domain.metas)):\n            if sp.issparse(part):\n                disc |= {self._hint_for_var(var)\n                         for var in attrs\n                         if var.is_discrete}\n                cont |= {self._hint_for_var(var)\n                         for var in attrs\n                         if type(var) is ContinuousVariable}\n        disc &= {method.id_\n                 for method in DiscreteOptions.values()\n                 if not method.supports_sparse}\n        cont &= {method.id_\n                 for method in ContinuousOptions.values()\n                 if not method.supports_sparse}\n\n        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order\n        return [method.label\n                for methods, problems in ((DiscreteOptions, disc),\n                                          (ContinuousOptions, cont))\n                for method in methods.values() if method.id_ in problems]\n\n    def _create_vars(self, part):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        return sum(\n            (self._continuized_vars(var) if var.is_discrete\n             else self._scaled_vars(var) if type(var) is ContinuousVariable\n             else [var]\n             for var in part),\n            start=[])\n\n    def _get(self, var, stat):\n        def most_frequent(col):\n            col = col[np.isfinite(col)].astype(int)\n            counts = np.bincount(col, minlength=len(var.values))\n            return np.argmax(counts)\n\n        funcs = {\"min\": np.nanmin, \"max\": np.nanmax,\n                 \"mean\": np.nanmean, \"std\": np.nanstd,\n                 \"major\": most_frequent}\n        name = var.name\n        cache = self._var_cache.setdefault(name, {})\n        if stat not in cache:\n            cache[stat] = funcs[stat](self.data.get_column(var))\n        return cache[stat]\n\n    def is_attr(self, var):\n        domain = self.data.domain\n        return 0 <= domain.index(var) < len(domain.attributes)\n\n    def default_for_var(self, var):\n        if self.is_attr(var):\n            return DefaultId\n        return Continuize.Leave if var.is_discrete else Normalize.Leave\n\n    def _hint_for_var(self, var):\n        if var.is_discrete:\n            hints, leave_id = self.disc_var_hints, Continuize.Leave\n        else:\n            hints, leave_id = self.cont_var_hints, Normalize.Leave\n\n        # Default for attributes is given by \"default\"\n        if self.is_attr(var):\n            return hints.get(var.name, hints[DefaultKey])\n\n        # For metas and targets, default is Leave\n        # If user changes it to \"Default\", default is used\n        hint = hints.get(var.name, leave_id)\n        if hint == DefaultId:\n            hint = hints[DefaultKey]\n        return hint\n\n    def _scaled_vars(self, var):\n        hint = self._hint_for_var(var)\n        if hint == Normalize.Leave:\n            return [var]\n\n        get = partial(self._get, var)\n        if hint == Normalize.Standardize:\n            off, scale = get(\"mean\"), 1 / (get(\"std\") or 1)\n        elif hint == Normalize.Center:\n            off, scale = get(\"mean\"), 1\n        elif hint == Normalize.Scale:\n            off, scale = 0, 1 / (get(\"std\") or 1)\n        else:\n            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f\"hint={hint}?!\"\n            min_, max_ = get(\"min\"), get(\"max\")\n            span = (max_ - min_) or 1\n            if hint == Normalize.Normalize11:\n                off, scale = (min_ + max_) / 2, 2 / span\n            else:\n                off, scale = min_, 1 / span\n\n        return [ContinuousVariable(\n            var.name,\n            compute_value=Normalizer(var, off, scale))]\n\n    def _continuized_vars(self, var, hint=None):\n        if hint is None:\n            hint = self._hint_for_var(var)\n\n        # Single variable\n        if hint == Continuize.Leave:\n            return [var]\n        if hint == Continuize.Remove:\n            return []\n        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \\\n                hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.RemoveMultinomial:\n            assert len(var.values) > 2\n            return []\n        if hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.AsNormalizedOrdinal:\n            scale = 1 / (len(var.values) - 1 or 1)\n            return [ContinuousVariable(var.name,\n                                       compute_value=Normalizer(var, 0, scale))]\n\n        # Multiple dummy variables\n        if hint == Continuize.FirstAsBase:\n            base = 0\n        elif hint == Continuize.FrequentAsBase:\n            base = self._get(var, \"major\")\n        elif hint == Continuize.Indicators:\n            base = None\n        else:\n            assert False, f\"hint={hint}?!\"\n        return [\n            ContinuousVariable(f\"{var.name}={value}\",\n                               compute_value=Indicator(var, value=i))\n            for i, value in enumerate(var.values)\n            if i != base\n        ]\n\n    def send_report(self):\n        if not self.data:\n            return\n        single_disc = len(self.disc_view.model()) > 0 \\\n                      and len(self.disc_var_hints) == 1 \\\n                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()\n        single_cont = len(self.cont_view.model()) > 0 \\\n                      and len(self.cont_var_hints) == 1 \\\n                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()\n        if single_disc and single_cont:\n            self.report_items(\n                ((\"Categorical variables\", single_disc),\n                 (\"Numeric variables\", single_cont))\n            )\n        else:\n            if single_disc:\n                self.report_paragraph(\"Categorical variables\", single_disc)\n            elif len(self.disc_view.model()) > 0:\n                self.report_items(\n                    \"Categorical variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      DiscreteOptions[id_].label.lower())\n                     for name, id_ in self.disc_var_hints.items()])\n            if single_cont:\n                self.report_paragraph(\"Numeric variables\", single_cont)\n            elif len(self.cont_view.model()) > 0:\n                self.report_items(\n                    \"Numeric variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      ContinuousOptions[id_].label.lower())\n                     for name, id_ in self.cont_var_hints.items()])\n            self.report_paragraph(\"Unlisted\",\n                \"Any unlisted attributes default to preset option, and \"\n                \"unlisted meta attributes and target variables are kept \"\n                \"as they are\")\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 2:\n            cont_treat = settings.pop(\"continuous_treatment\", 0)\n            zero_based = settings.pop(\"zero_based\", True)\n            if cont_treat == 1:\n                if zero_based:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize01\n                else:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize11\n            elif cont_treat == 2:\n                settings[\"continuous_treatment\"] = Normalize.Standardize\n        if version < 3:\n            settings[\"cont_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"continuous_treatment\", Normalize.Leave)}\n            settings[\"disc_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"multinomial_treatment\", Continuize.FirstAsBase)}\n            class_treatment = settings.pop(\"class_treatment\", Continuize.Leave)\n            if class_treatment != Continuize.Leave:\n                settings[\"disc_var_hints\"][BackCompatClass] = class_treatment\n\n\n# Backward compatibility for unpickling settings\nOWContinuize.Normalize = Normalize\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWContinuize).run(Table(\"heart_disease\"))\n",
            "new_file_content": "from functools import partial\nfrom types import SimpleNamespace\nfrom typing import NamedTuple, Dict, List\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QSize, QAbstractListModel, QObject, \\\n    QItemSelectionModel\nfrom AnyQt.QtGui import QColor\nfrom AnyQt.QtWidgets import QButtonGroup, QRadioButton, QListView\n\nfrom orangewidget.utils import listview\nfrom orangewidget.utils.itemmodels import SeparatedListDelegate, \\\n    LabelledSeparator\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table\nfrom Orange.preprocess import Continuize as Continuizer\nfrom Orange.preprocess.transformation import Identity, Indicator, Normalizer\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils.itemmodels import DomainModel\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\n\nclass MethodDesc(NamedTuple):\n    id_: int\n    label: str  # Label used for radio button\n    short_desc: str  # Short description for list views\n    tooltip: str  # Tooltip for radio button\n    supports_sparse: bool = True\n\n\nDefaultKey = \"\"\nDefaultId = 99\nBackCompatClass = object()\n\nContinuize = SimpleNamespace(\n    Default=DefaultId,\n    **{v.name: v.value for v in Continuizer.MultinomialTreatment})\n\nDiscreteOptions: Dict[int, MethodDesc] = {\n    method.id_: method\n    for method in (\n        MethodDesc(\n            Continuize.Default, \"Use preset\", \"preset\",\n            \"Treat the variable as defined in preset\"),\n        MethodDesc(\n            Continuize.Leave, \"Keep categorical\", \"keep as is\",\n            \"Keep the variable discrete\"),\n        MethodDesc(\n            Continuize.FirstAsBase, \"First value as base\", \"first as base\",\n            \"One indicator variable for each value except the first\"),\n        MethodDesc(\n            Continuize.FrequentAsBase, \"Most frequent as base\", \"frequent as base\",\n            \"One indicator variable for each value except the most frequent\",\n            False),\n        MethodDesc(\n            Continuize.Indicators, \"One-hot encoding\", \"one-hot\",\n            \"One indicator variable for each value\",\n            False),\n        MethodDesc(\n            Continuize.RemoveMultinomial, \"Remove if more than 2 values\", \"remove if >2\",\n            \"Remove variables with more than two values; indicator otherwise\"),\n        MethodDesc(\n            Continuize.Remove, \"Remove\", \"remove\",\n            \"Remove variable\"),\n        MethodDesc(\n            Continuize.AsOrdinal, \"Treat as ordinal\", \"as ordinal\",\n            \"Each value gets a consecutive number from 0 to number of values - 1\"),\n        MethodDesc(\n            Continuize.AsNormalizedOrdinal, \"Treat as normalized ordinal\", \"as norm. ordinal\",\n            \"Same as above, but scaled to [0, 1]\")\n    )}\n\nContinuizationDefault = Continuize.FirstAsBase\n\n\nNormalize = SimpleNamespace(Default=DefaultId,\n                            Leave=0, Standardize=1, Center=2, Scale=3,\n                            Normalize11=4, Normalize01=5)\n\nContinuousOptions: Dict[int, MethodDesc] = {\n    method.id_: method\n    for method in (\n        MethodDesc(\n            Normalize.Default, \"Use preset\", \"preset\",\n            \"Treat the variable as defined in 'default setting'\"),\n        MethodDesc(\n            Normalize.Leave, \"Keep as it is\", \"no change\",\n            \"Keep the variable as it is\"),\n        MethodDesc(\n            Normalize.Standardize, \"Standardize to μ=0, σ²=1\", \"standardize\",\n            \"Subtract the mean and divide by standard deviation\",\n            False),\n        MethodDesc(\n            Normalize.Center, \"Center to μ=0\", \"center\",\n            \"Subtract the mean\",\n            False),\n        MethodDesc(\n            Normalize.Scale, \"Scale to σ²=1\", \"scale\",\n            \"Divide by standard deviation\"),\n        MethodDesc(\n            Normalize.Normalize11, \"Normalize to interval [-1, 1]\", \"to [-1, 1]\",\n            \"Linear transformation into interval [-1, 1]\",\n            False),\n        MethodDesc(\n            Normalize.Normalize01, \"Normalize to interval [0, 1]\", \"to [0, 1]\",\n            \"Linear transformation into interval [0, 1]\",\n            False),\n    )}\n\nNormalizationDefault = Normalize.Leave\n\n\nclass ContDomainModel(DomainModel):\n    HintRole = next(gui.OrangeUserRole)\n    FilterRole = next(gui.OrangeUserRole)\n    \"\"\"Domain model that adds description of chosen methods\"\"\"\n    def __init__(self, valid_type):\n        super().__init__(\n            order=(DomainModel.ATTRIBUTES,\n                   LabelledSeparator(\"Meta attributes\"), DomainModel.METAS,\n                   LabelledSeparator(\"Targets\"), DomainModel.CLASSES),\n            valid_types=(valid_type, ), strict_type=True)\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.ToolTipRole:\n            return None\n        if role == self.FilterRole:\n            name = super().data(index, Qt.DisplayRole)\n            if not isinstance(name, str):\n                return None\n            hint = index.data(self.HintRole)\n            if hint is None:\n                return name\n            return f\"{name} {hint[0]}\"\n        value = super().data(index, role)\n        if role == Qt.DisplayRole:\n            if isinstance(value, LabelledSeparator):\n                return None\n            return value, *(index.data(self.HintRole) or (\"\", False))\n        return value\n\n\nclass DefaultContModel(QAbstractListModel):\n    \"\"\"A model used for showing \"Default settings\" above the list view\"\"\"\n    icon = None\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        if DefaultContModel.icon is None:\n            DefaultContModel.icon = gui.createAttributePixmap(\n                \"★\", QColor(0, 0, 0, 0), Qt.black)\n        self.method = \"\"\n\n    @staticmethod\n    def rowCount(parent):\n        return 0 if parent.isValid() else 1\n\n    @staticmethod\n    def columnCount(parent):\n        return 0 if parent.isValid() else 1\n\n    def data(self, _, role=Qt.DisplayRole):\n        if role == Qt.DisplayRole:\n            return f\"Preset: {self.method}\"\n        elif role == Qt.DecorationRole:\n            return self.icon\n        elif role == Qt.ToolTipRole:\n            return \"Default for variables without specific settings\"\n        return None\n\n    def setMethod(self, method):\n        self.method = method\n        self.dataChanged.emit(self.index(0, 0), self.index(0, 0))\n\n\nclass ListViewSearch(listview.ListViewSearch):\n    \"\"\"\n    A list view with two components shown above it:\n    - a listview containing a single item representing default settings\n    - a filter for search\n\n    The class is based on listview.ListViewSearch and needs to have the same\n    name in order to override its private method __layout.\n\n    Inherited __init__ calls __layout, so `default_view` must be constructed\n    there. Construction before calling super().__init__ doesn't work because\n    PyQt does not allow it.\n    \"\"\"\n    class Delegate(SeparatedListDelegate):\n        \"\"\"\n        A delegate that shows items (variables) with specific settings in bold\n        \"\"\"\n        def __init__(self, *args, **kwargs):\n            super().__init__(*args, **kwargs)\n            self._default_hints = False\n\n        def initStyleOption(self, option, index):\n            super().initStyleOption(option, index)\n            hint = index.data(ContDomainModel.HintRole)\n            option.font.setBold(hint is not None and hint[1])\n\n        def set_default_hints(self, show):\n            self._default_hints = show\n\n        def displayText(self, value, _):\n            if value is None:\n                return None\n            name, hint, nondefault = value\n            if self._default_hints or nondefault:\n                name += f\": {hint}\"\n            return name\n\n    def __init__(self, *args, **kwargs):\n        self.default_view = None\n        super().__init__(preferred_size=QSize(350, -1), *args, **kwargs)\n        self.setItemDelegate(self.Delegate(self))\n        self.force_hints = False\n\n    def select_default(self):\n        \"\"\"Select the item representing default settings\"\"\"\n        self.default_view.selectionModel().select(\n            self.default_view.model().index(0),\n            QItemSelectionModel.Select)\n\n    def set_default_method(self, method):\n        self.default_view.model().setMethod(method)\n\n    # pylint: disable=unused-private-member\n    def __layout(self):\n        if self.default_view is None:  # __layout was called from __init__\n            view = self.default_view = QListView(self)\n            view.setModel(DefaultContModel())\n            self.filterProxyModel().setFilterRole(ContDomainModel.FilterRole)\n            view.verticalScrollBar().setDisabled(True)\n            view.horizontalScrollBar().setDisabled(True)\n            view.setHorizontalScrollBarPolicy(\n                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)\n            view.setVerticalScrollBarPolicy(\n                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)\n            font = view.font()\n            font.setBold(True)\n            view.setFont(font)\n        else:\n            view = self.default_view\n\n        # Put the list view with default on top\n        margins = self.viewportMargins()\n        def_height = view.sizeHintForRow(0) + 2 * view.spacing() + 2\n        view.setGeometry(0, 0, self.geometry().width(), def_height)\n        view.setFixedHeight(def_height)\n\n        # Then search\n        search = self.__search\n        src_height = search.sizeHint().height()\n        size = self.size()\n        search.setGeometry(0, def_height + 2, size.width(), src_height)\n\n        # Then the real list view\n        margins.setTop(def_height + 2 + src_height)\n        self.setViewportMargins(margins)\n\n    def event(self, ev):\n        if ev.type() == ev.ToolTip:\n            self.itemDelegate().set_default_hints(True)\n            self.viewport().update()\n            return True\n        return super().event(ev)\n\n    def leaveEvent(self, _):\n        self.itemDelegate().set_default_hints(False)\n        self.viewport().update()\n\n\nclass OWContinuize(widget.OWWidget):\n    # Many false positives for `hints`; pylint ignores type annotations\n    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation\n    # pylint: disable=unsupported-membership-test, unsupported-delete-operation\n    name = \"Continuize\"\n    description = (\"Transform categorical attributes into numeric and, \" +\n                   \"optionally, scale numeric values.\")\n    icon = \"icons/Continuize.svg\"\n    category = \"Transform\"\n    keywords = \"continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast\"\n    priority = 2120\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n\n    class Error(widget.OWWidget.Error):\n        unsupported_sparse = \\\n            widget.Msg(\"Some chosen methods do support sparse data: {}\")\n\n    want_control_area = False\n\n    settings_version = 3\n    disc_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: ContinuizationDefault}, schema_only=True)\n    cont_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: NormalizationDefault}, schema_only=True)\n    autosend = Setting(True)\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self._var_cache = {}\n\n        def create(title, vartype, methods):\n            hbox = gui.hBox(box, title)\n            view = ListViewSearch(\n                selectionMode=ListViewSearch.ExtendedSelection,\n                uniformItemSizes=True)\n            view.setModel(ContDomainModel(vartype))\n            view.selectionModel().selectionChanged.connect(\n                lambda: self._on_var_selection_changed(view))\n            view.default_view.selectionModel().selectionChanged.connect(\n                lambda selected: self._on_default_selected(view, selected))\n            hbox.layout().addWidget(view)\n\n            bbox = gui.vBox(hbox)\n            bgroup = QButtonGroup(self)\n            bgroup.idClicked.connect(self._on_radio_clicked)\n            for desc in methods.values():\n                button = QRadioButton(desc.label)\n                button.setToolTip(desc.tooltip)\n                bgroup.addButton(button, desc.id_)\n                bbox.layout().addWidget(button)\n            bbox.layout().addStretch(1)\n            return hbox, view, bbox, bgroup\n\n        box = gui.vBox(self.mainArea, True, spacing=8)\n        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \\\n            create(\"Categorical Variables\", DiscreteVariable, DiscreteOptions)\n        self.disc_view.set_default_method(\n            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)\n        self.disc_view.select_default()\n\n        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \\\n            create(\"Numeric Variables\", ContinuousVariable, ContinuousOptions)\n        self.cont_view.set_default_method(\n            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)\n        self.cont_view.select_default()\n\n        boxes = (self.disc_radios, self.cont_radios)\n        width = max(box.sizeHint().width() for box in boxes)\n        for box in boxes:\n            box.setFixedWidth(width)\n\n        box = gui.hBox(self.mainArea)\n        gui.button(\n            box, self, \"Reset All\", callback=self._on_reset_hints,\n            autoDefault=False)\n        gui.rubber(box)\n        gui.auto_apply(box, self, \"autosend\")\n\n    def _on_var_selection_changed(self, view):\n        if not view.selectionModel().selectedIndexes():\n            # Prevent infinite recursion (with _on_default_selected)\n            return\n        view.default_view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def _on_default_selected(self, view, selected):\n        if not selected:\n            # Prevent infinite recursion (with _var_selection_selected)\n            return\n        view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def selected_vars(self, view) -> List[str]:\n        \"\"\"\n        Return selected variables\n\n        If 'Default settings' are selected, this returns DefaultKey\n        \"\"\"\n        model = view.model()\n        return [model[index.row()]\n                for index in view.selectionModel().selectedRows()]\n\n    def _update_radios(self, view):\n        if view is self.disc_view:\n            group, hints = self.disc_group, self.disc_var_hints\n        else:\n            group, hints = self.cont_group, self.cont_var_hints\n\n        selvars = self.selected_vars(view)\n        if not selvars:\n            self._check_button(group, hints[DefaultKey], True)\n            self._set_radio_enabled(group, DefaultId, False)\n            return\n\n        self._set_radio_enabled(group, DefaultId, True)\n        options = {hints.get(var.name, self.default_for_var(var))\n                   for var in selvars}\n        if len(options) == 1:\n            self._check_button(group, options.pop(), True)\n        else:\n            self._uncheck_all_buttons(group)\n\n    @staticmethod\n    def _uncheck_all_buttons(group: QButtonGroup):\n        button = group.checkedButton()\n        if button is not None:\n            group.setExclusive(False)\n            button.setChecked(False)\n            group.setExclusive(True)\n\n    def _set_radio_enabled(\n            self, group: QButtonGroup, method_id: int, value: bool):\n        if group.button(method_id).isChecked() and not value:\n            self._uncheck_all_buttons(group)\n        group.button(method_id).setEnabled(value)\n\n    @staticmethod\n    def _check_button(group: QButtonGroup, method_id: int, checked: bool):\n        group.button(method_id).setChecked(checked)\n\n    def _on_radio_clicked(self, method_id: int):\n        if QObject().sender() is self.disc_group:\n            view, hints, methods = \\\n                self.disc_view, self.disc_var_hints, DiscreteOptions\n            leave_id = Continuize.Leave\n        else:\n            view, hints, methods = \\\n                self.cont_view, self.cont_var_hints, ContinuousOptions\n            leave_id = Normalize.Leave\n        selvars = self.selected_vars(view)\n        if not selvars:\n            hints[DefaultKey] = method_id\n            view.set_default_method(methods[method_id].short_desc)\n        else:\n            keys = [var.name for var in selvars]\n            indexes = view.selectionModel().selectedIndexes()\n            model = view.model()\n            # These two keys may delete values from dict, hence we must loop\n            if method_id in (DefaultId, leave_id):\n                for key in keys:\n                    # Attributes do not store the hint if it equals Default;\n                    # metas and targets do not store it if it is Leave\n                    if method_id == (DefaultId if self.is_attr(key) else leave_id):\n                        if key in hints:\n                            del hints[key]\n                    else:\n                        hints[key] = method_id\n            else:\n                hints.update(dict.fromkeys(keys, method_id))\n            desc = methods[method_id].short_desc\n            for index, var in zip(indexes, selvars):\n                show = method_id != self.default_for_var(var)\n                model.setData(index, (desc, show), model.HintRole)\n        self.commit.deferred()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.data = data\n        self._var_cache.clear()\n        domain = data.domain if data else None\n        self.disc_view.model().set_domain(domain)\n        self.cont_view.model().set_domain(domain)\n        if data:\n            # Clean up hints only when receiving new data, not on disconnection\n            self._set_hints()\n        self.commit.now()\n\n    def _set_hints(self):\n        assert self.data\n\n        # Backward compatibility for settings < 3\n        class_treatment = self.disc_var_hints.get(BackCompatClass, None)\n        if class_treatment is not None \\\n                and self.data.domain.class_var is not None:\n            self.disc_var_hints[self.data.domain.class_var.name] \\\n                = class_treatment\n\n        for hints, model, options in (\n                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),\n                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):\n            filtered = {DefaultKey: hints[DefaultKey]}\n            for i, var in enumerate(model):\n                if isinstance(var, LabelledSeparator):\n                    continue\n                default = self.default_for_var(var)\n                method_id = hints.get(var.name, default)\n                nondefault = method_id != default\n                if nondefault:\n                    filtered[var.name] = method_id\n                model.setData(\n                    model.index(i, 0),\n                    (options[method_id].short_desc, nondefault),\n                    model.HintRole)\n            hints.clear()\n            hints.update(filtered)\n\n    def _on_reset_hints(self):\n        if not self.data:\n            return\n        self.cont_var_hints.clear()\n        self.disc_var_hints.clear()\n        self.disc_var_hints[DefaultKey] = ContinuizationDefault\n        self.cont_var_hints[DefaultKey] = NormalizationDefault\n        self._set_hints()\n        self.cont_view.set_default_method(\n            ContinuousOptions[ContinuizationDefault].short_desc)\n        self.disc_view.set_default_method(\n            ContinuousOptions[NormalizationDefault].short_desc)\n\n    @gui.deferred\n    def commit(self):\n        self.Outputs.data.send(self._prepare_output())\n\n    def _prepare_output(self):\n        self.Error.unsupported_sparse.clear()\n        if not self.data:\n            return None\n        if unsupp_sparse := self._unsupported_sparse():\n            if len(unsupp_sparse) == 1:\n                self.Error.unsupported_sparse(unsupp_sparse[0])\n            else:\n                self.Error.unsupported_sparse(\"\\n\" + \", \".join(unsupp_sparse))\n            return None\n\n        domain = self.data.domain\n        attrs = self._create_vars(domain.attributes)\n        class_vars = self._create_vars(domain.class_vars)\n        metas = self._create_vars(domain.metas)\n        return self.data.transform(Domain(attrs, class_vars, metas))\n\n    def _unsupported_sparse(self):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        domain = self.data.domain\n        disc = set()\n        cont = set()\n        # At the time of writing, self.data.Y cannot be sparse (setter for\n        # `Y` converts it to dense, as done in\n        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)\n        # Including it here doesn't hurt, though.\n        for part, attrs in ((self.data.X, domain.attributes),\n                            (self.data.Y, domain.class_vars),\n                            (self.data.metas, domain.metas)):\n            if sp.issparse(part):\n                disc |= {self._hint_for_var(var)\n                         for var in attrs\n                         if var.is_discrete}\n                cont |= {self._hint_for_var(var)\n                         for var in attrs\n                         if type(var) is ContinuousVariable}\n        disc &= {method.id_\n                 for method in DiscreteOptions.values()\n                 if not method.supports_sparse}\n        cont &= {method.id_\n                 for method in ContinuousOptions.values()\n                 if not method.supports_sparse}\n\n        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order\n        return [method.label\n                for methods, problems in ((DiscreteOptions, disc),\n                                          (ContinuousOptions, cont))\n                for method in methods.values() if method.id_ in problems]\n\n    def _create_vars(self, part):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        return sum(\n            (self._continuized_vars(var) if var.is_discrete\n             else self._scaled_vars(var) if type(var) is ContinuousVariable\n             else [var]\n             for var in part),\n            start=[])\n\n    def _get(self, var, stat):\n        def most_frequent(col):\n            col = col[np.isfinite(col)].astype(int)\n            counts = np.bincount(col, minlength=len(var.values))\n            return np.argmax(counts)\n\n        funcs = {\"min\": np.nanmin, \"max\": np.nanmax,\n                 \"mean\": np.nanmean, \"std\": np.nanstd,\n                 \"major\": most_frequent}\n        name = var.name\n        cache = self._var_cache.setdefault(name, {})\n        if stat not in cache:\n            cache[stat] = funcs[stat](self.data.get_column(var))\n        return cache[stat]\n\n    def is_attr(self, var):\n        domain = self.data.domain\n        return 0 <= domain.index(var) < len(domain.attributes)\n\n    def default_for_var(self, var):\n        if self.is_attr(var):\n            return DefaultId\n        return Continuize.Leave if var.is_discrete else Normalize.Leave\n\n    def _hint_for_var(self, var):\n        if var.is_discrete:\n            hints, leave_id = self.disc_var_hints, Continuize.Leave\n        else:\n            hints, leave_id = self.cont_var_hints, Normalize.Leave\n\n        # Default for attributes is given by \"default\"\n        if self.is_attr(var):\n            return hints.get(var.name, hints[DefaultKey])\n\n        # For metas and targets, default is Leave\n        # If user changes it to \"Default\", default is used\n        hint = hints.get(var.name, leave_id)\n        if hint == DefaultId:\n            hint = hints[DefaultKey]\n        return hint\n\n    def _scaled_vars(self, var):\n        hint = self._hint_for_var(var)\n        if hint == Normalize.Leave:\n            return [var]\n\n        get = partial(self._get, var)\n        if hint == Normalize.Standardize:\n            off, scale = get(\"mean\"), 1 / (get(\"std\") or 1)\n        elif hint == Normalize.Center:\n            off, scale = get(\"mean\"), 1\n        elif hint == Normalize.Scale:\n            off, scale = 0, 1 / (get(\"std\") or 1)\n        else:\n            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f\"hint={hint}?!\"\n            min_, max_ = get(\"min\"), get(\"max\")\n            span = (max_ - min_) or 1\n            if hint == Normalize.Normalize11:\n                off, scale = (min_ + max_) / 2, 2 / span\n            else:\n                off, scale = min_, 1 / span\n\n        return [ContinuousVariable(\n            var.name,\n            compute_value=Normalizer(var, off, scale))]\n\n    def _continuized_vars(self, var, hint=None):\n        if hint is None:\n            hint = self._hint_for_var(var)\n\n        # Single variable\n        if hint == Continuize.Leave:\n            return [var]\n        if hint == Continuize.Remove:\n            return []\n        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \\\n                hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.RemoveMultinomial:\n            assert len(var.values) > 2\n            return []\n        if hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.AsNormalizedOrdinal:\n            scale = 1 / (len(var.values) - 1 or 1)\n            return [ContinuousVariable(var.name,\n                                       compute_value=Normalizer(var, 0, scale))]\n\n        # Multiple dummy variables\n        if hint == Continuize.FirstAsBase:\n            base = 0\n        elif hint == Continuize.FrequentAsBase:\n            base = self._get(var, \"major\")\n        elif hint == Continuize.Indicators:\n            base = None\n        else:\n            assert False, f\"hint={hint}?!\"\n        return [\n            ContinuousVariable(f\"{var.name}={value}\",\n                               compute_value=Indicator(var, value=i))\n            for i, value in enumerate(var.values)\n            if i != base\n        ]\n\n    def send_report(self):\n        if not self.data:\n            return\n        single_disc = len(self.disc_view.model()) > 0 \\\n                      and len(self.disc_var_hints) == 1 \\\n                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()\n        single_cont = len(self.cont_view.model()) > 0 \\\n                      and len(self.cont_var_hints) == 1 \\\n                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()\n        if single_disc and single_cont:\n            self.report_items(\n                ((\"Categorical variables\", single_disc),\n                 (\"Numeric variables\", single_cont))\n            )\n        else:\n            if single_disc:\n                self.report_paragraph(\"Categorical variables\", single_disc)\n            elif len(self.disc_view.model()) > 0:\n                self.report_items(\n                    \"Categorical variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      DiscreteOptions[id_].label.lower())\n                     for name, id_ in self.disc_var_hints.items()])\n            if single_cont:\n                self.report_paragraph(\"Numeric variables\", single_cont)\n            elif len(self.cont_view.model()) > 0:\n                self.report_items(\n                    \"Numeric variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      ContinuousOptions[id_].label.lower())\n                     for name, id_ in self.cont_var_hints.items()])\n            self.report_paragraph(\"Unlisted\",\n                \"Any unlisted attributes default to preset option, and \"\n                \"unlisted meta attributes and target variables are kept \"\n                \"as they are\")\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 2:\n            cont_treat = settings.pop(\"continuous_treatment\", 0)\n            zero_based = settings.pop(\"zero_based\", True)\n            if cont_treat == 1:\n                if zero_based:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize01\n                else:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize11\n            elif cont_treat == 2:\n                settings[\"continuous_treatment\"] = Normalize.Standardize\n        if version < 3:\n            settings[\"cont_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"continuous_treatment\", Normalize.Leave)}\n\n            # DISC OPS: Default=99, Indicators=1, FirstAsBase=2, FrequentAsBase=3, Remove=4,\n            # RemoveMultinomial=5, ReportError=6, AsOrdinal=7, AsNormalizedOrdinal=8, Leave=9\n\n            # OLD ORDER: [FirstAsBase, FrequentAsBase, Indicators, RemoveMultinomial, Remove,\n            # AsOrdinal, AsNormalizedOrdinal]\n            old_to_new = [2, 3, 1, 5, 4, 7, 8]\n\n            settings[\"disc_var_hints\"] = \\\n                {DefaultKey:\n                 old_to_new[settings.pop(\"multinomial_treatment\", 0)]}\n\n            # OLD ORDER: [Leave, AsOrdinal, AsNormalizedOrdinal, Indicators]\n            old_to_new = [9, 7, 8, 1]\n\n            class_treatment = old_to_new[settings.pop(\"class_treatment\", 0)]\n            if class_treatment != Continuize.Leave:\n                settings[\"disc_var_hints\"][BackCompatClass] = class_treatment\n\n\n# Backward compatibility for unpickling settings\nOWContinuize.Normalize = Normalize\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWContinuize).run(Table(\"heart_disease\"))\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/owcontinuize.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "123f238f3",
                "new_commit_hash": "806ae11c0",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/owcontinuize.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/owcontinuize.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 732,
                            "length": 10
                        },
                        "new_range": {
                            "start": 732,
                            "length": 22
                        },
                        "section": "class OWContinuize(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            settings[\"cont_var_hints\"] = \\",
                                "type": "context"
                            },
                            {
                                "content": "                {DefaultKey:",
                                "type": "context"
                            },
                            {
                                "content": "                 settings.pop(\"continuous_treatment\", Normalize.Leave)}",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "            # DISC OPS: Default=99, Indicators=1, FirstAsBase=2, FrequentAsBase=3, Remove=4,",
                                "type": "added"
                            },
                            {
                                "content": "            # RemoveMultinomial=5, ReportError=6, AsOrdinal=7, AsNormalizedOrdinal=8, Leave=9",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "            # OLD ORDER: [FirstAsBase, FrequentAsBase, Indicators, RemoveMultinomial, Remove,",
                                "type": "added"
                            },
                            {
                                "content": "            # AsOrdinal, AsNormalizedOrdinal]",
                                "type": "added"
                            },
                            {
                                "content": "            old_to_new = [2, 3, 1, 5, 4, 7, 8]",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "            settings[\"disc_var_hints\"] = \\",
                                "type": "context"
                            },
                            {
                                "content": "                {DefaultKey:",
                                "type": "context"
                            },
                            {
                                "content": "                 settings.pop(\"multinomial_treatment\", Continuize.FirstAsBase)}",
                                "type": "deleted"
                            },
                            {
                                "content": "            class_treatment = settings.pop(\"class_treatment\", Continuize.Leave)",
                                "type": "deleted"
                            },
                            {
                                "content": "                 old_to_new[settings.pop(\"multinomial_treatment\", 0)]}",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "            # OLD ORDER: [Leave, AsOrdinal, AsNormalizedOrdinal, Indicators]",
                                "type": "added"
                            },
                            {
                                "content": "            old_to_new = [9, 7, 8, 1]",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "            class_treatment = old_to_new[settings.pop(\"class_treatment\", 0)]",
                                "type": "added"
                            },
                            {
                                "content": "            if class_treatment != Continuize.Leave:",
                                "type": "context"
                            },
                            {
                                "content": "                settings[\"disc_var_hints\"][BackCompatClass] = class_treatment",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owcontinuize.py",
                            "type": "method",
                            "name": "OWContinuize.migrate_settings",
                            "content": "class OWContinuize(widget.OWWidget):\n    # Many false positives for `hints`; pylint ignores type annotations\n    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation\n    # pylint: disable=unsupported-membership-test, unsupported-delete-operation\n    name = \"Continuize\"\n    description = (\"Transform categorical attributes into numeric and, \" +\n                   \"optionally, scale numeric values.\")\n    icon = \"icons/Continuize.svg\"\n    category = \"Transform\"\n    keywords = \"continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast\"\n    priority = 2120\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n\n    class Error(widget.OWWidget.Error):\n        unsupported_sparse = \\\n            widget.Msg(\"Some chosen methods do support sparse data: {}\")\n\n    want_control_area = False\n\n    settings_version = 3\n    disc_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: ContinuizationDefault}, schema_only=True)\n    cont_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: NormalizationDefault}, schema_only=True)\n    autosend = Setting(True)\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self._var_cache = {}\n\n        def create(title, vartype, methods):\n            hbox = gui.hBox(box, title)\n            view = ListViewSearch(\n                selectionMode=ListViewSearch.ExtendedSelection,\n                uniformItemSizes=True)\n            view.setModel(ContDomainModel(vartype))\n            view.selectionModel().selectionChanged.connect(\n                lambda: self._on_var_selection_changed(view))\n            view.default_view.selectionModel().selectionChanged.connect(\n                lambda selected: self._on_default_selected(view, selected))\n            hbox.layout().addWidget(view)\n\n            bbox = gui.vBox(hbox)\n            bgroup = QButtonGroup(self)\n            bgroup.idClicked.connect(self._on_radio_clicked)\n            for desc in methods.values():\n                button = QRadioButton(desc.label)\n                button.setToolTip(desc.tooltip)\n                bgroup.addButton(button, desc.id_)\n                bbox.layout().addWidget(button)\n            bbox.layout().addStretch(1)\n            return hbox, view, bbox, bgroup\n\n        box = gui.vBox(self.mainArea, True, spacing=8)\n        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \\\n            create(\"Categorical Variables\", DiscreteVariable, DiscreteOptions)\n        self.disc_view.set_default_method(\n            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)\n        self.disc_view.select_default()\n\n        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \\\n            create(\"Numeric Variables\", ContinuousVariable, ContinuousOptions)\n        self.cont_view.set_default_method(\n            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)\n        self.cont_view.select_default()\n\n        boxes = (self.disc_radios, self.cont_radios)\n        width = max(box.sizeHint().width() for box in boxes)\n        for box in boxes:\n            box.setFixedWidth(width)\n\n        box = gui.hBox(self.mainArea)\n        gui.button(\n            box, self, \"Reset All\", callback=self._on_reset_hints,\n            autoDefault=False)\n        gui.rubber(box)\n        gui.auto_apply(box, self, \"autosend\")\n\n    def _on_var_selection_changed(self, view):\n        if not view.selectionModel().selectedIndexes():\n            # Prevent infinite recursion (with _on_default_selected)\n            return\n        view.default_view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def _on_default_selected(self, view, selected):\n        if not selected:\n            # Prevent infinite recursion (with _var_selection_selected)\n            return\n        view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def selected_vars(self, view) -> List[str]:\n        \"\"\"\n        Return selected variables\n\n        If 'Default settings' are selected, this returns DefaultKey\n        \"\"\"\n        model = view.model()\n        return [model[index.row()]\n                for index in view.selectionModel().selectedRows()]\n\n    def _update_radios(self, view):\n        if view is self.disc_view:\n            group, hints = self.disc_group, self.disc_var_hints\n        else:\n            group, hints = self.cont_group, self.cont_var_hints\n\n        selvars = self.selected_vars(view)\n        if not selvars:\n            self._check_button(group, hints[DefaultKey], True)\n            self._set_radio_enabled(group, DefaultId, False)\n            return\n\n        self._set_radio_enabled(group, DefaultId, True)\n        options = {hints.get(var.name, self.default_for_var(var))\n                   for var in selvars}\n        if len(options) == 1:\n            self._check_button(group, options.pop(), True)\n        else:\n            self._uncheck_all_buttons(group)\n\n    @staticmethod\n    def _uncheck_all_buttons(group: QButtonGroup):\n        button = group.checkedButton()\n        if button is not None:\n            group.setExclusive(False)\n            button.setChecked(False)\n            group.setExclusive(True)\n\n    def _set_radio_enabled(\n            self, group: QButtonGroup, method_id: int, value: bool):\n        if group.button(method_id).isChecked() and not value:\n            self._uncheck_all_buttons(group)\n        group.button(method_id).setEnabled(value)\n\n    @staticmethod\n    def _check_button(group: QButtonGroup, method_id: int, checked: bool):\n        group.button(method_id).setChecked(checked)\n\n    def _on_radio_clicked(self, method_id: int):\n        if QObject().sender() is self.disc_group:\n            view, hints, methods = \\\n                self.disc_view, self.disc_var_hints, DiscreteOptions\n            leave_id = Continuize.Leave\n        else:\n            view, hints, methods = \\\n                self.cont_view, self.cont_var_hints, ContinuousOptions\n            leave_id = Normalize.Leave\n        selvars = self.selected_vars(view)\n        if not selvars:\n            hints[DefaultKey] = method_id\n            view.set_default_method(methods[method_id].short_desc)\n        else:\n            keys = [var.name for var in selvars]\n            indexes = view.selectionModel().selectedIndexes()\n            model = view.model()\n            # These two keys may delete values from dict, hence we must loop\n            if method_id in (DefaultId, leave_id):\n                for key in keys:\n                    # Attributes do not store the hint if it equals Default;\n                    # metas and targets do not store it if it is Leave\n                    if method_id == (DefaultId if self.is_attr(key) else leave_id):\n                        if key in hints:\n                            del hints[key]\n                    else:\n                        hints[key] = method_id\n            else:\n                hints.update(dict.fromkeys(keys, method_id))\n            desc = methods[method_id].short_desc\n            for index, var in zip(indexes, selvars):\n                show = method_id != self.default_for_var(var)\n                model.setData(index, (desc, show), model.HintRole)\n        self.commit.deferred()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.data = data\n        self._var_cache.clear()\n        domain = data.domain if data else None\n        self.disc_view.model().set_domain(domain)\n        self.cont_view.model().set_domain(domain)\n        if data:\n            # Clean up hints only when receiving new data, not on disconnection\n            self._set_hints()\n        self.commit.now()\n\n    def _set_hints(self):\n        assert self.data\n\n        # Backward compatibility for settings < 3\n        class_treatment = self.disc_var_hints.get(BackCompatClass, None)\n        if class_treatment is not None \\\n                and self.data.domain.class_var is not None:\n            self.disc_var_hints[self.data.domain.class_var.name] \\\n                = class_treatment\n\n        for hints, model, options in (\n                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),\n                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):\n            filtered = {DefaultKey: hints[DefaultKey]}\n            for i, var in enumerate(model):\n                if isinstance(var, LabelledSeparator):\n                    continue\n                default = self.default_for_var(var)\n                method_id = hints.get(var.name, default)\n                nondefault = method_id != default\n                if nondefault:\n                    filtered[var.name] = method_id\n                model.setData(\n                    model.index(i, 0),\n                    (options[method_id].short_desc, nondefault),\n                    model.HintRole)\n            hints.clear()\n            hints.update(filtered)\n\n    def _on_reset_hints(self):\n        if not self.data:\n            return\n        self.cont_var_hints.clear()\n        self.disc_var_hints.clear()\n        self.disc_var_hints[DefaultKey] = ContinuizationDefault\n        self.cont_var_hints[DefaultKey] = NormalizationDefault\n        self._set_hints()\n        self.cont_view.set_default_method(\n            ContinuousOptions[ContinuizationDefault].short_desc)\n        self.disc_view.set_default_method(\n            ContinuousOptions[NormalizationDefault].short_desc)\n\n    @gui.deferred\n    def commit(self):\n        self.Outputs.data.send(self._prepare_output())\n\n    def _prepare_output(self):\n        self.Error.unsupported_sparse.clear()\n        if not self.data:\n            return None\n        if unsupp_sparse := self._unsupported_sparse():\n            if len(unsupp_sparse) == 1:\n                self.Error.unsupported_sparse(unsupp_sparse[0])\n            else:\n                self.Error.unsupported_sparse(\"\\n\" + \", \".join(unsupp_sparse))\n            return None\n\n        domain = self.data.domain\n        attrs = self._create_vars(domain.attributes)\n        class_vars = self._create_vars(domain.class_vars)\n        metas = self._create_vars(domain.metas)\n        return self.data.transform(Domain(attrs, class_vars, metas))\n\n    def _unsupported_sparse(self):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        domain = self.data.domain\n        disc = set()\n        cont = set()\n        # At the time of writing, self.data.Y cannot be sparse (setter for\n        # `Y` converts it to dense, as done in\n        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)\n        # Including it here doesn't hurt, though.\n        for part, attrs in ((self.data.X, domain.attributes),\n                            (self.data.Y, domain.class_vars),\n                            (self.data.metas, domain.metas)):\n            if sp.issparse(part):\n                disc |= {self._hint_for_var(var)\n                         for var in attrs\n                         if var.is_discrete}\n                cont |= {self._hint_for_var(var)\n                         for var in attrs\n                         if type(var) is ContinuousVariable}\n        disc &= {method.id_\n                 for method in DiscreteOptions.values()\n                 if not method.supports_sparse}\n        cont &= {method.id_\n                 for method in ContinuousOptions.values()\n                 if not method.supports_sparse}\n\n        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order\n        return [method.label\n                for methods, problems in ((DiscreteOptions, disc),\n                                          (ContinuousOptions, cont))\n                for method in methods.values() if method.id_ in problems]\n\n    def _create_vars(self, part):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        return sum(\n            (self._continuized_vars(var) if var.is_discrete\n             else self._scaled_vars(var) if type(var) is ContinuousVariable\n             else [var]\n             for var in part),\n            start=[])\n\n    def _get(self, var, stat):\n        def most_frequent(col):\n            col = col[np.isfinite(col)].astype(int)\n            counts = np.bincount(col, minlength=len(var.values))\n            return np.argmax(counts)\n\n        funcs = {\"min\": np.nanmin, \"max\": np.nanmax,\n                 \"mean\": np.nanmean, \"std\": np.nanstd,\n                 \"major\": most_frequent}\n        name = var.name\n        cache = self._var_cache.setdefault(name, {})\n        if stat not in cache:\n            cache[stat] = funcs[stat](self.data.get_column(var))\n        return cache[stat]\n\n    def is_attr(self, var):\n        domain = self.data.domain\n        return 0 <= domain.index(var) < len(domain.attributes)\n\n    def default_for_var(self, var):\n        if self.is_attr(var):\n            return DefaultId\n        return Continuize.Leave if var.is_discrete else Normalize.Leave\n\n    def _hint_for_var(self, var):\n        if var.is_discrete:\n            hints, leave_id = self.disc_var_hints, Continuize.Leave\n        else:\n            hints, leave_id = self.cont_var_hints, Normalize.Leave\n\n        # Default for attributes is given by \"default\"\n        if self.is_attr(var):\n            return hints.get(var.name, hints[DefaultKey])\n\n        # For metas and targets, default is Leave\n        # If user changes it to \"Default\", default is used\n        hint = hints.get(var.name, leave_id)\n        if hint == DefaultId:\n            hint = hints[DefaultKey]\n        return hint\n\n    def _scaled_vars(self, var):\n        hint = self._hint_for_var(var)\n        if hint == Normalize.Leave:\n            return [var]\n\n        get = partial(self._get, var)\n        if hint == Normalize.Standardize:\n            off, scale = get(\"mean\"), 1 / (get(\"std\") or 1)\n        elif hint == Normalize.Center:\n            off, scale = get(\"mean\"), 1\n        elif hint == Normalize.Scale:\n            off, scale = 0, 1 / (get(\"std\") or 1)\n        else:\n            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f\"hint={hint}?!\"\n            min_, max_ = get(\"min\"), get(\"max\")\n            span = (max_ - min_) or 1\n            if hint == Normalize.Normalize11:\n                off, scale = (min_ + max_) / 2, 2 / span\n            else:\n                off, scale = min_, 1 / span\n\n        return [ContinuousVariable(\n            var.name,\n            compute_value=Normalizer(var, off, scale))]\n\n    def _continuized_vars(self, var, hint=None):\n        if hint is None:\n            hint = self._hint_for_var(var)\n\n        # Single variable\n        if hint == Continuize.Leave:\n            return [var]\n        if hint == Continuize.Remove:\n            return []\n        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \\\n                hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.RemoveMultinomial:\n            assert len(var.values) > 2\n            return []\n        if hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.AsNormalizedOrdinal:\n            scale = 1 / (len(var.values) - 1 or 1)\n            return [ContinuousVariable(var.name,\n                                       compute_value=Normalizer(var, 0, scale))]\n\n        # Multiple dummy variables\n        if hint == Continuize.FirstAsBase:\n            base = 0\n        elif hint == Continuize.FrequentAsBase:\n            base = self._get(var, \"major\")\n        elif hint == Continuize.Indicators:\n            base = None\n        else:\n            assert False, f\"hint={hint}?!\"\n        return [\n            ContinuousVariable(f\"{var.name}={value}\",\n                               compute_value=Indicator(var, value=i))\n            for i, value in enumerate(var.values)\n            if i != base\n        ]\n\n    def send_report(self):\n        if not self.data:\n            return\n        single_disc = len(self.disc_view.model()) > 0 \\\n                      and len(self.disc_var_hints) == 1 \\\n                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()\n        single_cont = len(self.cont_view.model()) > 0 \\\n                      and len(self.cont_var_hints) == 1 \\\n                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()\n        if single_disc and single_cont:\n            self.report_items(\n                ((\"Categorical variables\", single_disc),\n                 (\"Numeric variables\", single_cont))\n            )\n        else:\n            if single_disc:\n                self.report_paragraph(\"Categorical variables\", single_disc)\n            elif len(self.disc_view.model()) > 0:\n                self.report_items(\n                    \"Categorical variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      DiscreteOptions[id_].label.lower())\n                     for name, id_ in self.disc_var_hints.items()])\n            if single_cont:\n                self.report_paragraph(\"Numeric variables\", single_cont)\n            elif len(self.cont_view.model()) > 0:\n                self.report_items(\n                    \"Numeric variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      ContinuousOptions[id_].label.lower())\n                     for name, id_ in self.cont_var_hints.items()])\n            self.report_paragraph(\"Unlisted\",\n                \"Any unlisted attributes default to preset option, and \"\n                \"unlisted meta attributes and target variables are kept \"\n                \"as they are\")\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 2:\n            cont_treat = settings.pop(\"continuous_treatment\", 0)\n            zero_based = settings.pop(\"zero_based\", True)\n            if cont_treat == 1:\n                if zero_based:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize01\n                else:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize11\n            elif cont_treat == 2:\n                settings[\"continuous_treatment\"] = Normalize.Standardize\n        if version < 3:\n            settings[\"cont_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"continuous_treatment\", Normalize.Leave)}\n            settings[\"disc_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"multinomial_treatment\", Continuize.FirstAsBase)}\n            class_treatment = settings.pop(\"class_treatment\", Continuize.Leave)\n            if class_treatment != Continuize.Leave:\n                settings[\"disc_var_hints\"][BackCompatClass] = class_treatment",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 720,
                            "end_lineno": 740,
                            "parent": {
                                "file_name": "Orange/widgets/data/owcontinuize.py",
                                "type": "class",
                                "name": "OWContinuize",
                                "content": "class OWContinuize(widget.OWWidget):\n    # Many false positives for `hints`; pylint ignores type annotations\n    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation\n    # pylint: disable=unsupported-membership-test, unsupported-delete-operation\n    name = \"Continuize\"\n    description = (\"Transform categorical attributes into numeric and, \" +\n                   \"optionally, scale numeric values.\")\n    icon = \"icons/Continuize.svg\"\n    category = \"Transform\"\n    keywords = \"continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast\"\n    priority = 2120\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n\n    class Error(widget.OWWidget.Error):\n        unsupported_sparse = \\\n            widget.Msg(\"Some chosen methods do support sparse data: {}\")\n\n    want_control_area = False\n\n    settings_version = 3\n    disc_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: ContinuizationDefault}, schema_only=True)\n    cont_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: NormalizationDefault}, schema_only=True)\n    autosend = Setting(True)\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self._var_cache = {}\n\n        def create(title, vartype, methods):\n            hbox = gui.hBox(box, title)\n            view = ListViewSearch(\n                selectionMode=ListViewSearch.ExtendedSelection,\n                uniformItemSizes=True)\n            view.setModel(ContDomainModel(vartype))\n            view.selectionModel().selectionChanged.connect(\n                lambda: self._on_var_selection_changed(view))\n            view.default_view.selectionModel().selectionChanged.connect(\n                lambda selected: self._on_default_selected(view, selected))\n            hbox.layout().addWidget(view)\n\n            bbox = gui.vBox(hbox)\n            bgroup = QButtonGroup(self)\n            bgroup.idClicked.connect(self._on_radio_clicked)\n            for desc in methods.values():\n                button = QRadioButton(desc.label)\n                button.setToolTip(desc.tooltip)\n                bgroup.addButton(button, desc.id_)\n                bbox.layout().addWidget(button)\n            bbox.layout().addStretch(1)\n            return hbox, view, bbox, bgroup\n\n        box = gui.vBox(self.mainArea, True, spacing=8)\n        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \\\n            create(\"Categorical Variables\", DiscreteVariable, DiscreteOptions)\n        self.disc_view.set_default_method(\n            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)\n        self.disc_view.select_default()\n\n        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \\\n            create(\"Numeric Variables\", ContinuousVariable, ContinuousOptions)\n        self.cont_view.set_default_method(\n            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)\n        self.cont_view.select_default()\n\n        boxes = (self.disc_radios, self.cont_radios)\n        width = max(box.sizeHint().width() for box in boxes)\n        for box in boxes:\n            box.setFixedWidth(width)\n\n        box = gui.hBox(self.mainArea)\n        gui.button(\n            box, self, \"Reset All\", callback=self._on_reset_hints,\n            autoDefault=False)\n        gui.rubber(box)\n        gui.auto_apply(box, self, \"autosend\")\n\n    def _on_var_selection_changed(self, view):\n        if not view.selectionModel().selectedIndexes():\n            # Prevent infinite recursion (with _on_default_selected)\n            return\n        view.default_view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def _on_default_selected(self, view, selected):\n        if not selected:\n            # Prevent infinite recursion (with _var_selection_selected)\n            return\n        view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def selected_vars(self, view) -> List[str]:\n        \"\"\"\n        Return selected variables\n\n        If 'Default settings' are selected, this returns DefaultKey\n        \"\"\"\n        model = view.model()\n        return [model[index.row()]\n                for index in view.selectionModel().selectedRows()]\n\n    def _update_radios(self, view):\n        if view is self.disc_view:\n            group, hints = self.disc_group, self.disc_var_hints\n        else:\n            group, hints = self.cont_group, self.cont_var_hints\n\n        selvars = self.selected_vars(view)\n        if not selvars:\n            self._check_button(group, hints[DefaultKey], True)\n            self._set_radio_enabled(group, DefaultId, False)\n            return\n\n        self._set_radio_enabled(group, DefaultId, True)\n        options = {hints.get(var.name, self.default_for_var(var))\n                   for var in selvars}\n        if len(options) == 1:\n            self._check_button(group, options.pop(), True)\n        else:\n            self._uncheck_all_buttons(group)\n\n    @staticmethod\n    def _uncheck_all_buttons(group: QButtonGroup):\n        button = group.checkedButton()\n        if button is not None:\n            group.setExclusive(False)\n            button.setChecked(False)\n            group.setExclusive(True)\n\n    def _set_radio_enabled(\n            self, group: QButtonGroup, method_id: int, value: bool):\n        if group.button(method_id).isChecked() and not value:\n            self._uncheck_all_buttons(group)\n        group.button(method_id).setEnabled(value)\n\n    @staticmethod\n    def _check_button(group: QButtonGroup, method_id: int, checked: bool):\n        group.button(method_id).setChecked(checked)\n\n    def _on_radio_clicked(self, method_id: int):\n        if QObject().sender() is self.disc_group:\n            view, hints, methods = \\\n                self.disc_view, self.disc_var_hints, DiscreteOptions\n            leave_id = Continuize.Leave\n        else:\n            view, hints, methods = \\\n                self.cont_view, self.cont_var_hints, ContinuousOptions\n            leave_id = Normalize.Leave\n        selvars = self.selected_vars(view)\n        if not selvars:\n            hints[DefaultKey] = method_id\n            view.set_default_method(methods[method_id].short_desc)\n        else:\n            keys = [var.name for var in selvars]\n            indexes = view.selectionModel().selectedIndexes()\n            model = view.model()\n            # These two keys may delete values from dict, hence we must loop\n            if method_id in (DefaultId, leave_id):\n                for key in keys:\n                    # Attributes do not store the hint if it equals Default;\n                    # metas and targets do not store it if it is Leave\n                    if method_id == (DefaultId if self.is_attr(key) else leave_id):\n                        if key in hints:\n                            del hints[key]\n                    else:\n                        hints[key] = method_id\n            else:\n                hints.update(dict.fromkeys(keys, method_id))\n            desc = methods[method_id].short_desc\n            for index, var in zip(indexes, selvars):\n                show = method_id != self.default_for_var(var)\n                model.setData(index, (desc, show), model.HintRole)\n        self.commit.deferred()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.data = data\n        self._var_cache.clear()\n        domain = data.domain if data else None\n        self.disc_view.model().set_domain(domain)\n        self.cont_view.model().set_domain(domain)\n        if data:\n            # Clean up hints only when receiving new data, not on disconnection\n            self._set_hints()\n        self.commit.now()\n\n    def _set_hints(self):\n        assert self.data\n\n        # Backward compatibility for settings < 3\n        class_treatment = self.disc_var_hints.get(BackCompatClass, None)\n        if class_treatment is not None \\\n                and self.data.domain.class_var is not None:\n            self.disc_var_hints[self.data.domain.class_var.name] \\\n                = class_treatment\n\n        for hints, model, options in (\n                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),\n                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):\n            filtered = {DefaultKey: hints[DefaultKey]}\n            for i, var in enumerate(model):\n                if isinstance(var, LabelledSeparator):\n                    continue\n                default = self.default_for_var(var)\n                method_id = hints.get(var.name, default)\n                nondefault = method_id != default\n                if nondefault:\n                    filtered[var.name] = method_id\n                model.setData(\n                    model.index(i, 0),\n                    (options[method_id].short_desc, nondefault),\n                    model.HintRole)\n            hints.clear()\n            hints.update(filtered)\n\n    def _on_reset_hints(self):\n        if not self.data:\n            return\n        self.cont_var_hints.clear()\n        self.disc_var_hints.clear()\n        self.disc_var_hints[DefaultKey] = ContinuizationDefault\n        self.cont_var_hints[DefaultKey] = NormalizationDefault\n        self._set_hints()\n        self.cont_view.set_default_method(\n            ContinuousOptions[ContinuizationDefault].short_desc)\n        self.disc_view.set_default_method(\n            ContinuousOptions[NormalizationDefault].short_desc)\n\n    @gui.deferred\n    def commit(self):\n        self.Outputs.data.send(self._prepare_output())\n\n    def _prepare_output(self):\n        self.Error.unsupported_sparse.clear()\n        if not self.data:\n            return None\n        if unsupp_sparse := self._unsupported_sparse():\n            if len(unsupp_sparse) == 1:\n                self.Error.unsupported_sparse(unsupp_sparse[0])\n            else:\n                self.Error.unsupported_sparse(\"\\n\" + \", \".join(unsupp_sparse))\n            return None\n\n        domain = self.data.domain\n        attrs = self._create_vars(domain.attributes)\n        class_vars = self._create_vars(domain.class_vars)\n        metas = self._create_vars(domain.metas)\n        return self.data.transform(Domain(attrs, class_vars, metas))\n\n    def _unsupported_sparse(self):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        domain = self.data.domain\n        disc = set()\n        cont = set()\n        # At the time of writing, self.data.Y cannot be sparse (setter for\n        # `Y` converts it to dense, as done in\n        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)\n        # Including it here doesn't hurt, though.\n        for part, attrs in ((self.data.X, domain.attributes),\n                            (self.data.Y, domain.class_vars),\n                            (self.data.metas, domain.metas)):\n            if sp.issparse(part):\n                disc |= {self._hint_for_var(var)\n                         for var in attrs\n                         if var.is_discrete}\n                cont |= {self._hint_for_var(var)\n                         for var in attrs\n                         if type(var) is ContinuousVariable}\n        disc &= {method.id_\n                 for method in DiscreteOptions.values()\n                 if not method.supports_sparse}\n        cont &= {method.id_\n                 for method in ContinuousOptions.values()\n                 if not method.supports_sparse}\n\n        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order\n        return [method.label\n                for methods, problems in ((DiscreteOptions, disc),\n                                          (ContinuousOptions, cont))\n                for method in methods.values() if method.id_ in problems]\n\n    def _create_vars(self, part):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        return sum(\n            (self._continuized_vars(var) if var.is_discrete\n             else self._scaled_vars(var) if type(var) is ContinuousVariable\n             else [var]\n             for var in part),\n            start=[])\n\n    def _get(self, var, stat):\n        def most_frequent(col):\n            col = col[np.isfinite(col)].astype(int)\n            counts = np.bincount(col, minlength=len(var.values))\n            return np.argmax(counts)\n\n        funcs = {\"min\": np.nanmin, \"max\": np.nanmax,\n                 \"mean\": np.nanmean, \"std\": np.nanstd,\n                 \"major\": most_frequent}\n        name = var.name\n        cache = self._var_cache.setdefault(name, {})\n        if stat not in cache:\n            cache[stat] = funcs[stat](self.data.get_column(var))\n        return cache[stat]\n\n    def is_attr(self, var):\n        domain = self.data.domain\n        return 0 <= domain.index(var) < len(domain.attributes)\n\n    def default_for_var(self, var):\n        if self.is_attr(var):\n            return DefaultId\n        return Continuize.Leave if var.is_discrete else Normalize.Leave\n\n    def _hint_for_var(self, var):\n        if var.is_discrete:\n            hints, leave_id = self.disc_var_hints, Continuize.Leave\n        else:\n            hints, leave_id = self.cont_var_hints, Normalize.Leave\n\n        # Default for attributes is given by \"default\"\n        if self.is_attr(var):\n            return hints.get(var.name, hints[DefaultKey])\n\n        # For metas and targets, default is Leave\n        # If user changes it to \"Default\", default is used\n        hint = hints.get(var.name, leave_id)\n        if hint == DefaultId:\n            hint = hints[DefaultKey]\n        return hint\n\n    def _scaled_vars(self, var):\n        hint = self._hint_for_var(var)\n        if hint == Normalize.Leave:\n            return [var]\n\n        get = partial(self._get, var)\n        if hint == Normalize.Standardize:\n            off, scale = get(\"mean\"), 1 / (get(\"std\") or 1)\n        elif hint == Normalize.Center:\n            off, scale = get(\"mean\"), 1\n        elif hint == Normalize.Scale:\n            off, scale = 0, 1 / (get(\"std\") or 1)\n        else:\n            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f\"hint={hint}?!\"\n            min_, max_ = get(\"min\"), get(\"max\")\n            span = (max_ - min_) or 1\n            if hint == Normalize.Normalize11:\n                off, scale = (min_ + max_) / 2, 2 / span\n            else:\n                off, scale = min_, 1 / span\n\n        return [ContinuousVariable(\n            var.name,\n            compute_value=Normalizer(var, off, scale))]\n\n    def _continuized_vars(self, var, hint=None):\n        if hint is None:\n            hint = self._hint_for_var(var)\n\n        # Single variable\n        if hint == Continuize.Leave:\n            return [var]\n        if hint == Continuize.Remove:\n            return []\n        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \\\n                hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.RemoveMultinomial:\n            assert len(var.values) > 2\n            return []\n        if hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.AsNormalizedOrdinal:\n            scale = 1 / (len(var.values) - 1 or 1)\n            return [ContinuousVariable(var.name,\n                                       compute_value=Normalizer(var, 0, scale))]\n\n        # Multiple dummy variables\n        if hint == Continuize.FirstAsBase:\n            base = 0\n        elif hint == Continuize.FrequentAsBase:\n            base = self._get(var, \"major\")\n        elif hint == Continuize.Indicators:\n            base = None\n        else:\n            assert False, f\"hint={hint}?!\"\n        return [\n            ContinuousVariable(f\"{var.name}={value}\",\n                               compute_value=Indicator(var, value=i))\n            for i, value in enumerate(var.values)\n            if i != base\n        ]\n\n    def send_report(self):\n        if not self.data:\n            return\n        single_disc = len(self.disc_view.model()) > 0 \\\n                      and len(self.disc_var_hints) == 1 \\\n                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()\n        single_cont = len(self.cont_view.model()) > 0 \\\n                      and len(self.cont_var_hints) == 1 \\\n                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()\n        if single_disc and single_cont:\n            self.report_items(\n                ((\"Categorical variables\", single_disc),\n                 (\"Numeric variables\", single_cont))\n            )\n        else:\n            if single_disc:\n                self.report_paragraph(\"Categorical variables\", single_disc)\n            elif len(self.disc_view.model()) > 0:\n                self.report_items(\n                    \"Categorical variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      DiscreteOptions[id_].label.lower())\n                     for name, id_ in self.disc_var_hints.items()])\n            if single_cont:\n                self.report_paragraph(\"Numeric variables\", single_cont)\n            elif len(self.cont_view.model()) > 0:\n                self.report_items(\n                    \"Numeric variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      ContinuousOptions[id_].label.lower())\n                     for name, id_ in self.cont_var_hints.items()])\n            self.report_paragraph(\"Unlisted\",\n                \"Any unlisted attributes default to preset option, and \"\n                \"unlisted meta attributes and target variables are kept \"\n                \"as they are\")\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 2:\n            cont_treat = settings.pop(\"continuous_treatment\", 0)\n            zero_based = settings.pop(\"zero_based\", True)\n            if cont_treat == 1:\n                if zero_based:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize01\n                else:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize11\n            elif cont_treat == 2:\n                settings[\"continuous_treatment\"] = Normalize.Standardize\n        if version < 3:\n            settings[\"cont_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"continuous_treatment\", Normalize.Leave)}\n            settings[\"disc_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"multinomial_treatment\", Continuize.FirstAsBase)}\n            class_treatment = settings.pop(\"class_treatment\", Continuize.Leave)\n            if class_treatment != Continuize.Leave:\n                settings[\"disc_var_hints\"][BackCompatClass] = class_treatment",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 279,
                                "end_lineno": 740,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/data/owcontinuize.py",
                            "type": "class",
                            "name": "OWContinuize",
                            "content": "class OWContinuize(widget.OWWidget):\n    # Many false positives for `hints`; pylint ignores type annotations\n    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation\n    # pylint: disable=unsupported-membership-test, unsupported-delete-operation\n    name = \"Continuize\"\n    description = (\"Transform categorical attributes into numeric and, \" +\n                   \"optionally, scale numeric values.\")\n    icon = \"icons/Continuize.svg\"\n    category = \"Transform\"\n    keywords = \"continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast\"\n    priority = 2120\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n\n    class Error(widget.OWWidget.Error):\n        unsupported_sparse = \\\n            widget.Msg(\"Some chosen methods do support sparse data: {}\")\n\n    want_control_area = False\n\n    settings_version = 3\n    disc_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: ContinuizationDefault}, schema_only=True)\n    cont_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: NormalizationDefault}, schema_only=True)\n    autosend = Setting(True)\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self._var_cache = {}\n\n        def create(title, vartype, methods):\n            hbox = gui.hBox(box, title)\n            view = ListViewSearch(\n                selectionMode=ListViewSearch.ExtendedSelection,\n                uniformItemSizes=True)\n            view.setModel(ContDomainModel(vartype))\n            view.selectionModel().selectionChanged.connect(\n                lambda: self._on_var_selection_changed(view))\n            view.default_view.selectionModel().selectionChanged.connect(\n                lambda selected: self._on_default_selected(view, selected))\n            hbox.layout().addWidget(view)\n\n            bbox = gui.vBox(hbox)\n            bgroup = QButtonGroup(self)\n            bgroup.idClicked.connect(self._on_radio_clicked)\n            for desc in methods.values():\n                button = QRadioButton(desc.label)\n                button.setToolTip(desc.tooltip)\n                bgroup.addButton(button, desc.id_)\n                bbox.layout().addWidget(button)\n            bbox.layout().addStretch(1)\n            return hbox, view, bbox, bgroup\n\n        box = gui.vBox(self.mainArea, True, spacing=8)\n        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \\\n            create(\"Categorical Variables\", DiscreteVariable, DiscreteOptions)\n        self.disc_view.set_default_method(\n            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)\n        self.disc_view.select_default()\n\n        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \\\n            create(\"Numeric Variables\", ContinuousVariable, ContinuousOptions)\n        self.cont_view.set_default_method(\n            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)\n        self.cont_view.select_default()\n\n        boxes = (self.disc_radios, self.cont_radios)\n        width = max(box.sizeHint().width() for box in boxes)\n        for box in boxes:\n            box.setFixedWidth(width)\n\n        box = gui.hBox(self.mainArea)\n        gui.button(\n            box, self, \"Reset All\", callback=self._on_reset_hints,\n            autoDefault=False)\n        gui.rubber(box)\n        gui.auto_apply(box, self, \"autosend\")\n\n    def _on_var_selection_changed(self, view):\n        if not view.selectionModel().selectedIndexes():\n            # Prevent infinite recursion (with _on_default_selected)\n            return\n        view.default_view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def _on_default_selected(self, view, selected):\n        if not selected:\n            # Prevent infinite recursion (with _var_selection_selected)\n            return\n        view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def selected_vars(self, view) -> List[str]:\n        \"\"\"\n        Return selected variables\n\n        If 'Default settings' are selected, this returns DefaultKey\n        \"\"\"\n        model = view.model()\n        return [model[index.row()]\n                for index in view.selectionModel().selectedRows()]\n\n    def _update_radios(self, view):\n        if view is self.disc_view:\n            group, hints = self.disc_group, self.disc_var_hints\n        else:\n            group, hints = self.cont_group, self.cont_var_hints\n\n        selvars = self.selected_vars(view)\n        if not selvars:\n            self._check_button(group, hints[DefaultKey], True)\n            self._set_radio_enabled(group, DefaultId, False)\n            return\n\n        self._set_radio_enabled(group, DefaultId, True)\n        options = {hints.get(var.name, self.default_for_var(var))\n                   for var in selvars}\n        if len(options) == 1:\n            self._check_button(group, options.pop(), True)\n        else:\n            self._uncheck_all_buttons(group)\n\n    @staticmethod\n    def _uncheck_all_buttons(group: QButtonGroup):\n        button = group.checkedButton()\n        if button is not None:\n            group.setExclusive(False)\n            button.setChecked(False)\n            group.setExclusive(True)\n\n    def _set_radio_enabled(\n            self, group: QButtonGroup, method_id: int, value: bool):\n        if group.button(method_id).isChecked() and not value:\n            self._uncheck_all_buttons(group)\n        group.button(method_id).setEnabled(value)\n\n    @staticmethod\n    def _check_button(group: QButtonGroup, method_id: int, checked: bool):\n        group.button(method_id).setChecked(checked)\n\n    def _on_radio_clicked(self, method_id: int):\n        if QObject().sender() is self.disc_group:\n            view, hints, methods = \\\n                self.disc_view, self.disc_var_hints, DiscreteOptions\n            leave_id = Continuize.Leave\n        else:\n            view, hints, methods = \\\n                self.cont_view, self.cont_var_hints, ContinuousOptions\n            leave_id = Normalize.Leave\n        selvars = self.selected_vars(view)\n        if not selvars:\n            hints[DefaultKey] = method_id\n            view.set_default_method(methods[method_id].short_desc)\n        else:\n            keys = [var.name for var in selvars]\n            indexes = view.selectionModel().selectedIndexes()\n            model = view.model()\n            # These two keys may delete values from dict, hence we must loop\n            if method_id in (DefaultId, leave_id):\n                for key in keys:\n                    # Attributes do not store the hint if it equals Default;\n                    # metas and targets do not store it if it is Leave\n                    if method_id == (DefaultId if self.is_attr(key) else leave_id):\n                        if key in hints:\n                            del hints[key]\n                    else:\n                        hints[key] = method_id\n            else:\n                hints.update(dict.fromkeys(keys, method_id))\n            desc = methods[method_id].short_desc\n            for index, var in zip(indexes, selvars):\n                show = method_id != self.default_for_var(var)\n                model.setData(index, (desc, show), model.HintRole)\n        self.commit.deferred()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.data = data\n        self._var_cache.clear()\n        domain = data.domain if data else None\n        self.disc_view.model().set_domain(domain)\n        self.cont_view.model().set_domain(domain)\n        if data:\n            # Clean up hints only when receiving new data, not on disconnection\n            self._set_hints()\n        self.commit.now()\n\n    def _set_hints(self):\n        assert self.data\n\n        # Backward compatibility for settings < 3\n        class_treatment = self.disc_var_hints.get(BackCompatClass, None)\n        if class_treatment is not None \\\n                and self.data.domain.class_var is not None:\n            self.disc_var_hints[self.data.domain.class_var.name] \\\n                = class_treatment\n\n        for hints, model, options in (\n                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),\n                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):\n            filtered = {DefaultKey: hints[DefaultKey]}\n            for i, var in enumerate(model):\n                if isinstance(var, LabelledSeparator):\n                    continue\n                default = self.default_for_var(var)\n                method_id = hints.get(var.name, default)\n                nondefault = method_id != default\n                if nondefault:\n                    filtered[var.name] = method_id\n                model.setData(\n                    model.index(i, 0),\n                    (options[method_id].short_desc, nondefault),\n                    model.HintRole)\n            hints.clear()\n            hints.update(filtered)\n\n    def _on_reset_hints(self):\n        if not self.data:\n            return\n        self.cont_var_hints.clear()\n        self.disc_var_hints.clear()\n        self.disc_var_hints[DefaultKey] = ContinuizationDefault\n        self.cont_var_hints[DefaultKey] = NormalizationDefault\n        self._set_hints()\n        self.cont_view.set_default_method(\n            ContinuousOptions[ContinuizationDefault].short_desc)\n        self.disc_view.set_default_method(\n            ContinuousOptions[NormalizationDefault].short_desc)\n\n    @gui.deferred\n    def commit(self):\n        self.Outputs.data.send(self._prepare_output())\n\n    def _prepare_output(self):\n        self.Error.unsupported_sparse.clear()\n        if not self.data:\n            return None\n        if unsupp_sparse := self._unsupported_sparse():\n            if len(unsupp_sparse) == 1:\n                self.Error.unsupported_sparse(unsupp_sparse[0])\n            else:\n                self.Error.unsupported_sparse(\"\\n\" + \", \".join(unsupp_sparse))\n            return None\n\n        domain = self.data.domain\n        attrs = self._create_vars(domain.attributes)\n        class_vars = self._create_vars(domain.class_vars)\n        metas = self._create_vars(domain.metas)\n        return self.data.transform(Domain(attrs, class_vars, metas))\n\n    def _unsupported_sparse(self):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        domain = self.data.domain\n        disc = set()\n        cont = set()\n        # At the time of writing, self.data.Y cannot be sparse (setter for\n        # `Y` converts it to dense, as done in\n        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)\n        # Including it here doesn't hurt, though.\n        for part, attrs in ((self.data.X, domain.attributes),\n                            (self.data.Y, domain.class_vars),\n                            (self.data.metas, domain.metas)):\n            if sp.issparse(part):\n                disc |= {self._hint_for_var(var)\n                         for var in attrs\n                         if var.is_discrete}\n                cont |= {self._hint_for_var(var)\n                         for var in attrs\n                         if type(var) is ContinuousVariable}\n        disc &= {method.id_\n                 for method in DiscreteOptions.values()\n                 if not method.supports_sparse}\n        cont &= {method.id_\n                 for method in ContinuousOptions.values()\n                 if not method.supports_sparse}\n\n        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order\n        return [method.label\n                for methods, problems in ((DiscreteOptions, disc),\n                                          (ContinuousOptions, cont))\n                for method in methods.values() if method.id_ in problems]\n\n    def _create_vars(self, part):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        return sum(\n            (self._continuized_vars(var) if var.is_discrete\n             else self._scaled_vars(var) if type(var) is ContinuousVariable\n             else [var]\n             for var in part),\n            start=[])\n\n    def _get(self, var, stat):\n        def most_frequent(col):\n            col = col[np.isfinite(col)].astype(int)\n            counts = np.bincount(col, minlength=len(var.values))\n            return np.argmax(counts)\n\n        funcs = {\"min\": np.nanmin, \"max\": np.nanmax,\n                 \"mean\": np.nanmean, \"std\": np.nanstd,\n                 \"major\": most_frequent}\n        name = var.name\n        cache = self._var_cache.setdefault(name, {})\n        if stat not in cache:\n            cache[stat] = funcs[stat](self.data.get_column(var))\n        return cache[stat]\n\n    def is_attr(self, var):\n        domain = self.data.domain\n        return 0 <= domain.index(var) < len(domain.attributes)\n\n    def default_for_var(self, var):\n        if self.is_attr(var):\n            return DefaultId\n        return Continuize.Leave if var.is_discrete else Normalize.Leave\n\n    def _hint_for_var(self, var):\n        if var.is_discrete:\n            hints, leave_id = self.disc_var_hints, Continuize.Leave\n        else:\n            hints, leave_id = self.cont_var_hints, Normalize.Leave\n\n        # Default for attributes is given by \"default\"\n        if self.is_attr(var):\n            return hints.get(var.name, hints[DefaultKey])\n\n        # For metas and targets, default is Leave\n        # If user changes it to \"Default\", default is used\n        hint = hints.get(var.name, leave_id)\n        if hint == DefaultId:\n            hint = hints[DefaultKey]\n        return hint\n\n    def _scaled_vars(self, var):\n        hint = self._hint_for_var(var)\n        if hint == Normalize.Leave:\n            return [var]\n\n        get = partial(self._get, var)\n        if hint == Normalize.Standardize:\n            off, scale = get(\"mean\"), 1 / (get(\"std\") or 1)\n        elif hint == Normalize.Center:\n            off, scale = get(\"mean\"), 1\n        elif hint == Normalize.Scale:\n            off, scale = 0, 1 / (get(\"std\") or 1)\n        else:\n            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f\"hint={hint}?!\"\n            min_, max_ = get(\"min\"), get(\"max\")\n            span = (max_ - min_) or 1\n            if hint == Normalize.Normalize11:\n                off, scale = (min_ + max_) / 2, 2 / span\n            else:\n                off, scale = min_, 1 / span\n\n        return [ContinuousVariable(\n            var.name,\n            compute_value=Normalizer(var, off, scale))]\n\n    def _continuized_vars(self, var, hint=None):\n        if hint is None:\n            hint = self._hint_for_var(var)\n\n        # Single variable\n        if hint == Continuize.Leave:\n            return [var]\n        if hint == Continuize.Remove:\n            return []\n        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \\\n                hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.RemoveMultinomial:\n            assert len(var.values) > 2\n            return []\n        if hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.AsNormalizedOrdinal:\n            scale = 1 / (len(var.values) - 1 or 1)\n            return [ContinuousVariable(var.name,\n                                       compute_value=Normalizer(var, 0, scale))]\n\n        # Multiple dummy variables\n        if hint == Continuize.FirstAsBase:\n            base = 0\n        elif hint == Continuize.FrequentAsBase:\n            base = self._get(var, \"major\")\n        elif hint == Continuize.Indicators:\n            base = None\n        else:\n            assert False, f\"hint={hint}?!\"\n        return [\n            ContinuousVariable(f\"{var.name}={value}\",\n                               compute_value=Indicator(var, value=i))\n            for i, value in enumerate(var.values)\n            if i != base\n        ]\n\n    def send_report(self):\n        if not self.data:\n            return\n        single_disc = len(self.disc_view.model()) > 0 \\\n                      and len(self.disc_var_hints) == 1 \\\n                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()\n        single_cont = len(self.cont_view.model()) > 0 \\\n                      and len(self.cont_var_hints) == 1 \\\n                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()\n        if single_disc and single_cont:\n            self.report_items(\n                ((\"Categorical variables\", single_disc),\n                 (\"Numeric variables\", single_cont))\n            )\n        else:\n            if single_disc:\n                self.report_paragraph(\"Categorical variables\", single_disc)\n            elif len(self.disc_view.model()) > 0:\n                self.report_items(\n                    \"Categorical variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      DiscreteOptions[id_].label.lower())\n                     for name, id_ in self.disc_var_hints.items()])\n            if single_cont:\n                self.report_paragraph(\"Numeric variables\", single_cont)\n            elif len(self.cont_view.model()) > 0:\n                self.report_items(\n                    \"Numeric variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      ContinuousOptions[id_].label.lower())\n                     for name, id_ in self.cont_var_hints.items()])\n            self.report_paragraph(\"Unlisted\",\n                \"Any unlisted attributes default to preset option, and \"\n                \"unlisted meta attributes and target variables are kept \"\n                \"as they are\")\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 2:\n            cont_treat = settings.pop(\"continuous_treatment\", 0)\n            zero_based = settings.pop(\"zero_based\", True)\n            if cont_treat == 1:\n                if zero_based:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize01\n                else:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize11\n            elif cont_treat == 2:\n                settings[\"continuous_treatment\"] = Normalize.Standardize\n        if version < 3:\n            settings[\"cont_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"continuous_treatment\", Normalize.Leave)}\n            settings[\"disc_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"multinomial_treatment\", Continuize.FirstAsBase)}\n            class_treatment = settings.pop(\"class_treatment\", Continuize.Leave)\n            if class_treatment != Continuize.Leave:\n                settings[\"disc_var_hints\"][BackCompatClass] = class_treatment",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 279,
                            "end_lineno": 740,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,unsubscriptable-object,protected-access\nimport unittest\nfrom unittest.mock import Mock, patch\n\nimport numpy as np\nfrom AnyQt.QtCore import Qt, QModelIndex, QItemSelectionModel\nfrom AnyQt.QtTest import QSignalSpy\n\nfrom orangewidget.tests.base import GuiTest\nfrom orangewidget.utils.itemmodels import SeparatedListDelegate\n\nfrom Orange.data import Table, DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.widgets.data.owcontinuize import OWContinuize, DefaultKey, \\\n    ContinuousOptions, Normalize, Continuize, DiscreteOptions, \\\n    ContDomainModel, DefaultContModel, ListViewSearch, DefaultId\nfrom Orange.widgets.tests.base import WidgetTest\n\n\nclass TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n\nclass TestModelsAndViews(GuiTest):\n    def test_contmodel(self):\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        ContinuousVariable(\"y\"))\n        model = ContDomainModel(ContinuousVariable)\n        model.set_domain(domain)\n\n        ind = model.index(0, 0)\n        self.assertEqual(ind.data()[0], \"a\")\n        self.assertEqual(ind.data(model.FilterRole)[0], \"a\")\n        self.assertIsNone(ind.data(Qt.ToolTipRole))\n\n        ind = model.index(1, 0)\n        model.setData(ind, (\"mega encoding\", True), model.HintRole)\n        self.assertEqual(ind.data(), (\"b\", \"mega encoding\", True))\n        self.assertEqual(ind.data(model.HintRole), (\"mega encoding\", True))\n        self.assertIn(\"b\", ind.data(model.FilterRole))\n        self.assertIn(\"mega encoding\", ind.data(model.FilterRole))\n        self.assertNotIn(\"bmega encoding\", ind.data(model.FilterRole))\n        self.assertIsNone(ind.data(Qt.ToolTipRole))\n\n        ind = model.index(3, 0)  # separator\n        self.assertIsNone(ind.data())\n        self.assertIsNone(ind.data(model.HintRole))\n        self.assertIsNone(ind.data(model.FilterRole))\n\n    def test_defaultcontmodel(self):\n        model = DefaultContModel()\n        self.assertEqual(1, model.rowCount(QModelIndex()))\n        self.assertEqual(1, model.columnCount(QModelIndex()))\n        ind = model.index(0, 0)\n        spy = QSignalSpy(model.dataChanged)\n        model.setMethod(\"mega encoding\")\n        self.assertEqual(spy[0][0].row(), 0)\n        self.assertEqual(ind.data(), \"Preset: mega encoding\")\n        self.assertIsNotNone(ind.data(Qt.DecorationRole))\n        self.assertIsNotNone(ind.data(Qt.ToolTipRole))\n\n\nclass TestListViewDelegate(unittest.TestCase):\n    def test_displaytext(self):\n        delegate = ListViewSearch.Delegate()\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a\")\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", True), Mock()),\n                         \"a: foo\")\n        delegate.set_default_hints(True)\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a: foo\")\n        delegate.set_default_hints(False)\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a\")\n\n    @patch.object(SeparatedListDelegate, \"initStyleOption\")\n    def test_bold(self, _):\n        delegate = ListViewSearch.Delegate()\n        option = Mock()\n        index = Mock()\n        index.data = lambda role: (\"foo\", True) \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(True)\n        index.data = lambda role: (\"foo\", False) \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(False)\n        index.data = lambda role: None \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(False)\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,unsubscriptable-object,protected-access\nimport unittest\nfrom unittest.mock import Mock, patch\n\nimport numpy as np\nfrom AnyQt.QtCore import Qt, QModelIndex, QItemSelectionModel\nfrom AnyQt.QtTest import QSignalSpy\n\nfrom orangewidget.tests.base import GuiTest\nfrom orangewidget.utils.itemmodels import SeparatedListDelegate\n\nfrom Orange.data import Table, DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.widgets.data.owcontinuize import OWContinuize, DefaultKey, \\\n    ContinuousOptions, Normalize, Continuize, DiscreteOptions, \\\n    ContDomainModel, DefaultContModel, ListViewSearch, DefaultId\nfrom Orange.widgets.tests.base import WidgetTest\n\n\nclass TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=2)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=4,\n                                 class_treatment=3)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=4,\n                                 class_treatment=0)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], 4)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n\nclass TestModelsAndViews(GuiTest):\n    def test_contmodel(self):\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        ContinuousVariable(\"y\"))\n        model = ContDomainModel(ContinuousVariable)\n        model.set_domain(domain)\n\n        ind = model.index(0, 0)\n        self.assertEqual(ind.data()[0], \"a\")\n        self.assertEqual(ind.data(model.FilterRole)[0], \"a\")\n        self.assertIsNone(ind.data(Qt.ToolTipRole))\n\n        ind = model.index(1, 0)\n        model.setData(ind, (\"mega encoding\", True), model.HintRole)\n        self.assertEqual(ind.data(), (\"b\", \"mega encoding\", True))\n        self.assertEqual(ind.data(model.HintRole), (\"mega encoding\", True))\n        self.assertIn(\"b\", ind.data(model.FilterRole))\n        self.assertIn(\"mega encoding\", ind.data(model.FilterRole))\n        self.assertNotIn(\"bmega encoding\", ind.data(model.FilterRole))\n        self.assertIsNone(ind.data(Qt.ToolTipRole))\n\n        ind = model.index(3, 0)  # separator\n        self.assertIsNone(ind.data())\n        self.assertIsNone(ind.data(model.HintRole))\n        self.assertIsNone(ind.data(model.FilterRole))\n\n    def test_defaultcontmodel(self):\n        model = DefaultContModel()\n        self.assertEqual(1, model.rowCount(QModelIndex()))\n        self.assertEqual(1, model.columnCount(QModelIndex()))\n        ind = model.index(0, 0)\n        spy = QSignalSpy(model.dataChanged)\n        model.setMethod(\"mega encoding\")\n        self.assertEqual(spy[0][0].row(), 0)\n        self.assertEqual(ind.data(), \"Preset: mega encoding\")\n        self.assertIsNotNone(ind.data(Qt.DecorationRole))\n        self.assertIsNotNone(ind.data(Qt.ToolTipRole))\n\n\nclass TestListViewDelegate(unittest.TestCase):\n    def test_displaytext(self):\n        delegate = ListViewSearch.Delegate()\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a\")\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", True), Mock()),\n                         \"a: foo\")\n        delegate.set_default_hints(True)\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a: foo\")\n        delegate.set_default_hints(False)\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a\")\n\n    @patch.object(SeparatedListDelegate, \"initStyleOption\")\n    def test_bold(self, _):\n        delegate = ListViewSearch.Delegate()\n        option = Mock()\n        index = Mock()\n        index.data = lambda role: (\"foo\", True) \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(True)\n        index.data = lambda role: (\"foo\", False) \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(False)\n        index.data = lambda role: None \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(False)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/tests/test_owcontinuize.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "8613e6066",
                "new_commit_hash": "af84bd1d5",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/tests/test_owcontinuize.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/tests/test_owcontinuize.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 760,
                            "length": 7
                        },
                        "new_range": {
                            "start": 760,
                            "length": 7
                        },
                        "section": "class TestOWContinuize(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        widget = self.create_widget(",
                                "type": "context"
                            },
                            {
                                "content": "            OWContinuize,",
                                "type": "context"
                            },
                            {
                                "content": "            stored_settings=dict(multinomial_treatment=Continuize.Indicators)",
                                "type": "deleted"
                            },
                            {
                                "content": "            stored_settings=dict(multinomial_treatment=2)",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(widget.disc_var_hints[DefaultKey],",
                                "type": "context"
                            },
                            {
                                "content": "                         Continuize.Indicators)",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                            "type": "class",
                            "name": "TestOWContinuize",
                            "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 20,
                            "end_lineno": 798,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                            "type": "method",
                            "name": "TestOWContinuize.test_migrate_settings_to_v3",
                            "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 735,
                            "end_lineno": 766,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                                "type": "class",
                                "name": "TestOWContinuize",
                                "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 20,
                                "end_lineno": 798,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 773,
                            "length": 8
                        },
                        "new_range": {
                            "start": 773,
                            "length": 8
                        },
                        "section": "class TestOWContinuize(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        widget = self.create_widget(",
                                "type": "context"
                            },
                            {
                                "content": "            OWContinuize,",
                                "type": "context"
                            },
                            {
                                "content": "            stored_settings=dict(multinomial_treatment=Continuize.Remove,",
                                "type": "deleted"
                            },
                            {
                                "content": "                                 class_treatment=Continuize.Indicators)",
                                "type": "deleted"
                            },
                            {
                                "content": "            stored_settings=dict(multinomial_treatment=4,",
                                "type": "added"
                            },
                            {
                                "content": "                                 class_treatment=3)",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(widget.Inputs.data, data)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                            "type": "class",
                            "name": "TestOWContinuize",
                            "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 20,
                            "end_lineno": 798,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                            "type": "method",
                            "name": "TestOWContinuize.test_migrate_settings_to_v3_class_treatment",
                            "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 768,
                            "end_lineno": 798,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                                "type": "class",
                                "name": "TestOWContinuize",
                                "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 20,
                                "end_lineno": 798,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 782,
                            "length": 12
                        },
                        "new_range": {
                            "start": 782,
                            "length": 12
                        },
                        "section": "class TestOWContinuize(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        widget = self.create_widget(",
                                "type": "context"
                            },
                            {
                                "content": "            OWContinuize,",
                                "type": "context"
                            },
                            {
                                "content": "            stored_settings=dict(multinomial_treatment=Continuize.Remove,",
                                "type": "deleted"
                            },
                            {
                                "content": "                                 class_treatment=Continuize.Leave)",
                                "type": "deleted"
                            },
                            {
                                "content": "            stored_settings=dict(multinomial_treatment=4,",
                                "type": "added"
                            },
                            {
                                "content": "                                 class_treatment=0)",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(widget.Inputs.data, data)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertNotIn(\"y\", widget.disc_var_hints)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                                "type": "deleted"
                            },
                            {
                                "content": "        self.assertEqual(widget.disc_var_hints[DefaultKey], 4)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        widget = self.create_widget(",
                                "type": "context"
                            },
                            {
                                "content": "            OWContinuize,",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                            "type": "class",
                            "name": "TestOWContinuize",
                            "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 20,
                            "end_lineno": 798,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                            "type": "method",
                            "name": "TestOWContinuize.test_migrate_settings_to_v3_class_treatment",
                            "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 768,
                            "end_lineno": 798,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owcontinuize.py",
                                "type": "class",
                                "name": "TestOWContinuize",
                                "content": "class TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Indicators)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Indicators)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove,\n                                 class_treatment=Continuize.Leave)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 20,
                                "end_lineno": 798,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1^",
    "new_commit_hash": "fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1",
    "commit_message": "Fix setting migration",
    "commit_date": "2023-03-30T16:10:45+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,unsubscriptable-object,protected-access\nimport unittest\nfrom unittest.mock import Mock, patch\n\nimport numpy as np\nfrom AnyQt.QtCore import Qt, QModelIndex, QItemSelectionModel\nfrom AnyQt.QtTest import QSignalSpy\n\nfrom orangewidget.tests.base import GuiTest\nfrom orangewidget.utils.itemmodels import SeparatedListDelegate\n\nfrom Orange.data import Table, DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.widgets.data.owcontinuize import OWContinuize, DefaultKey, \\\n    ContinuousOptions, Normalize, Continuize, DiscreteOptions, \\\n    ContDomainModel, DefaultContModel, ListViewSearch, DefaultId\nfrom Orange.widgets.tests.base import WidgetTest\n\n\nclass TestOWContinuize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWContinuize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n\n        self.send_signal(self.widget.Inputs.data, data)\n        widget.commit.now()\n\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n        self.send_signal(self.widget.Inputs.data, None)\n        widget.commit.now()\n        self.assertIsNone(self.get_output(self.widget.Outputs.data))\n\n    def test_continuous(self):\n        table = Table(\"housing\")\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_equal_values(self):\n        table = Table(\"iris\")\n        table = table[:, 1].copy()\n        with table.unlocked():\n            table[:] = 42.0\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_sd(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySD\n        self.widget.continuous_treatment = 2\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_one_column_nan_values_normalize_span(self):\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[:, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        # Normalize.NormalizeBySpan\n        self.widget.continuous_treatment = 1\n        self.widget.commit.now()\n\n        table = Table(\"iris\")\n        with table.unlocked():\n            table[1, 2] = np.NaN\n        self.send_signal(self.widget.Inputs.data, table)\n        self.widget.commit.now()\n\n    def test_commit_calls_prepare_output(self):\n        # This test ensures that commit returns the result of _prepare_output,\n        # so further tests can just check the latter. If this is changed, the\n        # test will fail, which is OK - test can be removed, but other tests\n        # then have to check the output and not just _prepare_output.\n        out = object()\n        self.widget._prepare_output = lambda: out\n        self.widget.Outputs.data.send = Mock()\n        self.widget.commit.now()\n        self.widget.Outputs.data.send.assert_called_with(out)\n\n    def test_check_unsuppoerted_sparse_continuous(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.cont_var_hints\n        iris = Table(\"iris\")\n        iris = iris.transform(Domain(iris.domain[:2],\n                                     iris.domain.class_var,\n                                     iris.domain.attributes[2:]))\n        sparse_iris = iris.to_sparse(sparse_class=True, sparse_metas=True)\n\n        for attr in (iris.domain.attributes[0], iris.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Normalize.Leave\n                for hints[key], desc in ContinuousOptions.items():\n                    if desc.id_ == Normalize.Default:\n                        continue\n                    msg = f\"at {attr} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    # input dense\n                    self.send_signal(w.Inputs.data, iris)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    # input sparse\n                    self.send_signal(w.Inputs.data, sparse_iris)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data),\n                                             msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data),\n                                          msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(),\n                                         msg)\n                del hints[key]\n\n    def test_check_unsuppoerted_sparse_discrete(self):\n        # This test checks response at two points:\n        # - when scaling sparse data with a method that does not support it,\n        #   the wiget must show an error and output nothing\n        # - the above is tested via method _unsupported_sparse, so we also\n        #   directly check this method\n        w = self.widget\n        hints = w.disc_var_hints\n        zoo = Table(\"zoo\")\n        zoo = zoo.transform(Domain(zoo.domain.attributes[:2],\n                                   None,\n                                   zoo.domain.attributes[2:]))\n        sparse_zoo = zoo.to_sparse(sparse_metas=True)\n\n        # input dense\n        for attr in (zoo.domain[0], zoo.domain.metas[0]):\n            for key in (DefaultKey, attr.name):\n                hints[DefaultKey] = Continuize.Leave\n                for hints[key], desc in DiscreteOptions.items():\n                    if desc.id_ == Continuize.Default:\n                        continue\n                    msg = f\"at {key} = {desc.label}, \" \\\n                          + (\"default\" if key is DefaultKey else key)\n\n                    self.send_signal(w.Inputs.data, zoo)\n                    self.assertFalse(w._unsupported_sparse(), msg)\n                    self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n                    self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n\n                    self.send_signal(w.Inputs.data, sparse_zoo)\n                    self.assertIsNot(w._unsupported_sparse(),\n                                     desc.supports_sparse, msg)\n                    self.assertIsNot(w.Error.unsupported_sparse.is_shown(),\n                                     desc.supports_sparse, msg)\n                    if desc.supports_sparse:\n                        self.assertIsNotNone(self.get_output(w.Outputs.data), msg)\n                    else:\n                        self.assertIsNone(self.get_output(w.Outputs.data), msg)\n                        self.send_signal(w.Inputs.data, None)\n                        self.assertFalse(w.Error.unsupported_sparse.is_shown(), msg)\n            del hints[key]\n\n    def test_update_cont_radio_buttons(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        with patch.object(w, \"_update_radios\") as upd:\n            w._on_var_selection_changed(dview)\n            upd.assert_not_called()\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest_pain\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n        self.assertTrue(dgroup.button(99).isEnabled())\n\n        dselmod.select(dmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # blood sugar\n        self.assertEqual(dgroup.checkedId(), Continuize.Default)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.ClearAndSelect)  # rest ECG\n        self.assertEqual(dgroup.checkedId(), Continuize.Remove)\n\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.ClearAndSelect)  # exerc ind ang\n        self.assertEqual(dgroup.checkedId(), Continuize.FirstAsBase)\n\n        dselmod.select(dmod.index(3, 0),\n                       QItemSelectionModel.Select)  # read ECG and exerc ind ang\n        self.assertEqual(dgroup.checkedId(), -1)\n\n        dview.select_default()\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(dgroup.button(99).isEnabled())\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        self.assertEqual(cgroup.checkedId(), Normalize.Scale)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertTrue(cgroup.button(99).isEnabled())\n\n        cview.select_default()\n        self.assertEqual(cgroup.checkedId(), Normalize.Center)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n        self.assertFalse(cgroup.button(99).isEnabled())\n\n        w._uncheck_all_buttons(cgroup)\n        self.assertEqual(cgroup.checkedId(), -1)\n        self.assertEqual(dgroup.checkedId(), Continuize.AsOrdinal)\n\n        w._uncheck_all_buttons(dgroup)\n        self.assertEqual(dgroup.checkedId(), -1)\n\n    def test_update_disc_radio_buttons_mixed(self):\n        def select(xs):\n            dselmod.select(dmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                dselmod.select(dmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain(\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n            DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n            [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"b\": Continuize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), Continuize.Leave)\n\n        w.disc_var_hints = {DefaultKey: Continuize.FirstAsBase,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(dgroup.checkedId(), DefaultId)\n\n    def test_update_cont_radio_buttons_mixed(self):\n        def select(xs):\n            cselmod.select(cmod.index(xs[0], 0),\n                           QItemSelectionModel.ClearAndSelect)\n            for x in xs[1:]:\n                cselmod.select(cmod.index(x, 0),\n                               QItemSelectionModel.Select)\n\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), -1)\n        select([1])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n        select([4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"b\": Normalize.Leave}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), Normalize.Leave)\n\n        w.cont_var_hints = {DefaultKey: Normalize.Center,\n                            \"e\": DefaultId, \"d\": DefaultId}\n        self.send_signal(w.Inputs.data, data)\n        select([1, 4, 8])\n        self.assertEqual(cgroup.checkedId(), DefaultId)\n\n    def test_set_hints_on_new_data(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n\n        self.send_signal(w.Inputs.data, None)\n        self.send_signal(w.Inputs.data, data)\n\n        model = w.cont_view.model()\n        self.assertEqual(model.index(0, 0).data(model.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(model.index(1, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(model.index(5, 0).data(model.HintRole),\n                         (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n        self.assertNotIn(\"x\", w.cont_var_hints)\n\n    def test_reset_hints(self):\n        w = self.widget\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"] +\n                        [DiscreteVariable(\"m\", values=tuple(\"xy\"))],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(c) for c in \"ef\"])\n        data = Table.from_list(domain, [[0] * 6])\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"b\"] = Normalize.Leave\n        w.cont_var_hints[\"f\"] = Normalize.Normalize11\n        w.cont_var_hints[\"x\"] = Normalize.Normalize11\n        w.disc_var_hints[DefaultKey] = Continuize.Indicators\n        w.cont_var_hints[\"m\"] = Continuize.Remove\n\n        self.send_signal(w.Inputs.data, data)\n        w._on_reset_hints()\n\n        self.assertEqual(w.cont_var_hints[DefaultKey], Normalize.Leave)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.FirstAsBase)\n\n    def test_change_hints_disc(self):\n        w = self.widget\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # exerc ind ang\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"chest pain\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"exerc ind ang\"], Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # chest pain\n        dselmod.select(dmod.index(0, 0),\n                       QItemSelectionModel.Select)  # gender\n        dgroup.button(99).setChecked(True)\n        dgroup.idClicked.emit(99)\n        self.assertFalse(\"chest pain\" in w.disc_var_hints)\n        self.assertFalse(\"gender\" in w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"rest ECG\"], Continuize.Remove)\n\n        self.assertEqual(dmod.index(0, 0).data(dmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            dmod.index(3, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dview.select_default()\n        dgroup.button(Continuize.AsOrdinal).setChecked(True)\n        dgroup.idClicked.emit(Continuize.AsOrdinal)\n        self.assertEqual(w.disc_var_hints[DefaultKey], Continuize.AsOrdinal)\n\n    def test_change_hints_disc_class_meta(self):\n        w = self.widget\n        dview = w.disc_view\n        dmod = dview.model()\n        dselmod = dview.selectionModel()\n        dgroup = w.disc_group\n\n        domain = Domain([DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"abc\"],\n                        DiscreteVariable(\"d\", values=[\"0\", \"1\"]),\n                        [DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        dselmod.select(dmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        dselmod.select(dmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        dselmod.select(dmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        dgroup.button(Continuize.Remove).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"e\"], Continuize.Remove)\n        self.assertEqual(w.disc_var_hints[\"d\"], Continuize.Remove)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Remove].short_desc, True))\n\n        dgroup.button(DefaultId).setChecked(True)\n        dgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.disc_var_hints)\n        self.assertEqual(w.disc_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.disc_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[DefaultId].short_desc, True))\n\n        dgroup.button(Continuize.Leave).setChecked(True)\n        dgroup.idClicked.emit(Continuize.Leave)\n        self.assertEqual(w.disc_var_hints[\"b\"], Continuize.Leave)\n        self.assertNotIn(\"e\", w.disc_var_hints)\n        self.assertNotIn(\"d\", w.disc_var_hints)\n        self.assertEqual(\n            dmod.index(1, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, True))\n        self.assertEqual(\n            dmod.index(4, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n        self.assertEqual(\n            dmod.index(8, 0).data(dmod.HintRole),\n            (DiscreteOptions[Continuize.Leave].short_desc, False))\n\n    def test_change_hints_cont(self):\n        w = self.widget\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(3, 0),\n                       QItemSelectionModel.Select)  # max HR\n        cgroup.button(Normalize.Normalize11).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Normalize11)\n\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"cholesterol\"], Normalize.Normalize11)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        cselmod.select(cmod.index(2, 0),\n                       QItemSelectionModel.ClearAndSelect)  # cholesterol\n        cselmod.select(cmod.index(0, 0),\n                       QItemSelectionModel.Select)  # age\n        cgroup.button(99).setChecked(True)\n        cgroup.idClicked.emit(99)\n        self.assertFalse(\"age\" in w.cont_var_hints)\n        self.assertFalse(\"cholesterol\" in w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"max HR\"], Normalize.Normalize11)\n\n        self.assertEqual(cmod.index(0, 0).data(cmod.HintRole),\n                         (\"preset\", False))\n        self.assertEqual(\n            cmod.index(3, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Normalize11].short_desc, True))\n\n    def test_change_hints_cont_class_meta(self):\n        w = self.widget\n        cview = w.cont_view\n        cmod = cview.model()\n        cselmod = cview.selectionModel()\n        cgroup = w.cont_group\n\n        domain = Domain([ContinuousVariable(x) for x in \"abc\"],\n                        ContinuousVariable(\"d\"),\n                        [ContinuousVariable(x) for x in \"efg\"])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        cselmod.select(cmod.index(1, 0),\n                       QItemSelectionModel.ClearAndSelect)  # attribute b\n        cselmod.select(cmod.index(4, 0),\n                       QItemSelectionModel.Select)  # meta e\n        cselmod.select(cmod.index(8, 0),\n                       QItemSelectionModel.Select)  # class d\n        cgroup.button(Normalize.Center).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"e\"], Normalize.Center)\n        self.assertEqual(w.cont_var_hints[\"d\"], Normalize.Center)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Center].short_desc, True))\n\n        cgroup.button(DefaultId).setChecked(True)\n        cgroup.idClicked.emit(DefaultId)\n        self.assertNotIn(\"b\", w.cont_var_hints)\n        self.assertEqual(w.cont_var_hints[\"e\"], DefaultId)\n        self.assertEqual(w.cont_var_hints[\"d\"], DefaultId)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, False))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[DefaultId].short_desc, True))\n\n        cgroup.button(Normalize.Leave).setChecked(True)\n        cgroup.idClicked.emit(Normalize.Leave)\n        self.assertEqual(w.cont_var_hints[\"b\"], Normalize.Leave)\n        self.assertNotIn(\"e\", w.cont_var_hints)\n        self.assertNotIn(\"d\", w.cont_var_hints)\n        self.assertEqual(\n            cmod.index(1, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, True))\n        self.assertEqual(\n            cmod.index(4, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n        self.assertEqual(\n            cmod.index(8, 0).data(cmod.HintRole),\n            (ContinuousOptions[Normalize.Leave].short_desc, False))\n\n    def test_is_attr_and_default(self):\n        w = self.widget\n        a, b, d, e, f = (ContinuousVariable(x) for x in \"abdef\")\n        c, g = (DiscreteVariable(x, values=[\"0\", \"1\"]) for x in \"cg\")\n        domain = Domain([a, b, c], d, [e, f, g])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertTrue(w.is_attr(a))\n        self.assertTrue(w.is_attr(b))\n        self.assertTrue(w.is_attr(c))\n        self.assertFalse(w.is_attr(d))\n        self.assertFalse(w.is_attr(e))\n        self.assertFalse(w.is_attr(f))\n        self.assertFalse(w.is_attr(g))\n\n        self.assertEqual(w.default_for_var(a), DefaultId)\n        self.assertEqual(w.default_for_var(c), DefaultId)\n        self.assertEqual(w.default_for_var(d), Normalize.Leave)\n        self.assertEqual(w.default_for_var(e), Normalize.Leave)\n        self.assertEqual(w.default_for_var(g), Continuize.Leave)\n\n    def test_hint_for_var(self):\n        w = self.widget\n        c1, c2, c3, c4, c5 = (ContinuousVariable(f\"c{x}\") for x in range(1, 6))\n        d1, d2, d3, d4 = (DiscreteVariable(f\"d{x}\", values=[\"0\", \"1\"]) for x in range(1, 5))\n        domain = Domain([c1, c2, d1, d2], c5, [c3, c4, d3, d4])\n        data = Table.from_list(domain, [[1] * 7] * 2)\n        w.cont_var_hints = {\n            DefaultKey: Normalize.Center,\n            \"c1\": Normalize.Scale,\n            \"c3\": Normalize.Standardize,\n        }\n        w.disc_var_hints = {\n            DefaultKey: Continuize.FrequentAsBase,\n            \"d1\": Continuize.Remove,\n            \"d3\": Continuize.Indicators\n        }\n        self.send_signal(w.Inputs.data, data)\n\n        self.assertEqual(w._hint_for_var(c1), Normalize.Scale)\n        self.assertEqual(w._hint_for_var(c2), Normalize.Center)\n        self.assertEqual(w._hint_for_var(c3), Normalize.Standardize)\n        self.assertEqual(w._hint_for_var(c4), Normalize.Leave)\n\n        self.assertEqual(w._hint_for_var(d1), Continuize.Remove)\n        self.assertEqual(w._hint_for_var(d2), Continuize.FrequentAsBase)\n        self.assertEqual(w._hint_for_var(d3), Continuize.Indicators)\n        self.assertEqual(w._hint_for_var(d4), Continuize.Leave)\n\n    def test_transformations(self):\n        domain = Domain([DiscreteVariable(c, values=\"abc\")\n                         for c in (\"default\", \"leave\", \"first\", \"frequent\",\n                                   \"one-hot\", \"remove-if\", \"remove\", \"ordinal\",\n                                   \"normordinal\")],\n                         DiscreteVariable(\"y\", values=\"abc\"),\n                        [ContinuousVariable(c)\n                         for c in (\"cdefault\", \"cleave\",\n                                   \"cstandardize\", \"ccenter\", \"cscale\",\n                                   \"cnormalize11\", \"cnormalize01\")]\n                        )\n        data = Table.from_list(domain,\n                               [[x] * 17 for x in range(3)] + [[2] * 17])\n\n        w = self.widget\n        w.disc_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.attributes, DiscreteOptions)\n            if id_ != 99\n        }\n        w.disc_var_hints[DefaultKey] = Continuize.FrequentAsBase\n\n        w.cont_var_hints = {\n            var.name: id_\n            for var, id_ in zip(domain.metas, ContinuousOptions)\n            if id_ != 99\n        }\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n\n        self.send_signal(w.Inputs.data, data)\n        outp = self.get_output(w.Outputs.data)\n\n        np.testing.assert_almost_equal(\n            outp.X,\n            [[1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],\n             [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0.5],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             [0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1],\n             ]\n        )\n        np.testing.assert_almost_equal(\n            outp.Y,\n            [0, 1, 2, 2]\n        )\n        np.testing.assert_almost_equal(\n            outp.metas,\n            [[0, 0, -1.50755672, -1.25, 0, -1, 0],\n             [1, 1, -0.30151134, -0.25, 1.20604538, 0, 0.5],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             [2, 2, 0.90453403, 0.75, 2.41209076, 1, 1],\n             ]\n        )\n\n    def test_send_report(self):\n        w = self.widget\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n        w.continuize_class = True\n        w.disc_var_hints[DefaultKey] = Continuize.AsOrdinal\n        w.disc_var_hints[\"chest pain\"] \\\n            = w.disc_var_hints[\"rest ECG\"] \\\n            = Continuize.Remove\n        w.disc_var_hints[\"exerc ind ang\"] = Continuize.FirstAsBase\n\n        w.cont_var_hints[DefaultKey] = Normalize.Center\n        w.cont_var_hints[\"cholesterol\"] = Normalize.Scale\n\n        self.send_signal(w.Inputs.data, Table(\"heart_disease\"))\n        self.widget.send_report()\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=2)\n        )\n        self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=4,\n                                 class_treatment=3)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=4,\n                                 class_treatment=0)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], 4)\n\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=Continuize.Remove)\n        )\n        self.send_signal(widget.Inputs.data, data)\n        self.assertNotIn(\"y\", widget.disc_var_hints)\n        self.assertEqual(widget.disc_var_hints[DefaultKey], Continuize.Remove)\n\n\nclass TestModelsAndViews(GuiTest):\n    def test_contmodel(self):\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        ContinuousVariable(\"y\"))\n        model = ContDomainModel(ContinuousVariable)\n        model.set_domain(domain)\n\n        ind = model.index(0, 0)\n        self.assertEqual(ind.data()[0], \"a\")\n        self.assertEqual(ind.data(model.FilterRole)[0], \"a\")\n        self.assertIsNone(ind.data(Qt.ToolTipRole))\n\n        ind = model.index(1, 0)\n        model.setData(ind, (\"mega encoding\", True), model.HintRole)\n        self.assertEqual(ind.data(), (\"b\", \"mega encoding\", True))\n        self.assertEqual(ind.data(model.HintRole), (\"mega encoding\", True))\n        self.assertIn(\"b\", ind.data(model.FilterRole))\n        self.assertIn(\"mega encoding\", ind.data(model.FilterRole))\n        self.assertNotIn(\"bmega encoding\", ind.data(model.FilterRole))\n        self.assertIsNone(ind.data(Qt.ToolTipRole))\n\n        ind = model.index(3, 0)  # separator\n        self.assertIsNone(ind.data())\n        self.assertIsNone(ind.data(model.HintRole))\n        self.assertIsNone(ind.data(model.FilterRole))\n\n    def test_defaultcontmodel(self):\n        model = DefaultContModel()\n        self.assertEqual(1, model.rowCount(QModelIndex()))\n        self.assertEqual(1, model.columnCount(QModelIndex()))\n        ind = model.index(0, 0)\n        spy = QSignalSpy(model.dataChanged)\n        model.setMethod(\"mega encoding\")\n        self.assertEqual(spy[0][0].row(), 0)\n        self.assertEqual(ind.data(), \"Preset: mega encoding\")\n        self.assertIsNotNone(ind.data(Qt.DecorationRole))\n        self.assertIsNotNone(ind.data(Qt.ToolTipRole))\n\n\nclass TestListViewDelegate(unittest.TestCase):\n    def test_displaytext(self):\n        delegate = ListViewSearch.Delegate()\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a\")\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", True), Mock()),\n                         \"a: foo\")\n        delegate.set_default_hints(True)\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a: foo\")\n        delegate.set_default_hints(False)\n        self.assertEqual(delegate.displayText((\"a\", \"foo\", False), Mock()),\n                         \"a\")\n\n    @patch.object(SeparatedListDelegate, \"initStyleOption\")\n    def test_bold(self, _):\n        delegate = ListViewSearch.Delegate()\n        option = Mock()\n        index = Mock()\n        index.data = lambda role: (\"foo\", True) \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(True)\n        index.data = lambda role: (\"foo\", False) \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(False)\n        index.data = lambda role: None \\\n            if role == ContDomainModel.HintRole else None\n        delegate.initStyleOption(option, index)\n        option.font.setBold.assert_called_with(False)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.35.0.dev0+fd78b8b to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1\nProcessing dependencies for Orange3==3.35.0.dev0+fd78b8b\nSearching for xlsxwriter\nReading https://pypi.org/simple/xlsxwriter/\nDownloading https://files.pythonhosted.org/packages/a7/ea/53d1fe468e63e092cf16e2c18d16f50c29851242f9dd12d6a66e0d7f0d02/XlsxWriter-3.2.0-py3-none-any.whl#sha256=ecfd5405b3e0e228219bcaf24c2ca0915e012ca9464a14048021d21a995d490e\nBest match: XlsxWriter 3.2.0\nProcessing XlsxWriter-3.2.0-py3-none-any.whl\nInstalling XlsxWriter-3.2.0-py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages\nAdding XlsxWriter 3.2.0 to easy-install.pth file\nInstalling vba_extract.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/XlsxWriter-3.2.0-py3.7.egg\nSearching for xlrd>=1.2.0\nReading https://pypi.org/simple/xlrd/\nDownloading https://files.pythonhosted.org/packages/a6/0c/c2a72d51fe56e08a08acc85d13013558a2d793028ae7385448a6ccdfae64/xlrd-2.0.1-py2.py3-none-any.whl#sha256=6a33ee89877bd9abc1158129f6e94be74e2679636b8a205b43b85206c3f0bbdd\nBest match: xlrd 2.0.1\nProcessing xlrd-2.0.1-py2.py3-none-any.whl\nInstalling xlrd-2.0.1-py2.py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages\nAdding xlrd 2.0.1 to easy-install.pth file\nInstalling runxlrd.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/xlrd-2.0.1-py3.7.egg\nSearching for serverfiles\nReading https://pypi.org/simple/serverfiles/\nDownloading https://files.pythonhosted.org/packages/33/36/794fe1c4ed29b0f56a26d72e956baf0285d8fe9e29faf36797a28a8ad45b/serverfiles-0.3.1.tar.gz#sha256=5e10fc32e758791e3735bc08bce2ed4702a83b1e45ab96c5d59cc8aeecfbebe1\nBest match: serverfiles 0.3.1\nProcessing serverfiles-0.3.1.tar.gz\nWriting /tmp/easy_install-dq78wkto/serverfiles-0.3.1/setup.cfg\nRunning serverfiles-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-dq78wkto/serverfiles-0.3.1/egg-dist-tmp-67uv8cgp\ncreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nExtracting serverfiles-0.3.1-py3.7.egg to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nSearching for scipy>=1.9\nReading https://pypi.org/simple/scipy/\nDownloading https://files.pythonhosted.org/packages/d9/7b/2b8ac283cf32465ed08bc20a83d559fe7b174a484781702ba8accea001d6/scipy-1.15.0.tar.gz#sha256=300742e2cc94e36a2880ebe464a1c8b4352a7b0f3e36ec3d2ac006cdbe0219ac\nBest match: scipy 1.15.0\nProcessing scipy-1.15.0.tar.gz\nVerifying Orange installation...\n❌ Orange verification failed\nPython 3.7 installation failed, trying Python 3.8...\nAttempting installation with Python 3.8...\nrunning build_ext\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_contingency.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/data\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_io.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_io.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_variable.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/distance/_distance.c -o build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/projection/_som.c -o build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.classification._simple_tree' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\nrunning develop\nrunning egg_info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.35.0.dev0+fd78b8b to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1\nProcessing dependencies for Orange3==3.35.0.dev0+fd78b8b\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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for setuptools==75.3.0\nBest match: setuptools 75.3.0\nAdding setuptools 75.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for scipy==1.10.1\nBest match: scipy 1.10.1\nAdding scipy 1.10.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for scikit-learn==1.1.3\nBest match: scikit-learn 1.1.3\nAdding scikit-learn 1.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for requests==2.32.3\nBest match: requests 2.32.3\nAdding requests 2.32.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for qtconsole==5.6.1\nBest match: qtconsole 5.6.1\nAdding qtconsole 5.6.1 to easy-install.pth file\nInstalling jupyter-qtconsole script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for PyYAML==6.0.2\nBest match: PyYAML 6.0.2\nAdding PyYAML 6.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pyqtgraph==0.13.3\nBest match: pyqtgraph 0.13.3\nAdding pyqtgraph 0.13.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pygments==2.19.1\nBest match: pygments 2.19.1\nAdding pygments 2.19.1 to easy-install.pth file\nInstalling pygmentize script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pip==24.3.1\nBest match: pip 24.3.1\nAdding pip 24.3.1 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pandas==2.0.3\nBest match: pandas 2.0.3\nAdding pandas 2.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for openpyxl==3.1.5\nBest match: openpyxl 3.1.5\nAdding openpyxl 3.1.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for numpy==1.24.4\nBest match: numpy 1.24.4\nAdding numpy 1.24.4 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling f2py3.8 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for networkx==3.1\nBest match: networkx 3.1\nAdding networkx 3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for matplotlib==3.7.5\nBest match: matplotlib 3.7.5\nAdding matplotlib 3.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for keyrings.alt==5.0.2\nBest match: keyrings.alt 5.0.2\nAdding keyrings.alt 5.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for keyring==25.5.0\nBest match: keyring 25.5.0\nAdding keyring 25.5.0 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for joblib==1.4.2\nBest match: joblib 1.4.2\nAdding joblib 1.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for httpx==0.28.1\nBest match: httpx 0.28.1\nAdding httpx 0.28.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for threadpoolctl==3.5.0\nBest match: threadpoolctl 3.5.0\nAdding threadpoolctl 3.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for urllib3==2.2.3\nBest match: urllib3 2.2.3\nAdding urllib3 2.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for packaging==24.2\nBest match: packaging 24.2\nAdding packaging 24.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for QtPy==2.4.2\nBest match: QtPy 2.4.2\nAdding QtPy 2.4.2 to easy-install.pth file\nInstalling qtpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for ipykernel==6.29.5\nBest match: ipykernel 6.29.5\nAdding ipykernel 6.29.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for jupyter-client==8.6.3\nBest match: jupyter-client 8.6.3\nAdding jupyter-client 8.6.3 to easy-install.pth file\nInstalling jupyter-kernel script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for jupyter-core==5.7.2\nBest match: jupyter-core 5.7.2\nAdding jupyter-core 5.7.2 to easy-install.pth file\nInstalling jupyter script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for traitlets==5.14.3\nBest match: traitlets 5.14.3\nAdding traitlets 5.14.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for tzdata==2024.2\nBest match: tzdata 2024.2\nAdding tzdata 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for typing-extensions==4.12.2\nBest match: typing-extensions 4.12.2\nAdding typing-extensions 4.12.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for qasync==0.27.1\nBest match: qasync 0.27.1\nAdding qasync 0.27.1 to easy-install.pth file\ndetected new path './setuptools/_vendor'\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for requests-cache==1.2.1\nBest match: requests-cache 1.2.1\nAdding requests-cache 1.2.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for et-xmlfile==2.0.0\nBest match: et-xmlfile 2.0.0\nAdding et-xmlfile 2.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for importlib-resources==6.4.5\nBest match: importlib-resources 6.4.5\nAdding importlib-resources 6.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pillow==10.4.0\nBest match: pillow 10.4.0\nAdding pillow 10.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for kiwisolver==1.4.7\nBest match: kiwisolver 1.4.7\nAdding kiwisolver 1.4.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for fonttools==4.55.3\nBest match: fonttools 4.55.3\nAdding fonttools 4.55.3 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for cycler==0.12.1\nBest match: cycler 0.12.1\nAdding cycler 0.12.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for contourpy==1.1.1\nBest match: contourpy 1.1.1\nAdding contourpy 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for jaraco.context==6.0.1\nBest match: jaraco.context 6.0.1\nAdding jaraco.context 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for jaraco.classes==3.4.0\nBest match: jaraco.classes 3.4.0\nAdding jaraco.classes 3.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for importlib-metadata==8.5.0\nBest match: importlib-metadata 8.5.0\nAdding importlib-metadata 8.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for jaraco.functools==4.1.0\nBest match: jaraco.functools 4.1.0\nAdding jaraco.functools 4.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for httpcore==1.0.7\nBest match: httpcore 1.0.7\nAdding httpcore 1.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for anyio==4.5.2\nBest match: anyio 4.5.2\nAdding anyio 4.5.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for tornado==6.4.2\nBest match: tornado 6.4.2\nAdding tornado 6.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pyzmq==26.2.0\nBest match: pyzmq 26.2.0\nAdding pyzmq 26.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for psutil==6.1.1\nBest match: psutil 6.1.1\nAdding psutil 6.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for nest-asyncio==1.6.0\nBest match: nest-asyncio 1.6.0\nAdding nest-asyncio 1.6.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for matplotlib-inline==0.1.7\nBest match: matplotlib-inline 0.1.7\nAdding matplotlib-inline 0.1.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for ipython==8.12.3\nBest match: ipython 8.12.3\nAdding ipython 8.12.3 to easy-install.pth file\nInstalling ipython script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for debugpy==1.8.11\nBest match: debugpy 1.8.11\nAdding debugpy 1.8.11 to easy-install.pth file\nInstalling debugpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for comm==0.2.2\nBest match: comm 0.2.2\nAdding comm 0.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for platformdirs==4.3.6\nBest match: platformdirs 4.3.6\nAdding platformdirs 4.3.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for cattrs==24.1.2\nBest match: cattrs 24.1.2\nAdding cattrs 24.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for attrs==24.3.0\nBest match: attrs 24.3.0\nAdding attrs 24.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for zipp==3.20.2\nBest match: zipp 3.20.2\nAdding zipp 3.20.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for backports.tarfile==1.2.0\nBest match: backports.tarfile 1.2.0\nbackports.tarfile 1.2.0 is already the active version in easy-install.pth\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for more-itertools==10.5.0\nBest match: more-itertools 10.5.0\nAdding more-itertools 10.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pexpect==4.9.0\nBest match: pexpect 4.9.0\nAdding pexpect 4.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for stack-data==0.6.3\nBest match: stack-data 0.6.3\nAdding stack-data 0.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for prompt-toolkit==3.0.48\nBest match: prompt-toolkit 3.0.48\nAdding prompt-toolkit 3.0.48 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pickleshare==0.7.5\nBest match: pickleshare 0.7.5\nAdding pickleshare 0.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for jedi==0.19.2\nBest match: jedi 0.19.2\nAdding jedi 0.19.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for decorator==5.1.1\nBest match: decorator 5.1.1\nAdding decorator 5.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for backcall==0.2.0\nBest match: backcall 0.2.0\nAdding backcall 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for cffi==1.17.1\nBest match: cffi 1.17.1\nAdding cffi 1.17.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for ptyprocess==0.7.0\nBest match: ptyprocess 0.7.0\nAdding ptyprocess 0.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pure-eval==0.2.3\nBest match: pure-eval 0.2.3\nAdding pure-eval 0.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for asttokens==3.0.0\nBest match: asttokens 3.0.0\nAdding asttokens 3.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for executing==2.1.0\nBest match: executing 2.1.0\nAdding executing 2.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for wcwidth==0.2.13\nBest match: wcwidth 0.2.13\nAdding wcwidth 0.2.13 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for parso==0.8.4\nBest match: parso 0.8.4\nAdding parso 0.8.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nSearching for pycparser==2.22\nBest match: pycparser 2.22\nAdding pycparser 2.22 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages\nFinished processing dependencies for Orange3==3.35.0.dev0+fd78b8b\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.8\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 57ms\nPrepared 18 packages in 2ms\nInstalled 18 packages in 187ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and all of:\n          scipy>=1.9.0,<=1.9.1\n          scipy>=1.10.0,<=1.10.1\n      depend on Python>=3.8,<3.12, we can conclude that all of:\n          scipy>=1.9.0,<=1.9.1\n          scipy>=1.10.0,<=1.10.1\n       cannot be used.\n      And because only the following versions of scipy are available:\n          scipy<=1.9.0\n          scipy==1.9.1\n          scipy==1.9.2\n          scipy==1.9.3\n          scipy==1.10.0\n          scipy==1.10.1\n          scipy==1.11.0\n          scipy==1.11.1\n          scipy==1.11.2\n          scipy==1.11.3\n          scipy==1.11.4\n          scipy==1.12.0\n          scipy==1.13.0\n          scipy==1.13.1\n          scipy==1.14.0\n          scipy==1.14.1\n          scipy==1.15.0\n      we can conclude that all of:\n          scipy>=1.9.0,<1.9.2\n          scipy>1.9.3,<1.11.0\n       cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.9.2,<=1.9.3 depends on Python>=3.8,\n      we can conclude that scipy>=1.9.2,<=1.9.3 cannot be used.\n      And because we know from (1) that all of:\n          scipy>=1.9.0,<1.9.2\n          scipy>1.9.3,<1.11.0\n       cannot be used, we can conclude that scipy>=1.9.0,<1.11.0 cannot be used.\n      And because scipy==1.11.0 was yanked (reason: License Violation), we can conclude that scipy>=1.9.0,<1.11.1 cannot be\n      used. (2)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.11.1,<=1.11.3 depends on\n      Python>=3.9,<3.13, we can conclude that scipy>=1.11.1,<=1.11.3 cannot be used.\n      And because we know from (2) that scipy>=1.9.0,<1.11.1 cannot be used, we can conclude that scipy>=1.9.0,<1.11.4 cannot\n      be used. (3)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.11.4,<=1.13.1 depends on\n      Python>=3.9, we can conclude that scipy>=1.11.4,<=1.13.1 cannot be used.\n      And because we know from (3) that scipy>=1.9.0,<1.11.4 cannot be used, we can conclude that scipy>=1.9.0,<1.14.0 cannot\n      be used. (4)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.8 and scipy>=1.14.0 depends on Python>=3.10, we can\n      conclude that scipy>=1.14.0 cannot be used.\n      And because we know from (4) that scipy>=1.9.0,<1.14.0 cannot be used, we can conclude that scipy>=1.9.0 cannot be used.\n      And because you require scipy>=1.9, we can conclude that your requirements are unsatisfiable.\n\n      hint: Pre-releases are available for `scipy` in the requested range (e.g., 1.15.0rc2), but pre-releases weren't enabled\n      (try: `--prerelease=allow`)\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and pyqtgraph>=0.13.1,<=0.13.3 depends on\n      Python>=3.8, we can conclude that pyqtgraph>=0.13.1,<=0.13.3 cannot be used.\n      And because only the following versions of pyqtgraph are available:\n          pyqtgraph<=0.13.1\n          pyqtgraph==0.13.2\n          pyqtgraph==0.13.3\n          pyqtgraph==0.13.4\n          pyqtgraph==0.13.5\n          pyqtgraph==0.13.6\n          pyqtgraph==0.13.7\n      we can conclude that pyqtgraph>=0.13.1,<0.13.4 cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pyqtgraph>=0.13.4 depends on Python>=3.9, we\n      can conclude that pyqtgraph>=0.13.4 cannot be used.\n      And because we know from (1) that pyqtgraph>=0.13.1,<0.13.4 cannot be used, we can conclude that pyqtgraph>=0.13.1 cannot\n      be used.\n      And because you require pyqtgraph>=0.13.1, we can conclude that your requirements are unsatisfiable.\nResolved 2 packages in 4ms\nInstalled 2 packages in 11ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 159ms\nInstalled 16 packages in 1.96s\n + catboost==1.2.7\n + cycler==0.11.0\n + fonttools==4.38.0\n + graphviz==0.20.1\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + pandas==1.3.5\n + pillow==9.5.0\n + plotly==5.18.0\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + pytz==2024.2\n + scipy==1.7.3\n + six==1.17.0\n + tenacity==8.2.3\n + xgboost==1.6.2\nResolved 5 packages in 12ms\nInstalled 3 packages in 31ms\n + joblib==1.3.2\n + scikit-learn==1.0.2\n + threadpoolctl==3.1.0\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3427:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3427 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4883:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4883 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5629:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5629 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5750:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5750 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5756:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5756 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7217:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7217 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7874:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7874 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7934:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7934 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.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_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\nerror: Couldn't find a setup script in /tmp/easy_install-r1xts9yi/scipy-1.15.0.tar.gz\nUsing CPython 3.8.20\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 15 packages in 172ms\nPrepared 15 packages in 3ms\nInstalled 15 packages in 142ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + iniconfig==2.0.0\n + numpy==1.24.4\n + packaging==24.2\n + pluggy==1.5.0\n + pyqt5==5.15.11\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.15.0\n + pyqtwebengine==5.15.7\n + pyqtwebengine-qt5==5.15.16\n + pytest==8.3.4\n + setuptools==75.3.0\n + tomli==2.2.1\n + wheel==0.45.1\nResolved 59 packages in 119ms\nInstalled 55 packages in 172ms\n + anyio==4.5.2\n + backports-tarfile==1.2.0\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.17.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + contourpy==1.1.1\n + cryptography==44.0.0\n + cycler==0.12.1\n + et-xmlfile==2.0.0\n + fonttools==4.55.3\n + h11==0.14.0\n + httpcore==1.0.7\n + httpx==0.28.1\n + idna==3.10\n + importlib-metadata==8.5.0\n + importlib-resources==6.4.5\n + jaraco-classes==3.4.0\n + jaraco-context==6.0.1\n + jaraco-functools==4.1.0\n + jeepney==0.8.0\n + joblib==1.4.2\n + keyring==25.5.0\n + keyrings-alt==5.0.2\n + kiwisolver==1.4.7\n + matplotlib==3.7.5\n + more-itertools==10.5.0\n + networkx==3.1\n + openpyxl==3.1.5\n + opentsne==1.0.1\n + pandas==2.0.3\n + pillow==10.4.0\n + pip==24.3.1\n + pycparser==2.22\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.2\n + requests==2.32.3\n + scikit-learn==1.1.3\n + scipy==1.10.1\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + threadpoolctl==3.5.0\n + typing-extensions==4.12.2\n + tzdata==2024.2\n + urllib3==2.2.3\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\n + zipp==3.20.2\nResolved 64 packages in 170ms\nInstalled 41 packages in 200ms\n + anyqt==0.2.0\n + asttokens==3.0.0\n + attrs==24.3.0\n + backcall==0.2.0\n + cattrs==24.1.2\n + comm==0.2.2\n + commonmark==0.9.1\n + debugpy==1.8.11\n + decorator==5.1.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + executing==2.1.0\n + ipykernel==6.29.5\n + ipython==8.12.3\n + jedi==0.19.2\n + jupyter-client==8.6.3\n + jupyter-core==5.7.2\n + matplotlib-inline==0.1.7\n + nest-asyncio==1.6.0\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + parso==0.8.4\n + pexpect==4.9.0\n + pickleshare==0.7.5\n + platformdirs==4.3.6\n + prompt-toolkit==3.0.48\n + psutil==6.1.1\n + ptyprocess==0.7.0\n + pure-eval==0.2.3\n + pygments==2.19.1\n + pyqtgraph==0.13.3\n + pyzmq==26.2.0\n + qasync==0.27.1\n + qtconsole==5.6.1\n + qtpy==2.4.2\n + requests-cache==1.2.1\n + stack-data==0.6.3\n + tornado==6.4.2\n + traitlets==5.14.3\n + url-normalize==1.4.3\n + wcwidth==0.2.13\nResolved 2 packages in 2ms\nInstalled 2 packages in 7ms\n + psycopg2==2.9.10\n + pymssql==2.3.2\nResolved 23 packages in 14ms\nInstalled 6 packages in 715ms\n + catboost==1.2.7\n + graphviz==0.20.3\n + nvidia-nccl-cu12==2.24.3\n + plotly==5.24.1\n + tenacity==9.0.0\n + xgboost==2.1.3\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3427:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3427 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4883:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4883 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5629:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5629 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5750:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5750 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5756:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5756 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7217:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7217 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7874:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7874 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7934:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7934 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` and ``easy_install``.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://github.com/pypa/setuptools/issues/917 for details.\n        ********************************************************************************\n\n!!\n  easy_install.initialize_options(self)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1/.venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` directly.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.\n        ********************************************************************************\n\n!!\n  self.initialize_options()\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 0,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 33 items\n\nr2e_tests/test_1.py sss..............................                    [100%]\n\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_cont\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_cont_class_meta\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_disc\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_disc_class_meta\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_check_unsuppoerted_sparse_continuous\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_check_unsuppoerted_sparse_discrete\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_commit_calls_prepare_output\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_continuous\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_empty_data\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_hint_for_var\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_image_export\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_is_attr_and_default\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_migrate_settings_to_v3\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_migrate_settings_to_v3_class_treatment\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_one_column_equal_values\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_one_column_nan_values_normalize_sd\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_one_column_nan_values_normalize_span\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_reset_hints\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_send_report\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_set_hints_on_new_data\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_transformations\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_update_cont_radio_buttons\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_update_cont_radio_buttons_mixed\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_update_disc_radio_buttons_mixed\nPASSED r2e_tests/test_1.py::TestModelsAndViews::test_contmodel\nPASSED r2e_tests/test_1.py::TestModelsAndViews::test_defaultcontmodel\nPASSED r2e_tests/test_1.py::TestListViewDelegate::test_bold\nPASSED r2e_tests/test_1.py::TestListViewDelegate::test_displaytext\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\n======================== 30 passed, 3 skipped in 5.76s =========================\nWidgets left: 0    Max widgets: 2992 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd78b8bb1aa29c9d3f0e7b2a2033657ba640edc1\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 33 items\n\nr2e_tests/test_1.py sss............FF................                    [100%]\n\n=================================== FAILURES ===================================\n_________________ TestOWContinuize.test_migrate_settings_to_v3 _________________\n\nself = <r2e_tests.test_1.TestOWContinuize testMethod=test_migrate_settings_to_v3>\n\n    def test_migrate_settings_to_v3(self):\n        # why not?, pylint: disable=use-dict-literal\n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=0))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Leave)\n    \n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=True))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize01)\n    \n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=1, zero_based=False))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Normalize11)\n    \n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(continuous_treatment=2))\n        self.assertEqual(widget.cont_var_hints[DefaultKey],\n                         Normalize.Standardize)\n    \n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=2)\n        )\n>       self.assertEqual(widget.disc_var_hints[DefaultKey],\n                         Continuize.Indicators)\nE       AssertionError: 2 != 1\n\nr2e_tests/test_1.py:765: AssertionError\n_________ TestOWContinuize.test_migrate_settings_to_v3_class_treatment _________\n\nself = <r2e_tests.test_1.TestOWContinuize testMethod=test_migrate_settings_to_v3_class_treatment>\n\n    def test_migrate_settings_to_v3_class_treatment(self):\n        # why not?, pylint: disable=use-dict-literal\n        domain = Domain([ContinuousVariable(c) for c in \"abc\"],\n                        DiscreteVariable(\"y\"))\n        data = Table.from_list(domain, [[0] * 4] * 2)\n    \n        widget = self.create_widget(\n            OWContinuize,\n            stored_settings=dict(multinomial_treatment=4,\n                                 class_treatment=3)\n        )\n        self.send_signal(widget.Inputs.data, data)\n>       self.assertEqual(widget.disc_var_hints[\"y\"], Continuize.Indicators)\nE       AssertionError: 3 != 1\n\nr2e_tests/test_1.py:780: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_cont\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_cont_class_meta\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_disc\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_change_hints_disc_class_meta\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_check_unsuppoerted_sparse_continuous\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_check_unsuppoerted_sparse_discrete\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_commit_calls_prepare_output\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_continuous\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_empty_data\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_hint_for_var\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_image_export\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_is_attr_and_default\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_one_column_equal_values\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_one_column_nan_values_normalize_sd\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_one_column_nan_values_normalize_span\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_reset_hints\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_send_report\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_set_hints_on_new_data\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_transformations\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_update_cont_radio_buttons\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_update_cont_radio_buttons_mixed\nPASSED r2e_tests/test_1.py::TestOWContinuize::test_update_disc_radio_buttons_mixed\nPASSED r2e_tests/test_1.py::TestModelsAndViews::test_contmodel\nPASSED r2e_tests/test_1.py::TestModelsAndViews::test_defaultcontmodel\nPASSED r2e_tests/test_1.py::TestListViewDelegate::test_bold\nPASSED r2e_tests/test_1.py::TestListViewDelegate::test_displaytext\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWContinuize::test_migrate_settings_to_v3 - A...\nFAILED r2e_tests/test_1.py::TestOWContinuize::test_migrate_settings_to_v3_class_treatment\n=================== 2 failed, 28 passed, 3 skipped in 3.94s ====================\nWidgets left: 0    Max widgets: 2816 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/data/owcontinuize.py Orange/widgets/data/tests/test_owcontinuize.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Incorrect Migration of `multinomial_treatment` and `class_treatment` Settings Leads to Unexpected Behavior

**Description:**
When migrating settings from older versions, the `multinomial_treatment` and `class_treatment` values are not being mapped correctly to their new representations. This results in incorrect treatment hints being applied, which affects the behavior of the `OWContinuize` widget.

**Example Buggy Code:**
```python
widget = OWContinuize(stored_settings={
    'multinomial_treatment': 2,  # Expected to map to Continuize.Indicators
    'class_treatment': 3          # Expected to map to Continuize.AsOrdinal
})

# After migration, the widget's disc_var_hints should reflect the correct mappings
print(widget.disc_var_hints[DefaultKey])  # Unexpected output: 2 instead of Continuize.Indicators
print(widget.disc_var_hints['y'])         # Unexpected output: 3 instead of Continuize.AsOrdinal
```

**Expected Behavior:**
- The `multinomial_treatment` value of `2` should correctly map to `Continuize.Indicators`.
- The `class_treatment` value of `3` should correctly map to `Continuize.AsOrdinal`.
- As a result, `widget.disc_var_hints` should reflect these mappings accurately, ensuring the widget behaves as intended.

**Actual Behavior:**
- The `multinomial_treatment` value of `2` is incorrectly retained as `2` instead of mapping to `Continuize.Indicators`.
- The `class_treatment` value of `3` is incorrectly retained as `3` instead of mapping to `Continuize.AsOrdinal`.
- This leads to `widget.disc_var_hints` containing unexpected numeric values, causing inconsistent widget behavior and failed tests that rely on correct mappings.
[/ISSUE]
--- END ISSUE ---

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

--- BEGIN FILE ---
```
### Orange/widgets/data/owcontinuize.py
from functools import partial
from types import SimpleNamespace
from typing import NamedTuple, Dict, List

import numpy as np
import scipy.sparse as sp

from AnyQt.QtCore import Qt, QSize, QAbstractListModel, QObject, \
    QItemSelectionModel
from AnyQt.QtGui import QColor
from AnyQt.QtWidgets import QButtonGroup, QRadioButton, QListView

from orangewidget.utils import listview
from orangewidget.utils.itemmodels import SeparatedListDelegate, \
    LabelledSeparator

from Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table
from Orange.preprocess import Continuize as Continuizer
from Orange.preprocess.transformation import Identity, Indicator, Normalizer
from Orange.widgets import gui, widget
from Orange.widgets.settings import Setting
from Orange.widgets.utils.itemmodels import DomainModel
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output


class MethodDesc(NamedTuple):
    id_: int
    label: str  # Label used for radio button
    short_desc: str  # Short description for list views
    tooltip: str  # Tooltip for radio button
    supports_sparse: bool = True


DefaultKey = ""
DefaultId = 99
BackCompatClass = object()

Continuize = SimpleNamespace(
    Default=DefaultId,
    **{v.name: v.value for v in Continuizer.MultinomialTreatment})

DiscreteOptions: Dict[int, MethodDesc] = {
    method.id_: method
    for method in (
        MethodDesc(
            Continuize.Default, "Use preset", "preset",
            "Treat the variable as defined in preset"),
        MethodDesc(
            Continuize.Leave, "Keep categorical", "keep as is",
            "Keep the variable discrete"),
        MethodDesc(
            Continuize.FirstAsBase, "First value as base", "first as base",
            "One indicator variable for each value except the first"),
        MethodDesc(
            Continuize.FrequentAsBase, "Most frequent as base", "frequent as base",
            "One indicator variable for each value except the most frequent",
            False),
        MethodDesc(
            Continuize.Indicators, "One-hot encoding", "one-hot",
            "One indicator variable for each value",
            False),
        MethodDesc(
            Continuize.RemoveMultinomial, "Remove if more than 2 values", "remove if >2",
            "Remove variables with more than two values; indicator otherwise"),
        MethodDesc(
            Continuize.Remove, "Remove", "remove",
            "Remove variable"),
        MethodDesc(
            Continuize.AsOrdinal, "Treat as ordinal", "as ordinal",
            "Each value gets a consecutive number from 0 to number of values - 1"),
        MethodDesc(
            Continuize.AsNormalizedOrdinal, "Treat as normalized ordinal", "as norm. ordinal",
            "Same as above, but scaled to [0, 1]")
    )}

ContinuizationDefault = Continuize.FirstAsBase


Normalize = SimpleNamespace(Default=DefaultId,
                            Leave=0, Standardize=1, Center=2, Scale=3,
                            Normalize11=4, Normalize01=5)

ContinuousOptions: Dict[int, MethodDesc] = {
    method.id_: method
    for method in (
        MethodDesc(
            Normalize.Default, "Use preset", "preset",
            "Treat the variable as defined in 'default setting'"),
        MethodDesc(
            Normalize.Leave, "Keep as it is", "no change",
            "Keep the variable as it is"),
        MethodDesc(
            Normalize.Standardize, "Standardize to μ=0, σ²=1", "standardize",
            "Subtract the mean and divide by standard deviation",
            False),
        MethodDesc(
            Normalize.Center, "Center to μ=0", "center",
            "Subtract the mean",
            False),
        MethodDesc(
            Normalize.Scale, "Scale to σ²=1", "scale",
            "Divide by standard deviation"),
        MethodDesc(
            Normalize.Normalize11, "Normalize to interval [-1, 1]", "to [-1, 1]",
            "Linear transformation into interval [-1, 1]",
            False),
        MethodDesc(
            Normalize.Normalize01, "Normalize to interval [0, 1]", "to [0, 1]",
            "Linear transformation into interval [0, 1]",
            False),
    )}

NormalizationDefault = Normalize.Leave


class ContDomainModel(DomainModel):
    HintRole = next(gui.OrangeUserRole)
    FilterRole = next(gui.OrangeUserRole)
    """Domain model that adds description of chosen methods"""
    def __init__(self, valid_type):
        super().__init__(
            order=(DomainModel.ATTRIBUTES,
                   LabelledSeparator("Meta attributes"), DomainModel.METAS,
                   LabelledSeparator("Targets"), DomainModel.CLASSES),
            valid_types=(valid_type, ), strict_type=True)

    def data(self, index, role=Qt.DisplayRole):
        if role == Qt.ToolTipRole:
            return None
        if role == self.FilterRole:
            name = super().data(index, Qt.DisplayRole)
            if not isinstance(name, str):
                return None
            hint = index.data(self.HintRole)
            if hint is None:
                return name
            return f"{name} {hint[0]}"
        value = super().data(index, role)
        if role == Qt.DisplayRole:
            if isinstance(value, LabelledSeparator):
                return None
            return value, *(index.data(self.HintRole) or ("", False))
        return value


class DefaultContModel(QAbstractListModel):
    """A model used for showing "Default settings" above the list view"""
    icon = None

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if DefaultContModel.icon is None:
            DefaultContModel.icon = gui.createAttributePixmap(
                "★", QColor(0, 0, 0, 0), Qt.black)
        self.method = ""

    @staticmethod
    def rowCount(parent):
        return 0 if parent.isValid() else 1

    @staticmethod
    def columnCount(parent):
        return 0 if parent.isValid() else 1

    def data(self, _, role=Qt.DisplayRole):
        if role == Qt.DisplayRole:
            return f"Preset: {self.method}"
        elif role == Qt.DecorationRole:
            return self.icon
        elif role == Qt.ToolTipRole:
            return "Default for variables without specific settings"
        return None

    def setMethod(self, method):
        self.method = method
        self.dataChanged.emit(self.index(0, 0), self.index(0, 0))


class ListViewSearch(listview.ListViewSearch):
    """
    A list view with two components shown above it:
    - a listview containing a single item representing default settings
    - a filter for search

    The class is based on listview.ListViewSearch and needs to have the same
    name in order to override its private method __layout.

    Inherited __init__ calls __layout, so `default_view` must be constructed
    there. Construction before calling super().__init__ doesn't work because
    PyQt does not allow it.
    """
    class Delegate(SeparatedListDelegate):
        """
        A delegate that shows items (variables) with specific settings in bold
        """
        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            self._default_hints = False

        def initStyleOption(self, option, index):
            super().initStyleOption(option, index)
            hint = index.data(ContDomainModel.HintRole)
            option.font.setBold(hint is not None and hint[1])

        def set_default_hints(self, show):
            self._default_hints = show

        def displayText(self, value, _):
            if value is None:
                return None
            name, hint, nondefault = value
            if self._default_hints or nondefault:
                name += f": {hint}"
            return name

    def __init__(self, *args, **kwargs):
        self.default_view = None
        super().__init__(preferred_size=QSize(350, -1), *args, **kwargs)
        self.setItemDelegate(self.Delegate(self))
        self.force_hints = False

    def select_default(self):
        """Select the item representing default settings"""
        self.default_view.selectionModel().select(
            self.default_view.model().index(0),
            QItemSelectionModel.Select)

    def set_default_method(self, method):
        self.default_view.model().setMethod(method)

    # pylint: disable=unused-private-member
    def __layout(self):
        if self.default_view is None:  # __layout was called from __init__
            view = self.default_view = QListView(self)
            view.setModel(DefaultContModel())
            self.filterProxyModel().setFilterRole(ContDomainModel.FilterRole)
            view.verticalScrollBar().setDisabled(True)
            view.horizontalScrollBar().setDisabled(True)
            view.setHorizontalScrollBarPolicy(
                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
            view.setVerticalScrollBarPolicy(
                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
            font = view.font()
            font.setBold(True)
            view.setFont(font)
        else:
            view = self.default_view

        # Put the list view with default on top
        margins = self.viewportMargins()
        def_height = view.sizeHintForRow(0) + 2 * view.spacing() + 2
        view.setGeometry(0, 0, self.geometry().width(), def_height)
        view.setFixedHeight(def_height)

        # Then search
        search = self.__search
        src_height = search.sizeHint().height()
        size = self.size()
        search.setGeometry(0, def_height + 2, size.width(), src_height)

        # Then the real list view
        margins.setTop(def_height + 2 + src_height)
        self.setViewportMargins(margins)

    def event(self, ev):
        if ev.type() == ev.ToolTip:
            self.itemDelegate().set_default_hints(True)
            self.viewport().update()
            return True
        return super().event(ev)

    def leaveEvent(self, _):
        self.itemDelegate().set_default_hints(False)
        self.viewport().update()


class OWContinuize(widget.OWWidget):
    # Many false positives for `hints`; pylint ignores type annotations
    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation
    # pylint: disable=unsupported-membership-test, unsupported-delete-operation
    name = "Continuize"
    description = ("Transform categorical attributes into numeric and, " +
                   "optionally, scale numeric values.")
    icon = "icons/Continuize.svg"
    category = "Transform"
    keywords = "continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast"
    priority = 2120

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

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

    class Error(widget.OWWidget.Error):
        unsupported_sparse = \
            widget.Msg("Some chosen methods do support sparse data: {}")

    want_control_area = False

    settings_version = 3
    disc_var_hints: Dict[str, int] = Setting(
        {DefaultKey: ContinuizationDefault}, schema_only=True)
    cont_var_hints: Dict[str, int] = Setting(
        {DefaultKey: NormalizationDefault}, schema_only=True)
    autosend = Setting(True)

    def __init__(self):
        super().__init__()
        self.data = None
        self._var_cache = {}

        def create(title, vartype, methods):
            hbox = gui.hBox(box, title)
            view = ListViewSearch(
                selectionMode=ListViewSearch.ExtendedSelection,
                uniformItemSizes=True)
            view.setModel(ContDomainModel(vartype))
            view.selectionModel().selectionChanged.connect(
                lambda: self._on_var_selection_changed(view))
            view.default_view.selectionModel().selectionChanged.connect(
                lambda selected: self._on_default_selected(view, selected))
            hbox.layout().addWidget(view)

            bbox = gui.vBox(hbox)
            bgroup = QButtonGroup(self)
            bgroup.idClicked.connect(self._on_radio_clicked)
            for desc in methods.values():
                button = QRadioButton(desc.label)
                button.setToolTip(desc.tooltip)
                bgroup.addButton(button, desc.id_)
                bbox.layout().addWidget(button)
            bbox.layout().addStretch(1)
            return hbox, view, bbox, bgroup

        box = gui.vBox(self.mainArea, True, spacing=8)
        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \
            create("Categorical Variables", DiscreteVariable, DiscreteOptions)
        self.disc_view.set_default_method(
            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)
        self.disc_view.select_default()

        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \
            create("Numeric Variables", ContinuousVariable, ContinuousOptions)
        self.cont_view.set_default_method(
            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)
        self.cont_view.select_default()

        boxes = (self.disc_radios, self.cont_radios)
        width = max(box.sizeHint().width() for box in boxes)
        for box in boxes:
            box.setFixedWidth(width)

        box = gui.hBox(self.mainArea)
        gui.button(
            box, self, "Reset All", callback=self._on_reset_hints,
            autoDefault=False)
        gui.rubber(box)
        gui.auto_apply(box, self, "autosend")

    def _on_var_selection_changed(self, view):
        if not view.selectionModel().selectedIndexes():
            # Prevent infinite recursion (with _on_default_selected)
            return
        view.default_view.selectionModel().clearSelection()
        self._update_radios(view)

    def _on_default_selected(self, view, selected):
        if not selected:
            # Prevent infinite recursion (with _var_selection_selected)
            return
        view.selectionModel().clearSelection()
        self._update_radios(view)

    def selected_vars(self, view) -> List[str]:
        """
        Return selected variables

        If 'Default settings' are selected, this returns DefaultKey
        """
        model = view.model()
        return [model[index.row()]
                for index in view.selectionModel().selectedRows()]

    def _update_radios(self, view):
        if view is self.disc_view:
            group, hints = self.disc_group, self.disc_var_hints
        else:
            group, hints = self.cont_group, self.cont_var_hints

        selvars = self.selected_vars(view)
        if not selvars:
            self._check_button(group, hints[DefaultKey], True)
            self._set_radio_enabled(group, DefaultId, False)
            return

        self._set_radio_enabled(group, DefaultId, True)
        options = {hints.get(var.name, self.default_for_var(var))
                   for var in selvars}
        if len(options) == 1:
            self._check_button(group, options.pop(), True)
        else:
            self._uncheck_all_buttons(group)

    @staticmethod
    def _uncheck_all_buttons(group: QButtonGroup):
        button = group.checkedButton()
        if button is not None:
            group.setExclusive(False)
            button.setChecked(False)
            group.setExclusive(True)

    def _set_radio_enabled(
            self, group: QButtonGroup, method_id: int, value: bool):
        if group.button(method_id).isChecked() and not value:
            self._uncheck_all_buttons(group)
        group.button(method_id).setEnabled(value)

    @staticmethod
    def _check_button(group: QButtonGroup, method_id: int, checked: bool):
        group.button(method_id).setChecked(checked)

    def _on_radio_clicked(self, method_id: int):
        if QObject().sender() is self.disc_group:
            view, hints, methods = \
                self.disc_view, self.disc_var_hints, DiscreteOptions
            leave_id = Continuize.Leave
        else:
            view, hints, methods = \
                self.cont_view, self.cont_var_hints, ContinuousOptions
            leave_id = Normalize.Leave
        selvars = self.selected_vars(view)
        if not selvars:
            hints[DefaultKey] = method_id
            view.set_default_method(methods[method_id].short_desc)
        else:
            keys = [var.name for var in selvars]
            indexes = view.selectionModel().selectedIndexes()
            model = view.model()
            # These two keys may delete values from dict, hence we must loop
            if method_id in (DefaultId, leave_id):
                for key in keys:
                    # Attributes do not store the hint if it equals Default;
                    # metas and targets do not store it if it is Leave
                    if method_id == (DefaultId if self.is_attr(key) else leave_id):
                        if key in hints:
                            del hints[key]
                    else:
                        hints[key] = method_id
            else:
                hints.update(dict.fromkeys(keys, method_id))
            desc = methods[method_id].short_desc
            for index, var in zip(indexes, selvars):
                show = method_id != self.default_for_var(var)
                model.setData(index, (desc, show), model.HintRole)
        self.commit.deferred()

    @Inputs.data
    @check_sql_input
    def set_data(self, data):
        self.data = data
        self._var_cache.clear()
        domain = data.domain if data else None
        self.disc_view.model().set_domain(domain)
        self.cont_view.model().set_domain(domain)
        if data:
            # Clean up hints only when receiving new data, not on disconnection
            self._set_hints()
        self.commit.now()

    def _set_hints(self):
        assert self.data

        # Backward compatibility for settings < 3
        class_treatment = self.disc_var_hints.get(BackCompatClass, None)
        if class_treatment is not None \
                and self.data.domain.class_var is not None:
            self.disc_var_hints[self.data.domain.class_var.name] \
                = class_treatment

        for hints, model, options in (
                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),
                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):
            filtered = {DefaultKey: hints[DefaultKey]}
            for i, var in enumerate(model):
                if isinstance(var, LabelledSeparator):
                    continue
                default = self.default_for_var(var)
                method_id = hints.get(var.name, default)
                nondefault = method_id != default
                if nondefault:
                    filtered[var.name] = method_id
                model.setData(
                    model.index(i, 0),
                    (options[method_id].short_desc, nondefault),
                    model.HintRole)
            hints.clear()
            hints.update(filtered)

    def _on_reset_hints(self):
        if not self.data:
            return
        self.cont_var_hints.clear()
        self.disc_var_hints.clear()
        self.disc_var_hints[DefaultKey] = ContinuizationDefault
        self.cont_var_hints[DefaultKey] = NormalizationDefault
        self._set_hints()
        self.cont_view.set_default_method(
            ContinuousOptions[ContinuizationDefault].short_desc)
        self.disc_view.set_default_method(
            ContinuousOptions[NormalizationDefault].short_desc)

    @gui.deferred
    def commit(self):
        self.Outputs.data.send(self._prepare_output())

    def _prepare_output(self):
        self.Error.unsupported_sparse.clear()
        if not self.data:
            return None
        if unsupp_sparse := self._unsupported_sparse():
            if len(unsupp_sparse) == 1:
                self.Error.unsupported_sparse(unsupp_sparse[0])
            else:
                self.Error.unsupported_sparse("\n" + ", ".join(unsupp_sparse))
            return None

        domain = self.data.domain
        attrs = self._create_vars(domain.attributes)
        class_vars = self._create_vars(domain.class_vars)
        metas = self._create_vars(domain.metas)
        return self.data.transform(Domain(attrs, class_vars, metas))

    def _unsupported_sparse(self):
        # time is not continuous, pylint: disable=unidiomatic-typecheck
        domain = self.data.domain
        disc = set()
        cont = set()
        # At the time of writing, self.data.Y cannot be sparse (setter for
        # `Y` converts it to dense, as done in
        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)
        # Including it here doesn't hurt, though.
        for part, attrs in ((self.data.X, domain.attributes),
                            (self.data.Y, domain.class_vars),
                            (self.data.metas, domain.metas)):
            if sp.issparse(part):
                disc |= {self._hint_for_var(var)
                         for var in attrs
                         if var.is_discrete}
                cont |= {self._hint_for_var(var)
                         for var in attrs
                         if type(var) is ContinuousVariable}
        disc &= {method.id_
                 for method in DiscreteOptions.values()
                 if not method.supports_sparse}
        cont &= {method.id_
                 for method in ContinuousOptions.values()
                 if not method.supports_sparse}

        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order
        return [method.label
                for methods, problems in ((DiscreteOptions, disc),
                                          (ContinuousOptions, cont))
                for method in methods.values() if method.id_ in problems]

    def _create_vars(self, part):
        # time is not continuous, pylint: disable=unidiomatic-typecheck
        return sum(
            (self._continuized_vars(var) if var.is_discrete
             else self._scaled_vars(var) if type(var) is ContinuousVariable
             else [var]
             for var in part),
            start=[])

    def _get(self, var, stat):
        def most_frequent(col):
            col = col[np.isfinite(col)].astype(int)
            counts = np.bincount(col, minlength=len(var.values))
            return np.argmax(counts)

        funcs = {"min": np.nanmin, "max": np.nanmax,
                 "mean": np.nanmean, "std": np.nanstd,
                 "major": most_frequent}
        name = var.name
        cache = self._var_cache.setdefault(name, {})
        if stat not in cache:
            cache[stat] = funcs[stat](self.data.get_column(var))
        return cache[stat]

    def is_attr(self, var):
        domain = self.data.domain
        return 0 <= domain.index(var) < len(domain.attributes)

    def default_for_var(self, var):
        if self.is_attr(var):
            return DefaultId
        return Continuize.Leave if var.is_discrete else Normalize.Leave

    def _hint_for_var(self, var):
        if var.is_discrete:
            hints, leave_id = self.disc_var_hints, Continuize.Leave
        else:
            hints, leave_id = self.cont_var_hints, Normalize.Leave

        # Default for attributes is given by "default"
        if self.is_attr(var):
            return hints.get(var.name, hints[DefaultKey])

        # For metas and targets, default is Leave
        # If user changes it to "Default", default is used
        hint = hints.get(var.name, leave_id)
        if hint == DefaultId:
            hint = hints[DefaultKey]
        return hint

    def _scaled_vars(self, var):
        hint = self._hint_for_var(var)
        if hint == Normalize.Leave:
            return [var]

        get = partial(self._get, var)
        if hint == Normalize.Standardize:
            off, scale = get("mean"), 1 / (get("std") or 1)
        elif hint == Normalize.Center:
            off, scale = get("mean"), 1
        elif hint == Normalize.Scale:
            off, scale = 0, 1 / (get("std") or 1)
        else:
            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f"hint={hint}?!"
            min_, max_ = get("min"), get("max")
            span = (max_ - min_) or 1
            if hint == Normalize.Normalize11:
                off, scale = (min_ + max_) / 2, 2 / span
            else:
                off, scale = min_, 1 / span

        return [ContinuousVariable(
            var.name,
            compute_value=Normalizer(var, off, scale))]

    def _continuized_vars(self, var, hint=None):
        if hint is None:
            hint = self._hint_for_var(var)

        # Single variable
        if hint == Continuize.Leave:
            return [var]
        if hint == Continuize.Remove:
            return []
        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \
                hint == Continuize.AsOrdinal:
            return [ContinuousVariable(var.name,
                                       compute_value=Identity(var))]
        if hint == Continuize.RemoveMultinomial:
            assert len(var.values) > 2
            return []
        if hint == Continuize.AsOrdinal:
            return [ContinuousVariable(var.name,
                                       compute_value=Identity(var))]
        if hint == Continuize.AsNormalizedOrdinal:
            scale = 1 / (len(var.values) - 1 or 1)
            return [ContinuousVariable(var.name,
                                       compute_value=Normalizer(var, 0, scale))]

        # Multiple dummy variables
        if hint == Continuize.FirstAsBase:
            base = 0
        elif hint == Continuize.FrequentAsBase:
            base = self._get(var, "major")
        elif hint == Continuize.Indicators:
            base = None
        else:
            assert False, f"hint={hint}?!"
        return [
            ContinuousVariable(f"{var.name}={value}",
                               compute_value=Indicator(var, value=i))
            for i, value in enumerate(var.values)
            if i != base
        ]

    def send_report(self):
        if not self.data:
            return
        single_disc = len(self.disc_view.model()) > 0 \
                      and len(self.disc_var_hints) == 1 \
                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()
        single_cont = len(self.cont_view.model()) > 0 \
                      and len(self.cont_var_hints) == 1 \
                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()
        if single_disc and single_cont:
            self.report_items(
                (("Categorical variables", single_disc),
                 ("Numeric variables", single_cont))
            )
        else:
            if single_disc:
                self.report_paragraph("Categorical variables", single_disc)
            elif len(self.disc_view.model()) > 0:
                self.report_items(
                    "Categorical variables",
                    [("Preset" if name == DefaultKey else name,
                      DiscreteOptions[id_].label.lower())
                     for name, id_ in self.disc_var_hints.items()])
            if single_cont:
                self.report_paragraph("Numeric variables", single_cont)
            elif len(self.cont_view.model()) > 0:
                self.report_items(
                    "Numeric variables",
                    [("Preset" if name == DefaultKey else name,
                      ContinuousOptions[id_].label.lower())
                     for name, id_ in self.cont_var_hints.items()])
            self.report_paragraph("Unlisted",
                "Any unlisted attributes default to preset option, and "
                "unlisted meta attributes and target variables are kept "
                "as they are")

    @classmethod
    def migrate_settings(cls, settings, version):
        if version < 2:
            cont_treat = settings.pop("continuous_treatment", 0)
            zero_based = settings.pop("zero_based", True)
            if cont_treat == 1:
                if zero_based:
                    settings["continuous_treatment"] = Normalize.Normalize01
                else:
                    settings["continuous_treatment"] = Normalize.Normalize11
            elif cont_treat == 2:
                settings["continuous_treatment"] = Normalize.Standardize
        if version < 3:
            settings["cont_var_hints"] = \
                {DefaultKey:
                 settings.pop("continuous_treatment", Normalize.Leave)}
            settings["disc_var_hints"] = \
                {DefaultKey:
                 settings.pop("multinomial_treatment", Continuize.FirstAsBase)}
            class_treatment = settings.pop("class_treatment", Continuize.Leave)
            if class_treatment != Continuize.Leave:
                settings["disc_var_hints"][BackCompatClass] = class_treatment


# Backward compatibility for unpickling settings
OWContinuize.Normalize = Normalize


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

```
--- END FILE ---

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

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

Here is an example:

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

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

**Description:**
When migrating settings from older versions, the `multinomial_treatment` and `class_treatment` values are not being mapped correctly to their new representations. This results in incorrect treatment hints being applied, which affects the behavior of the `OWContinuize` widget.

**Example Buggy Code:**
```python
widget = OWContinuize(stored_settings={
    'multinomial_treatment': 2,  # Expected to map to Continuize.Indicators
    'class_treatment': 3          # Expected to map to Continuize.AsOrdinal
})

# After migration, the widget's disc_var_hints should reflect the correct mappings
print(widget.disc_var_hints[DefaultKey])  # Unexpected output: 2 instead of Continuize.Indicators
print(widget.disc_var_hints['y'])         # Unexpected output: 3 instead of Continuize.AsOrdinal
```

**Expected Behavior:**
- The `multinomial_treatment` value of `2` should correctly map to `Continuize.Indicators`.
- The `class_treatment` value of `3` should correctly map to `Continuize.AsOrdinal`.
- As a result, `widget.disc_var_hints` should reflect these mappings accurately, ensuring the widget behaves as intended.

**Actual Behavior:**
- The `multinomial_treatment` value of `2` is incorrectly retained as `2` instead of mapping to `Continuize.Indicators`.
- The `class_treatment` value of `3` is incorrectly retained as `3` instead of mapping to `Continuize.AsOrdinal`.
- This leads to `widget.disc_var_hints` containing unexpected numeric values, causing inconsistent widget behavior and failed tests that rely on correct mappings.
[/ISSUE]
{
    "TestOWContinuize.test_change_hints_cont": "PASSED",
    "TestOWContinuize.test_change_hints_cont_class_meta": "PASSED",
    "TestOWContinuize.test_change_hints_disc": "PASSED",
    "TestOWContinuize.test_change_hints_disc_class_meta": "PASSED",
    "TestOWContinuize.test_check_unsuppoerted_sparse_continuous": "PASSED",
    "TestOWContinuize.test_check_unsuppoerted_sparse_discrete": "PASSED",
    "TestOWContinuize.test_commit_calls_prepare_output": "PASSED",
    "TestOWContinuize.test_continuous": "PASSED",
    "TestOWContinuize.test_empty_data": "PASSED",
    "TestOWContinuize.test_hint_for_var": "PASSED",
    "TestOWContinuize.test_image_export": "PASSED",
    "TestOWContinuize.test_is_attr_and_default": "PASSED",
    "TestOWContinuize.test_migrate_settings_to_v3": "PASSED",
    "TestOWContinuize.test_migrate_settings_to_v3_class_treatment": "PASSED",
    "TestOWContinuize.test_minimum_size": "PASSED",
    "TestOWContinuize.test_msg_base_class": "PASSED",
    "TestOWContinuize.test_one_column_equal_values": "PASSED",
    "TestOWContinuize.test_one_column_nan_values_normalize_sd": "PASSED",
    "TestOWContinuize.test_one_column_nan_values_normalize_span": "PASSED",
    "TestOWContinuize.test_reset_hints": "PASSED",
    "TestOWContinuize.test_send_report": "PASSED",
    "TestOWContinuize.test_set_hints_on_new_data": "PASSED",
    "TestOWContinuize.test_transformations": "PASSED",
    "TestOWContinuize.test_update_cont_radio_buttons": "PASSED",
    "TestOWContinuize.test_update_cont_radio_buttons_mixed": "PASSED",
    "TestOWContinuize.test_update_disc_radio_buttons_mixed": "PASSED",
    "TestModelsAndViews.test_contmodel": "PASSED",
    "TestModelsAndViews.test_defaultcontmodel": "PASSED",
    "TestListViewDelegate.test_bold": "PASSED",
    "TestListViewDelegate.test_displaytext": "PASSED"
}
diff --git a/Orange/widgets/data/owcontinuize.py b/Orange/widgets/data/owcontinuize.py
index 123f238f3..806ae11c0 100644
--- a/Orange/widgets/data/owcontinuize.py
+++ b/Orange/widgets/data/owcontinuize.py
@@ -732,10 +732,22 @@ class OWContinuize(widget.OWWidget):
             settings["cont_var_hints"] = \
                 {DefaultKey:
                  settings.pop("continuous_treatment", Normalize.Leave)}
+
+            # DISC OPS: Default=99, Indicators=1, FirstAsBase=2, FrequentAsBase=3, Remove=4,
+            # RemoveMultinomial=5, ReportError=6, AsOrdinal=7, AsNormalizedOrdinal=8, Leave=9
+
+            # OLD ORDER: [FirstAsBase, FrequentAsBase, Indicators, RemoveMultinomial, Remove,
+            # AsOrdinal, AsNormalizedOrdinal]
+            old_to_new = [2, 3, 1, 5, 4, 7, 8]
+
             settings["disc_var_hints"] = \
                 {DefaultKey:
-                 settings.pop("multinomial_treatment", Continuize.FirstAsBase)}
-            class_treatment = settings.pop("class_treatment", Continuize.Leave)
+                 old_to_new[settings.pop("multinomial_treatment", 0)]}
+
+            # OLD ORDER: [Leave, AsOrdinal, AsNormalizedOrdinal, Indicators]
+            old_to_new = [9, 7, 8, 1]
+
+            class_treatment = old_to_new[settings.pop("class_treatment", 0)]
             if class_treatment != Continuize.Leave:
                 settings["disc_var_hints"][BackCompatClass] = class_treatment
 

{"Orange/widgets/data/owcontinuize.py": "from functools import partial\nfrom types import SimpleNamespace\nfrom typing import NamedTuple, Dict, List\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom AnyQt.QtCore import Qt, QSize, QAbstractListModel, QObject, \\\n    QItemSelectionModel\nfrom AnyQt.QtGui import QColor\nfrom AnyQt.QtWidgets import QButtonGroup, QRadioButton, QListView\n\nfrom orangewidget.utils import listview\nfrom orangewidget.utils.itemmodels import SeparatedListDelegate, \\\n    LabelledSeparator\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table\nfrom Orange.preprocess import Continuize as Continuizer\nfrom Orange.preprocess.transformation import Identity, Indicator, Normalizer\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.settings import Setting\nfrom Orange.widgets.utils.itemmodels import DomainModel\nfrom Orange.widgets.utils.sql import check_sql_input\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\n\nclass MethodDesc(NamedTuple):\n    id_: int\n    label: str  # Label used for radio button\n    short_desc: str  # Short description for list views\n    tooltip: str  # Tooltip for radio button\n    supports_sparse: bool = True\n\n\nDefaultKey = \"\"\nDefaultId = 99\nBackCompatClass = object()\n\nContinuize = SimpleNamespace(\n    Default=DefaultId,\n    **{v.name: v.value for v in Continuizer.MultinomialTreatment})\n\nDiscreteOptions: Dict[int, MethodDesc] = {\n    method.id_: method\n    for method in (\n        MethodDesc(\n            Continuize.Default, \"Use preset\", \"preset\",\n            \"Treat the variable as defined in preset\"),\n        MethodDesc(\n            Continuize.Leave, \"Keep categorical\", \"keep as is\",\n            \"Keep the variable discrete\"),\n        MethodDesc(\n            Continuize.FirstAsBase, \"First value as base\", \"first as base\",\n            \"One indicator variable for each value except the first\"),\n        MethodDesc(\n            Continuize.FrequentAsBase, \"Most frequent as base\", \"frequent as base\",\n            \"One indicator variable for each value except the most frequent\",\n            False),\n        MethodDesc(\n            Continuize.Indicators, \"One-hot encoding\", \"one-hot\",\n            \"One indicator variable for each value\",\n            False),\n        MethodDesc(\n            Continuize.RemoveMultinomial, \"Remove if more than 2 values\", \"remove if >2\",\n            \"Remove variables with more than two values; indicator otherwise\"),\n        MethodDesc(\n            Continuize.Remove, \"Remove\", \"remove\",\n            \"Remove variable\"),\n        MethodDesc(\n            Continuize.AsOrdinal, \"Treat as ordinal\", \"as ordinal\",\n            \"Each value gets a consecutive number from 0 to number of values - 1\"),\n        MethodDesc(\n            Continuize.AsNormalizedOrdinal, \"Treat as normalized ordinal\", \"as norm. ordinal\",\n            \"Same as above, but scaled to [0, 1]\")\n    )}\n\nContinuizationDefault = Continuize.FirstAsBase\n\n\nNormalize = SimpleNamespace(Default=DefaultId,\n                            Leave=0, Standardize=1, Center=2, Scale=3,\n                            Normalize11=4, Normalize01=5)\n\nContinuousOptions: Dict[int, MethodDesc] = {\n    method.id_: method\n    for method in (\n        MethodDesc(\n            Normalize.Default, \"Use preset\", \"preset\",\n            \"Treat the variable as defined in 'default setting'\"),\n        MethodDesc(\n            Normalize.Leave, \"Keep as it is\", \"no change\",\n            \"Keep the variable as it is\"),\n        MethodDesc(\n            Normalize.Standardize, \"Standardize to \u03bc=0, \u03c3\u00b2=1\", \"standardize\",\n            \"Subtract the mean and divide by standard deviation\",\n            False),\n        MethodDesc(\n            Normalize.Center, \"Center to \u03bc=0\", \"center\",\n            \"Subtract the mean\",\n            False),\n        MethodDesc(\n            Normalize.Scale, \"Scale to \u03c3\u00b2=1\", \"scale\",\n            \"Divide by standard deviation\"),\n        MethodDesc(\n            Normalize.Normalize11, \"Normalize to interval [-1, 1]\", \"to [-1, 1]\",\n            \"Linear transformation into interval [-1, 1]\",\n            False),\n        MethodDesc(\n            Normalize.Normalize01, \"Normalize to interval [0, 1]\", \"to [0, 1]\",\n            \"Linear transformation into interval [0, 1]\",\n            False),\n    )}\n\nNormalizationDefault = Normalize.Leave\n\n\nclass ContDomainModel(DomainModel):\n    HintRole = next(gui.OrangeUserRole)\n    FilterRole = next(gui.OrangeUserRole)\n    \"\"\"Domain model that adds description of chosen methods\"\"\"\n    def __init__(self, valid_type):\n        super().__init__(\n            order=(DomainModel.ATTRIBUTES,\n                   LabelledSeparator(\"Meta attributes\"), DomainModel.METAS,\n                   LabelledSeparator(\"Targets\"), DomainModel.CLASSES),\n            valid_types=(valid_type, ), strict_type=True)\n\n    def data(self, index, role=Qt.DisplayRole):\n        if role == Qt.ToolTipRole:\n            return None\n        if role == self.FilterRole:\n            name = super().data(index, Qt.DisplayRole)\n            if not isinstance(name, str):\n                return None\n            hint = index.data(self.HintRole)\n            if hint is None:\n                return name\n            return f\"{name} {hint[0]}\"\n        value = super().data(index, role)\n        if role == Qt.DisplayRole:\n            if isinstance(value, LabelledSeparator):\n                return None\n            return value, *(index.data(self.HintRole) or (\"\", False))\n        return value\n\n\nclass DefaultContModel(QAbstractListModel):\n    \"\"\"A model used for showing \"Default settings\" above the list view\"\"\"\n    icon = None\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        if DefaultContModel.icon is None:\n            DefaultContModel.icon = gui.createAttributePixmap(\n                \"\u2605\", QColor(0, 0, 0, 0), Qt.black)\n        self.method = \"\"\n\n    @staticmethod\n    def rowCount(parent):\n        return 0 if parent.isValid() else 1\n\n    @staticmethod\n    def columnCount(parent):\n        return 0 if parent.isValid() else 1\n\n    def data(self, _, role=Qt.DisplayRole):\n        if role == Qt.DisplayRole:\n            return f\"Preset: {self.method}\"\n        elif role == Qt.DecorationRole:\n            return self.icon\n        elif role == Qt.ToolTipRole:\n            return \"Default for variables without specific settings\"\n        return None\n\n    def setMethod(self, method):\n        self.method = method\n        self.dataChanged.emit(self.index(0, 0), self.index(0, 0))\n\n\nclass ListViewSearch(listview.ListViewSearch):\n    \"\"\"\n    A list view with two components shown above it:\n    - a listview containing a single item representing default settings\n    - a filter for search\n\n    The class is based on listview.ListViewSearch and needs to have the same\n    name in order to override its private method __layout.\n\n    Inherited __init__ calls __layout, so `default_view` must be constructed\n    there. Construction before calling super().__init__ doesn't work because\n    PyQt does not allow it.\n    \"\"\"\n    class Delegate(SeparatedListDelegate):\n        \"\"\"\n        A delegate that shows items (variables) with specific settings in bold\n        \"\"\"\n        def __init__(self, *args, **kwargs):\n            super().__init__(*args, **kwargs)\n            self._default_hints = False\n\n        def initStyleOption(self, option, index):\n            super().initStyleOption(option, index)\n            hint = index.data(ContDomainModel.HintRole)\n            option.font.setBold(hint is not None and hint[1])\n\n        def set_default_hints(self, show):\n            self._default_hints = show\n\n        def displayText(self, value, _):\n            if value is None:\n                return None\n            name, hint, nondefault = value\n            if self._default_hints or nondefault:\n                name += f\": {hint}\"\n            return name\n\n    def __init__(self, *args, **kwargs):\n        self.default_view = None\n        super().__init__(preferred_size=QSize(350, -1), *args, **kwargs)\n        self.setItemDelegate(self.Delegate(self))\n        self.force_hints = False\n\n    def select_default(self):\n        \"\"\"Select the item representing default settings\"\"\"\n        self.default_view.selectionModel().select(\n            self.default_view.model().index(0),\n            QItemSelectionModel.Select)\n\n    def set_default_method(self, method):\n        self.default_view.model().setMethod(method)\n\n    # pylint: disable=unused-private-member\n    def __layout(self):\n        if self.default_view is None:  # __layout was called from __init__\n            view = self.default_view = QListView(self)\n            view.setModel(DefaultContModel())\n            self.filterProxyModel().setFilterRole(ContDomainModel.FilterRole)\n            view.verticalScrollBar().setDisabled(True)\n            view.horizontalScrollBar().setDisabled(True)\n            view.setHorizontalScrollBarPolicy(\n                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)\n            view.setVerticalScrollBarPolicy(\n                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)\n            font = view.font()\n            font.setBold(True)\n            view.setFont(font)\n        else:\n            view = self.default_view\n\n        # Put the list view with default on top\n        margins = self.viewportMargins()\n        def_height = view.sizeHintForRow(0) + 2 * view.spacing() + 2\n        view.setGeometry(0, 0, self.geometry().width(), def_height)\n        view.setFixedHeight(def_height)\n\n        # Then search\n        search = self.__search\n        src_height = search.sizeHint().height()\n        size = self.size()\n        search.setGeometry(0, def_height + 2, size.width(), src_height)\n\n        # Then the real list view\n        margins.setTop(def_height + 2 + src_height)\n        self.setViewportMargins(margins)\n\n    def event(self, ev):\n        if ev.type() == ev.ToolTip:\n            self.itemDelegate().set_default_hints(True)\n            self.viewport().update()\n            return True\n        return super().event(ev)\n\n    def leaveEvent(self, _):\n        self.itemDelegate().set_default_hints(False)\n        self.viewport().update()\n\n\nclass OWContinuize(widget.OWWidget):\n    # Many false positives for `hints`; pylint ignores type annotations\n    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation\n    # pylint: disable=unsupported-membership-test, unsupported-delete-operation\n    name = \"Continuize\"\n    description = (\"Transform categorical attributes into numeric and, \" +\n                   \"optionally, scale numeric values.\")\n    icon = \"icons/Continuize.svg\"\n    category = \"Transform\"\n    keywords = \"continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast\"\n    priority = 2120\n\n    class Inputs:\n        data = Input(\"Data\", Table)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n\n    class Error(widget.OWWidget.Error):\n        unsupported_sparse = \\\n            widget.Msg(\"Some chosen methods do support sparse data: {}\")\n\n    want_control_area = False\n\n    settings_version = 3\n    disc_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: ContinuizationDefault}, schema_only=True)\n    cont_var_hints: Dict[str, int] = Setting(\n        {DefaultKey: NormalizationDefault}, schema_only=True)\n    autosend = Setting(True)\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self._var_cache = {}\n\n        def create(title, vartype, methods):\n            hbox = gui.hBox(box, title)\n            view = ListViewSearch(\n                selectionMode=ListViewSearch.ExtendedSelection,\n                uniformItemSizes=True)\n            view.setModel(ContDomainModel(vartype))\n            view.selectionModel().selectionChanged.connect(\n                lambda: self._on_var_selection_changed(view))\n            view.default_view.selectionModel().selectionChanged.connect(\n                lambda selected: self._on_default_selected(view, selected))\n            hbox.layout().addWidget(view)\n\n            bbox = gui.vBox(hbox)\n            bgroup = QButtonGroup(self)\n            bgroup.idClicked.connect(self._on_radio_clicked)\n            for desc in methods.values():\n                button = QRadioButton(desc.label)\n                button.setToolTip(desc.tooltip)\n                bgroup.addButton(button, desc.id_)\n                bbox.layout().addWidget(button)\n            bbox.layout().addStretch(1)\n            return hbox, view, bbox, bgroup\n\n        box = gui.vBox(self.mainArea, True, spacing=8)\n        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \\\n            create(\"Categorical Variables\", DiscreteVariable, DiscreteOptions)\n        self.disc_view.set_default_method(\n            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)\n        self.disc_view.select_default()\n\n        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \\\n            create(\"Numeric Variables\", ContinuousVariable, ContinuousOptions)\n        self.cont_view.set_default_method(\n            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)\n        self.cont_view.select_default()\n\n        boxes = (self.disc_radios, self.cont_radios)\n        width = max(box.sizeHint().width() for box in boxes)\n        for box in boxes:\n            box.setFixedWidth(width)\n\n        box = gui.hBox(self.mainArea)\n        gui.button(\n            box, self, \"Reset All\", callback=self._on_reset_hints,\n            autoDefault=False)\n        gui.rubber(box)\n        gui.auto_apply(box, self, \"autosend\")\n\n    def _on_var_selection_changed(self, view):\n        if not view.selectionModel().selectedIndexes():\n            # Prevent infinite recursion (with _on_default_selected)\n            return\n        view.default_view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def _on_default_selected(self, view, selected):\n        if not selected:\n            # Prevent infinite recursion (with _var_selection_selected)\n            return\n        view.selectionModel().clearSelection()\n        self._update_radios(view)\n\n    def selected_vars(self, view) -> List[str]:\n        \"\"\"\n        Return selected variables\n\n        If 'Default settings' are selected, this returns DefaultKey\n        \"\"\"\n        model = view.model()\n        return [model[index.row()]\n                for index in view.selectionModel().selectedRows()]\n\n    def _update_radios(self, view):\n        if view is self.disc_view:\n            group, hints = self.disc_group, self.disc_var_hints\n        else:\n            group, hints = self.cont_group, self.cont_var_hints\n\n        selvars = self.selected_vars(view)\n        if not selvars:\n            self._check_button(group, hints[DefaultKey], True)\n            self._set_radio_enabled(group, DefaultId, False)\n            return\n\n        self._set_radio_enabled(group, DefaultId, True)\n        options = {hints.get(var.name, self.default_for_var(var))\n                   for var in selvars}\n        if len(options) == 1:\n            self._check_button(group, options.pop(), True)\n        else:\n            self._uncheck_all_buttons(group)\n\n    @staticmethod\n    def _uncheck_all_buttons(group: QButtonGroup):\n        button = group.checkedButton()\n        if button is not None:\n            group.setExclusive(False)\n            button.setChecked(False)\n            group.setExclusive(True)\n\n    def _set_radio_enabled(\n            self, group: QButtonGroup, method_id: int, value: bool):\n        if group.button(method_id).isChecked() and not value:\n            self._uncheck_all_buttons(group)\n        group.button(method_id).setEnabled(value)\n\n    @staticmethod\n    def _check_button(group: QButtonGroup, method_id: int, checked: bool):\n        group.button(method_id).setChecked(checked)\n\n    def _on_radio_clicked(self, method_id: int):\n        if QObject().sender() is self.disc_group:\n            view, hints, methods = \\\n                self.disc_view, self.disc_var_hints, DiscreteOptions\n            leave_id = Continuize.Leave\n        else:\n            view, hints, methods = \\\n                self.cont_view, self.cont_var_hints, ContinuousOptions\n            leave_id = Normalize.Leave\n        selvars = self.selected_vars(view)\n        if not selvars:\n            hints[DefaultKey] = method_id\n            view.set_default_method(methods[method_id].short_desc)\n        else:\n            keys = [var.name for var in selvars]\n            indexes = view.selectionModel().selectedIndexes()\n            model = view.model()\n            # These two keys may delete values from dict, hence we must loop\n            if method_id in (DefaultId, leave_id):\n                for key in keys:\n                    # Attributes do not store the hint if it equals Default;\n                    # metas and targets do not store it if it is Leave\n                    if method_id == (DefaultId if self.is_attr(key) else leave_id):\n                        if key in hints:\n                            del hints[key]\n                    else:\n                        hints[key] = method_id\n            else:\n                hints.update(dict.fromkeys(keys, method_id))\n            desc = methods[method_id].short_desc\n            for index, var in zip(indexes, selvars):\n                show = method_id != self.default_for_var(var)\n                model.setData(index, (desc, show), model.HintRole)\n        self.commit.deferred()\n\n    @Inputs.data\n    @check_sql_input\n    def set_data(self, data):\n        self.data = data\n        self._var_cache.clear()\n        domain = data.domain if data else None\n        self.disc_view.model().set_domain(domain)\n        self.cont_view.model().set_domain(domain)\n        if data:\n            # Clean up hints only when receiving new data, not on disconnection\n            self._set_hints()\n        self.commit.now()\n\n    def _set_hints(self):\n        assert self.data\n\n        # Backward compatibility for settings < 3\n        class_treatment = self.disc_var_hints.get(BackCompatClass, None)\n        if class_treatment is not None \\\n                and self.data.domain.class_var is not None:\n            self.disc_var_hints[self.data.domain.class_var.name] \\\n                = class_treatment\n\n        for hints, model, options in (\n                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),\n                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):\n            filtered = {DefaultKey: hints[DefaultKey]}\n            for i, var in enumerate(model):\n                if isinstance(var, LabelledSeparator):\n                    continue\n                default = self.default_for_var(var)\n                method_id = hints.get(var.name, default)\n                nondefault = method_id != default\n                if nondefault:\n                    filtered[var.name] = method_id\n                model.setData(\n                    model.index(i, 0),\n                    (options[method_id].short_desc, nondefault),\n                    model.HintRole)\n            hints.clear()\n            hints.update(filtered)\n\n    def _on_reset_hints(self):\n        if not self.data:\n            return\n        self.cont_var_hints.clear()\n        self.disc_var_hints.clear()\n        self.disc_var_hints[DefaultKey] = ContinuizationDefault\n        self.cont_var_hints[DefaultKey] = NormalizationDefault\n        self._set_hints()\n        self.cont_view.set_default_method(\n            ContinuousOptions[ContinuizationDefault].short_desc)\n        self.disc_view.set_default_method(\n            ContinuousOptions[NormalizationDefault].short_desc)\n\n    @gui.deferred\n    def commit(self):\n        self.Outputs.data.send(self._prepare_output())\n\n    def _prepare_output(self):\n        self.Error.unsupported_sparse.clear()\n        if not self.data:\n            return None\n        if unsupp_sparse := self._unsupported_sparse():\n            if len(unsupp_sparse) == 1:\n                self.Error.unsupported_sparse(unsupp_sparse[0])\n            else:\n                self.Error.unsupported_sparse(\"\\n\" + \", \".join(unsupp_sparse))\n            return None\n\n        domain = self.data.domain\n        attrs = self._create_vars(domain.attributes)\n        class_vars = self._create_vars(domain.class_vars)\n        metas = self._create_vars(domain.metas)\n        return self.data.transform(Domain(attrs, class_vars, metas))\n\n    def _unsupported_sparse(self):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        domain = self.data.domain\n        disc = set()\n        cont = set()\n        # At the time of writing, self.data.Y cannot be sparse (setter for\n        # `Y` converts it to dense, as done in\n        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)\n        # Including it here doesn't hurt, though.\n        for part, attrs in ((self.data.X, domain.attributes),\n                            (self.data.Y, domain.class_vars),\n                            (self.data.metas, domain.metas)):\n            if sp.issparse(part):\n                disc |= {self._hint_for_var(var)\n                         for var in attrs\n                         if var.is_discrete}\n                cont |= {self._hint_for_var(var)\n                         for var in attrs\n                         if type(var) is ContinuousVariable}\n        disc &= {method.id_\n                 for method in DiscreteOptions.values()\n                 if not method.supports_sparse}\n        cont &= {method.id_\n                 for method in ContinuousOptions.values()\n                 if not method.supports_sparse}\n\n        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order\n        return [method.label\n                for methods, problems in ((DiscreteOptions, disc),\n                                          (ContinuousOptions, cont))\n                for method in methods.values() if method.id_ in problems]\n\n    def _create_vars(self, part):\n        # time is not continuous, pylint: disable=unidiomatic-typecheck\n        return sum(\n            (self._continuized_vars(var) if var.is_discrete\n             else self._scaled_vars(var) if type(var) is ContinuousVariable\n             else [var]\n             for var in part),\n            start=[])\n\n    def _get(self, var, stat):\n        def most_frequent(col):\n            col = col[np.isfinite(col)].astype(int)\n            counts = np.bincount(col, minlength=len(var.values))\n            return np.argmax(counts)\n\n        funcs = {\"min\": np.nanmin, \"max\": np.nanmax,\n                 \"mean\": np.nanmean, \"std\": np.nanstd,\n                 \"major\": most_frequent}\n        name = var.name\n        cache = self._var_cache.setdefault(name, {})\n        if stat not in cache:\n            cache[stat] = funcs[stat](self.data.get_column(var))\n        return cache[stat]\n\n    def is_attr(self, var):\n        domain = self.data.domain\n        return 0 <= domain.index(var) < len(domain.attributes)\n\n    def default_for_var(self, var):\n        if self.is_attr(var):\n            return DefaultId\n        return Continuize.Leave if var.is_discrete else Normalize.Leave\n\n    def _hint_for_var(self, var):\n        if var.is_discrete:\n            hints, leave_id = self.disc_var_hints, Continuize.Leave\n        else:\n            hints, leave_id = self.cont_var_hints, Normalize.Leave\n\n        # Default for attributes is given by \"default\"\n        if self.is_attr(var):\n            return hints.get(var.name, hints[DefaultKey])\n\n        # For metas and targets, default is Leave\n        # If user changes it to \"Default\", default is used\n        hint = hints.get(var.name, leave_id)\n        if hint == DefaultId:\n            hint = hints[DefaultKey]\n        return hint\n\n    def _scaled_vars(self, var):\n        hint = self._hint_for_var(var)\n        if hint == Normalize.Leave:\n            return [var]\n\n        get = partial(self._get, var)\n        if hint == Normalize.Standardize:\n            off, scale = get(\"mean\"), 1 / (get(\"std\") or 1)\n        elif hint == Normalize.Center:\n            off, scale = get(\"mean\"), 1\n        elif hint == Normalize.Scale:\n            off, scale = 0, 1 / (get(\"std\") or 1)\n        else:\n            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f\"hint={hint}?!\"\n            min_, max_ = get(\"min\"), get(\"max\")\n            span = (max_ - min_) or 1\n            if hint == Normalize.Normalize11:\n                off, scale = (min_ + max_) / 2, 2 / span\n            else:\n                off, scale = min_, 1 / span\n\n        return [ContinuousVariable(\n            var.name,\n            compute_value=Normalizer(var, off, scale))]\n\n    def _continuized_vars(self, var, hint=None):\n        if hint is None:\n            hint = self._hint_for_var(var)\n\n        # Single variable\n        if hint == Continuize.Leave:\n            return [var]\n        if hint == Continuize.Remove:\n            return []\n        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \\\n                hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.RemoveMultinomial:\n            assert len(var.values) > 2\n            return []\n        if hint == Continuize.AsOrdinal:\n            return [ContinuousVariable(var.name,\n                                       compute_value=Identity(var))]\n        if hint == Continuize.AsNormalizedOrdinal:\n            scale = 1 / (len(var.values) - 1 or 1)\n            return [ContinuousVariable(var.name,\n                                       compute_value=Normalizer(var, 0, scale))]\n\n        # Multiple dummy variables\n        if hint == Continuize.FirstAsBase:\n            base = 0\n        elif hint == Continuize.FrequentAsBase:\n            base = self._get(var, \"major\")\n        elif hint == Continuize.Indicators:\n            base = None\n        else:\n            assert False, f\"hint={hint}?!\"\n        return [\n            ContinuousVariable(f\"{var.name}={value}\",\n                               compute_value=Indicator(var, value=i))\n            for i, value in enumerate(var.values)\n            if i != base\n        ]\n\n    def send_report(self):\n        if not self.data:\n            return\n        single_disc = len(self.disc_view.model()) > 0 \\\n                      and len(self.disc_var_hints) == 1 \\\n                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()\n        single_cont = len(self.cont_view.model()) > 0 \\\n                      and len(self.cont_var_hints) == 1 \\\n                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()\n        if single_disc and single_cont:\n            self.report_items(\n                ((\"Categorical variables\", single_disc),\n                 (\"Numeric variables\", single_cont))\n            )\n        else:\n            if single_disc:\n                self.report_paragraph(\"Categorical variables\", single_disc)\n            elif len(self.disc_view.model()) > 0:\n                self.report_items(\n                    \"Categorical variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      DiscreteOptions[id_].label.lower())\n                     for name, id_ in self.disc_var_hints.items()])\n            if single_cont:\n                self.report_paragraph(\"Numeric variables\", single_cont)\n            elif len(self.cont_view.model()) > 0:\n                self.report_items(\n                    \"Numeric variables\",\n                    [(\"Preset\" if name == DefaultKey else name,\n                      ContinuousOptions[id_].label.lower())\n                     for name, id_ in self.cont_var_hints.items()])\n            self.report_paragraph(\"Unlisted\",\n                \"Any unlisted attributes default to preset option, and \"\n                \"unlisted meta attributes and target variables are kept \"\n                \"as they are\")\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 2:\n            cont_treat = settings.pop(\"continuous_treatment\", 0)\n            zero_based = settings.pop(\"zero_based\", True)\n            if cont_treat == 1:\n                if zero_based:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize01\n                else:\n                    settings[\"continuous_treatment\"] = Normalize.Normalize11\n            elif cont_treat == 2:\n                settings[\"continuous_treatment\"] = Normalize.Standardize\n        if version < 3:\n            settings[\"cont_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"continuous_treatment\", Normalize.Leave)}\n            settings[\"disc_var_hints\"] = \\\n                {DefaultKey:\n                 settings.pop(\"multinomial_treatment\", Continuize.FirstAsBase)}\n            class_treatment = settings.pop(\"class_treatment\", Continuize.Leave)\n            if class_treatment != Continuize.Leave:\n                settings[\"disc_var_hints\"][BackCompatClass] = class_treatment\n\n\n# Backward compatibility for unpickling settings\nOWContinuize.Normalize = Normalize\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWContinuize).run(Table(\"heart_disease\"))\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

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

**Description:**
When migrating settings from older versions, the `multinomial_treatment` and `class_treatment` values are not being mapped correctly to their new representations. This results in incorrect treatment hints being applied, which affects the behavior of the `OWContinuize` widget.

**Example Buggy Code:**
```python
widget = OWContinuize(stored_settings={
    'multinomial_treatment': 2,  # Expected to map to Continuize.Indicators
    'class_treatment': 3          # Expected to map to Continuize.AsOrdinal
})

# After migration, the widget's disc_var_hints should reflect the correct mappings
print(widget.disc_var_hints[DefaultKey])  # Unexpected output: 2 instead of Continuize.Indicators
print(widget.disc_var_hints['y'])         # Unexpected output: 3 instead of Continuize.AsOrdinal
```

**Expected Behavior:**
- The `multinomial_treatment` value of `2` should correctly map to `Continuize.Indicators`.
- The `class_treatment` value of `3` should correctly map to `Continuize.AsOrdinal`.
- As a result, `widget.disc_var_hints` should reflect these mappings accurately, ensuring the widget behaves as intended.

**Actual Behavior:**
- The `multinomial_treatment` value of `2` is incorrectly retained as `2` instead of mapping to `Continuize.Indicators`.
- The `class_treatment` value of `3` is incorrectly retained as `3` instead of mapping to `Continuize.AsOrdinal`.
- This leads to `widget.disc_var_hints` containing unexpected numeric values, causing inconsistent widget behavior and failed tests that rely on correct mappings.
[/ISSUE]
--- END ISSUE ---

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

--- BEGIN FILE ---
```
### Orange/widgets/data/owcontinuize.py
from functools import partial
from types import SimpleNamespace
from typing import NamedTuple, Dict, List

import numpy as np
import scipy.sparse as sp

from AnyQt.QtCore import Qt, QSize, QAbstractListModel, QObject, \
    QItemSelectionModel
from AnyQt.QtGui import QColor
from AnyQt.QtWidgets import QButtonGroup, QRadioButton, QListView

from orangewidget.utils import listview
from orangewidget.utils.itemmodels import SeparatedListDelegate, \
    LabelledSeparator

from Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table
from Orange.preprocess import Continuize as Continuizer
from Orange.preprocess.transformation import Identity, Indicator, Normalizer
from Orange.widgets import gui, widget
from Orange.widgets.settings import Setting
from Orange.widgets.utils.itemmodels import DomainModel
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output


class MethodDesc(NamedTuple):
    id_: int
    label: str  # Label used for radio button
    short_desc: str  # Short description for list views
    tooltip: str  # Tooltip for radio button
    supports_sparse: bool = True


DefaultKey = ""
DefaultId = 99
BackCompatClass = object()

Continuize = SimpleNamespace(
    Default=DefaultId,
    **{v.name: v.value for v in Continuizer.MultinomialTreatment})

DiscreteOptions: Dict[int, MethodDesc] = {
    method.id_: method
    for method in (
        MethodDesc(
            Continuize.Default, "Use preset", "preset",
            "Treat the variable as defined in preset"),
        MethodDesc(
            Continuize.Leave, "Keep categorical", "keep as is",
            "Keep the variable discrete"),
        MethodDesc(
            Continuize.FirstAsBase, "First value as base", "first as base",
            "One indicator variable for each value except the first"),
        MethodDesc(
            Continuize.FrequentAsBase, "Most frequent as base", "frequent as base",
            "One indicator variable for each value except the most frequent",
            False),
        MethodDesc(
            Continuize.Indicators, "One-hot encoding", "one-hot",
            "One indicator variable for each value",
            False),
        MethodDesc(
            Continuize.RemoveMultinomial, "Remove if more than 2 values", "remove if >2",
            "Remove variables with more than two values; indicator otherwise"),
        MethodDesc(
            Continuize.Remove, "Remove", "remove",
            "Remove variable"),
        MethodDesc(
            Continuize.AsOrdinal, "Treat as ordinal", "as ordinal",
            "Each value gets a consecutive number from 0 to number of values - 1"),
        MethodDesc(
            Continuize.AsNormalizedOrdinal, "Treat as normalized ordinal", "as norm. ordinal",
            "Same as above, but scaled to [0, 1]")
    )}

ContinuizationDefault = Continuize.FirstAsBase


Normalize = SimpleNamespace(Default=DefaultId,
                            Leave=0, Standardize=1, Center=2, Scale=3,
                            Normalize11=4, Normalize01=5)

ContinuousOptions: Dict[int, MethodDesc] = {
    method.id_: method
    for method in (
        MethodDesc(
            Normalize.Default, "Use preset", "preset",
            "Treat the variable as defined in 'default setting'"),
        MethodDesc(
            Normalize.Leave, "Keep as it is", "no change",
            "Keep the variable as it is"),
        MethodDesc(
            Normalize.Standardize, "Standardize to μ=0, σ²=1", "standardize",
            "Subtract the mean and divide by standard deviation",
            False),
        MethodDesc(
            Normalize.Center, "Center to μ=0", "center",
            "Subtract the mean",
            False),
        MethodDesc(
            Normalize.Scale, "Scale to σ²=1", "scale",
            "Divide by standard deviation"),
        MethodDesc(
            Normalize.Normalize11, "Normalize to interval [-1, 1]", "to [-1, 1]",
            "Linear transformation into interval [-1, 1]",
            False),
        MethodDesc(
            Normalize.Normalize01, "Normalize to interval [0, 1]", "to [0, 1]",
            "Linear transformation into interval [0, 1]",
            False),
    )}

NormalizationDefault = Normalize.Leave


class ContDomainModel(DomainModel):
    HintRole = next(gui.OrangeUserRole)
    FilterRole = next(gui.OrangeUserRole)
    """Domain model that adds description of chosen methods"""
    def __init__(self, valid_type):
        super().__init__(
            order=(DomainModel.ATTRIBUTES,
                   LabelledSeparator("Meta attributes"), DomainModel.METAS,
                   LabelledSeparator("Targets"), DomainModel.CLASSES),
            valid_types=(valid_type, ), strict_type=True)

    def data(self, index, role=Qt.DisplayRole):
        if role == Qt.ToolTipRole:
            return None
        if role == self.FilterRole:
            name = super().data(index, Qt.DisplayRole)
            if not isinstance(name, str):
                return None
            hint = index.data(self.HintRole)
            if hint is None:
                return name
            return f"{name} {hint[0]}"
        value = super().data(index, role)
        if role == Qt.DisplayRole:
            if isinstance(value, LabelledSeparator):
                return None
            return value, *(index.data(self.HintRole) or ("", False))
        return value


class DefaultContModel(QAbstractListModel):
    """A model used for showing "Default settings" above the list view"""
    icon = None

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if DefaultContModel.icon is None:
            DefaultContModel.icon = gui.createAttributePixmap(
                "★", QColor(0, 0, 0, 0), Qt.black)
        self.method = ""

    @staticmethod
    def rowCount(parent):
        return 0 if parent.isValid() else 1

    @staticmethod
    def columnCount(parent):
        return 0 if parent.isValid() else 1

    def data(self, _, role=Qt.DisplayRole):
        if role == Qt.DisplayRole:
            return f"Preset: {self.method}"
        elif role == Qt.DecorationRole:
            return self.icon
        elif role == Qt.ToolTipRole:
            return "Default for variables without specific settings"
        return None

    def setMethod(self, method):
        self.method = method
        self.dataChanged.emit(self.index(0, 0), self.index(0, 0))


class ListViewSearch(listview.ListViewSearch):
    """
    A list view with two components shown above it:
    - a listview containing a single item representing default settings
    - a filter for search

    The class is based on listview.ListViewSearch and needs to have the same
    name in order to override its private method __layout.

    Inherited __init__ calls __layout, so `default_view` must be constructed
    there. Construction before calling super().__init__ doesn't work because
    PyQt does not allow it.
    """
    class Delegate(SeparatedListDelegate):
        """
        A delegate that shows items (variables) with specific settings in bold
        """
        def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            self._default_hints = False

        def initStyleOption(self, option, index):
            super().initStyleOption(option, index)
            hint = index.data(ContDomainModel.HintRole)
            option.font.setBold(hint is not None and hint[1])

        def set_default_hints(self, show):
            self._default_hints = show

        def displayText(self, value, _):
            if value is None:
                return None
            name, hint, nondefault = value
            if self._default_hints or nondefault:
                name += f": {hint}"
            return name

    def __init__(self, *args, **kwargs):
        self.default_view = None
        super().__init__(preferred_size=QSize(350, -1), *args, **kwargs)
        self.setItemDelegate(self.Delegate(self))
        self.force_hints = False

    def select_default(self):
        """Select the item representing default settings"""
        self.default_view.selectionModel().select(
            self.default_view.model().index(0),
            QItemSelectionModel.Select)

    def set_default_method(self, method):
        self.default_view.model().setMethod(method)

    # pylint: disable=unused-private-member
    def __layout(self):
        if self.default_view is None:  # __layout was called from __init__
            view = self.default_view = QListView(self)
            view.setModel(DefaultContModel())
            self.filterProxyModel().setFilterRole(ContDomainModel.FilterRole)
            view.verticalScrollBar().setDisabled(True)
            view.horizontalScrollBar().setDisabled(True)
            view.setHorizontalScrollBarPolicy(
                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
            view.setVerticalScrollBarPolicy(
                Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
            font = view.font()
            font.setBold(True)
            view.setFont(font)
        else:
            view = self.default_view

        # Put the list view with default on top
        margins = self.viewportMargins()
        def_height = view.sizeHintForRow(0) + 2 * view.spacing() + 2
        view.setGeometry(0, 0, self.geometry().width(), def_height)
        view.setFixedHeight(def_height)

        # Then search
        search = self.__search
        src_height = search.sizeHint().height()
        size = self.size()
        search.setGeometry(0, def_height + 2, size.width(), src_height)

        # Then the real list view
        margins.setTop(def_height + 2 + src_height)
        self.setViewportMargins(margins)

    def event(self, ev):
        if ev.type() == ev.ToolTip:
            self.itemDelegate().set_default_hints(True)
            self.viewport().update()
            return True
        return super().event(ev)

    def leaveEvent(self, _):
        self.itemDelegate().set_default_hints(False)
        self.viewport().update()


class OWContinuize(widget.OWWidget):
    # Many false positives for `hints`; pylint ignores type annotations
    # pylint: disable=unsubscriptable-object,unsupported-assignment-operation
    # pylint: disable=unsupported-membership-test, unsupported-delete-operation
    name = "Continuize"
    description = ("Transform categorical attributes into numeric and, " +
                   "optionally, scale numeric values.")
    icon = "icons/Continuize.svg"
    category = "Transform"
    keywords = "continuize, encode, dummy, numeric, one-hot, binary, treatment, contrast"
    priority = 2120

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

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

    class Error(widget.OWWidget.Error):
        unsupported_sparse = \
            widget.Msg("Some chosen methods do support sparse data: {}")

    want_control_area = False

    settings_version = 3
    disc_var_hints: Dict[str, int] = Setting(
        {DefaultKey: ContinuizationDefault}, schema_only=True)
    cont_var_hints: Dict[str, int] = Setting(
        {DefaultKey: NormalizationDefault}, schema_only=True)
    autosend = Setting(True)

    def __init__(self):
        super().__init__()
        self.data = None
        self._var_cache = {}

        def create(title, vartype, methods):
            hbox = gui.hBox(box, title)
            view = ListViewSearch(
                selectionMode=ListViewSearch.ExtendedSelection,
                uniformItemSizes=True)
            view.setModel(ContDomainModel(vartype))
            view.selectionModel().selectionChanged.connect(
                lambda: self._on_var_selection_changed(view))
            view.default_view.selectionModel().selectionChanged.connect(
                lambda selected: self._on_default_selected(view, selected))
            hbox.layout().addWidget(view)

            bbox = gui.vBox(hbox)
            bgroup = QButtonGroup(self)
            bgroup.idClicked.connect(self._on_radio_clicked)
            for desc in methods.values():
                button = QRadioButton(desc.label)
                button.setToolTip(desc.tooltip)
                bgroup.addButton(button, desc.id_)
                bbox.layout().addWidget(button)
            bbox.layout().addStretch(1)
            return hbox, view, bbox, bgroup

        box = gui.vBox(self.mainArea, True, spacing=8)
        self.disc_box, self.disc_view, self.disc_radios, self.disc_group = \
            create("Categorical Variables", DiscreteVariable, DiscreteOptions)
        self.disc_view.set_default_method(
            DiscreteOptions[self.disc_var_hints[DefaultKey]].short_desc)
        self.disc_view.select_default()

        self.cont_box, self.cont_view, self.cont_radios, self.cont_group = \
            create("Numeric Variables", ContinuousVariable, ContinuousOptions)
        self.cont_view.set_default_method(
            ContinuousOptions[self.cont_var_hints[DefaultKey]].short_desc)
        self.cont_view.select_default()

        boxes = (self.disc_radios, self.cont_radios)
        width = max(box.sizeHint().width() for box in boxes)
        for box in boxes:
            box.setFixedWidth(width)

        box = gui.hBox(self.mainArea)
        gui.button(
            box, self, "Reset All", callback=self._on_reset_hints,
            autoDefault=False)
        gui.rubber(box)
        gui.auto_apply(box, self, "autosend")

    def _on_var_selection_changed(self, view):
        if not view.selectionModel().selectedIndexes():
            # Prevent infinite recursion (with _on_default_selected)
            return
        view.default_view.selectionModel().clearSelection()
        self._update_radios(view)

    def _on_default_selected(self, view, selected):
        if not selected:
            # Prevent infinite recursion (with _var_selection_selected)
            return
        view.selectionModel().clearSelection()
        self._update_radios(view)

    def selected_vars(self, view) -> List[str]:
        """
        Return selected variables

        If 'Default settings' are selected, this returns DefaultKey
        """
        model = view.model()
        return [model[index.row()]
                for index in view.selectionModel().selectedRows()]

    def _update_radios(self, view):
        if view is self.disc_view:
            group, hints = self.disc_group, self.disc_var_hints
        else:
            group, hints = self.cont_group, self.cont_var_hints

        selvars = self.selected_vars(view)
        if not selvars:
            self._check_button(group, hints[DefaultKey], True)
            self._set_radio_enabled(group, DefaultId, False)
            return

        self._set_radio_enabled(group, DefaultId, True)
        options = {hints.get(var.name, self.default_for_var(var))
                   for var in selvars}
        if len(options) == 1:
            self._check_button(group, options.pop(), True)
        else:
            self._uncheck_all_buttons(group)

    @staticmethod
    def _uncheck_all_buttons(group: QButtonGroup):
        button = group.checkedButton()
        if button is not None:
            group.setExclusive(False)
            button.setChecked(False)
            group.setExclusive(True)

    def _set_radio_enabled(
            self, group: QButtonGroup, method_id: int, value: bool):
        if group.button(method_id).isChecked() and not value:
            self._uncheck_all_buttons(group)
        group.button(method_id).setEnabled(value)

    @staticmethod
    def _check_button(group: QButtonGroup, method_id: int, checked: bool):
        group.button(method_id).setChecked(checked)

    def _on_radio_clicked(self, method_id: int):
        if QObject().sender() is self.disc_group:
            view, hints, methods = \
                self.disc_view, self.disc_var_hints, DiscreteOptions
            leave_id = Continuize.Leave
        else:
            view, hints, methods = \
                self.cont_view, self.cont_var_hints, ContinuousOptions
            leave_id = Normalize.Leave
        selvars = self.selected_vars(view)
        if not selvars:
            hints[DefaultKey] = method_id
            view.set_default_method(methods[method_id].short_desc)
        else:
            keys = [var.name for var in selvars]
            indexes = view.selectionModel().selectedIndexes()
            model = view.model()
            # These two keys may delete values from dict, hence we must loop
            if method_id in (DefaultId, leave_id):
                for key in keys:
                    # Attributes do not store the hint if it equals Default;
                    # metas and targets do not store it if it is Leave
                    if method_id == (DefaultId if self.is_attr(key) else leave_id):
                        if key in hints:
                            del hints[key]
                    else:
                        hints[key] = method_id
            else:
                hints.update(dict.fromkeys(keys, method_id))
            desc = methods[method_id].short_desc
            for index, var in zip(indexes, selvars):
                show = method_id != self.default_for_var(var)
                model.setData(index, (desc, show), model.HintRole)
        self.commit.deferred()

    @Inputs.data
    @check_sql_input
    def set_data(self, data):
        self.data = data
        self._var_cache.clear()
        domain = data.domain if data else None
        self.disc_view.model().set_domain(domain)
        self.cont_view.model().set_domain(domain)
        if data:
            # Clean up hints only when receiving new data, not on disconnection
            self._set_hints()
        self.commit.now()

    def _set_hints(self):
        assert self.data

        # Backward compatibility for settings < 3
        class_treatment = self.disc_var_hints.get(BackCompatClass, None)
        if class_treatment is not None \
                and self.data.domain.class_var is not None:
            self.disc_var_hints[self.data.domain.class_var.name] \
                = class_treatment

        for hints, model, options in (
                (self.cont_var_hints, self.cont_view.model(), ContinuousOptions),
                (self.disc_var_hints, self.disc_view.model(), DiscreteOptions)):
            filtered = {DefaultKey: hints[DefaultKey]}
            for i, var in enumerate(model):
                if isinstance(var, LabelledSeparator):
                    continue
                default = self.default_for_var(var)
                method_id = hints.get(var.name, default)
                nondefault = method_id != default
                if nondefault:
                    filtered[var.name] = method_id
                model.setData(
                    model.index(i, 0),
                    (options[method_id].short_desc, nondefault),
                    model.HintRole)
            hints.clear()
            hints.update(filtered)

    def _on_reset_hints(self):
        if not self.data:
            return
        self.cont_var_hints.clear()
        self.disc_var_hints.clear()
        self.disc_var_hints[DefaultKey] = ContinuizationDefault
        self.cont_var_hints[DefaultKey] = NormalizationDefault
        self._set_hints()
        self.cont_view.set_default_method(
            ContinuousOptions[ContinuizationDefault].short_desc)
        self.disc_view.set_default_method(
            ContinuousOptions[NormalizationDefault].short_desc)

    @gui.deferred
    def commit(self):
        self.Outputs.data.send(self._prepare_output())

    def _prepare_output(self):
        self.Error.unsupported_sparse.clear()
        if not self.data:
            return None
        if unsupp_sparse := self._unsupported_sparse():
            if len(unsupp_sparse) == 1:
                self.Error.unsupported_sparse(unsupp_sparse[0])
            else:
                self.Error.unsupported_sparse("\n" + ", ".join(unsupp_sparse))
            return None

        domain = self.data.domain
        attrs = self._create_vars(domain.attributes)
        class_vars = self._create_vars(domain.class_vars)
        metas = self._create_vars(domain.metas)
        return self.data.transform(Domain(attrs, class_vars, metas))

    def _unsupported_sparse(self):
        # time is not continuous, pylint: disable=unidiomatic-typecheck
        domain = self.data.domain
        disc = set()
        cont = set()
        # At the time of writing, self.data.Y cannot be sparse (setter for
        # `Y` converts it to dense, as done in
        # https://github.com/biolab/orange3/commit/a18f38059caf37f3b329d6ad688189561959bb24)
        # Including it here doesn't hurt, though.
        for part, attrs in ((self.data.X, domain.attributes),
                            (self.data.Y, domain.class_vars),
                            (self.data.metas, domain.metas)):
            if sp.issparse(part):
                disc |= {self._hint_for_var(var)
                         for var in attrs
                         if var.is_discrete}
                cont |= {self._hint_for_var(var)
                         for var in attrs
                         if type(var) is ContinuousVariable}
        disc &= {method.id_
                 for method in DiscreteOptions.values()
                 if not method.supports_sparse}
        cont &= {method.id_
                 for method in ContinuousOptions.values()
                 if not method.supports_sparse}

        # Retrieve them from DiscreteOptions/ContinuousOptions to keep the order
        return [method.label
                for methods, problems in ((DiscreteOptions, disc),
                                          (ContinuousOptions, cont))
                for method in methods.values() if method.id_ in problems]

    def _create_vars(self, part):
        # time is not continuous, pylint: disable=unidiomatic-typecheck
        return sum(
            (self._continuized_vars(var) if var.is_discrete
             else self._scaled_vars(var) if type(var) is ContinuousVariable
             else [var]
             for var in part),
            start=[])

    def _get(self, var, stat):
        def most_frequent(col):
            col = col[np.isfinite(col)].astype(int)
            counts = np.bincount(col, minlength=len(var.values))
            return np.argmax(counts)

        funcs = {"min": np.nanmin, "max": np.nanmax,
                 "mean": np.nanmean, "std": np.nanstd,
                 "major": most_frequent}
        name = var.name
        cache = self._var_cache.setdefault(name, {})
        if stat not in cache:
            cache[stat] = funcs[stat](self.data.get_column(var))
        return cache[stat]

    def is_attr(self, var):
        domain = self.data.domain
        return 0 <= domain.index(var) < len(domain.attributes)

    def default_for_var(self, var):
        if self.is_attr(var):
            return DefaultId
        return Continuize.Leave if var.is_discrete else Normalize.Leave

    def _hint_for_var(self, var):
        if var.is_discrete:
            hints, leave_id = self.disc_var_hints, Continuize.Leave
        else:
            hints, leave_id = self.cont_var_hints, Normalize.Leave

        # Default for attributes is given by "default"
        if self.is_attr(var):
            return hints.get(var.name, hints[DefaultKey])

        # For metas and targets, default is Leave
        # If user changes it to "Default", default is used
        hint = hints.get(var.name, leave_id)
        if hint == DefaultId:
            hint = hints[DefaultKey]
        return hint

    def _scaled_vars(self, var):
        hint = self._hint_for_var(var)
        if hint == Normalize.Leave:
            return [var]

        get = partial(self._get, var)
        if hint == Normalize.Standardize:
            off, scale = get("mean"), 1 / (get("std") or 1)
        elif hint == Normalize.Center:
            off, scale = get("mean"), 1
        elif hint == Normalize.Scale:
            off, scale = 0, 1 / (get("std") or 1)
        else:
            assert hint in (Normalize.Normalize11, Normalize.Normalize01), f"hint={hint}?!"
            min_, max_ = get("min"), get("max")
            span = (max_ - min_) or 1
            if hint == Normalize.Normalize11:
                off, scale = (min_ + max_) / 2, 2 / span
            else:
                off, scale = min_, 1 / span

        return [ContinuousVariable(
            var.name,
            compute_value=Normalizer(var, off, scale))]

    def _continuized_vars(self, var, hint=None):
        if hint is None:
            hint = self._hint_for_var(var)

        # Single variable
        if hint == Continuize.Leave:
            return [var]
        if hint == Continuize.Remove:
            return []
        if hint == Continuize.RemoveMultinomial and len(var.values) <= 2 or \
                hint == Continuize.AsOrdinal:
            return [ContinuousVariable(var.name,
                                       compute_value=Identity(var))]
        if hint == Continuize.RemoveMultinomial:
            assert len(var.values) > 2
            return []
        if hint == Continuize.AsOrdinal:
            return [ContinuousVariable(var.name,
                                       compute_value=Identity(var))]
        if hint == Continuize.AsNormalizedOrdinal:
            scale = 1 / (len(var.values) - 1 or 1)
            return [ContinuousVariable(var.name,
                                       compute_value=Normalizer(var, 0, scale))]

        # Multiple dummy variables
        if hint == Continuize.FirstAsBase:
            base = 0
        elif hint == Continuize.FrequentAsBase:
            base = self._get(var, "major")
        elif hint == Continuize.Indicators:
            base = None
        else:
            assert False, f"hint={hint}?!"
        return [
            ContinuousVariable(f"{var.name}={value}",
                               compute_value=Indicator(var, value=i))
            for i, value in enumerate(var.values)
            if i != base
        ]

    def send_report(self):
        if not self.data:
            return
        single_disc = len(self.disc_view.model()) > 0 \
                      and len(self.disc_var_hints) == 1 \
                      and DiscreteOptions[self.disc_var_hints[DefaultKey]].label.lower()
        single_cont = len(self.cont_view.model()) > 0 \
                      and len(self.cont_var_hints) == 1 \
                      and ContinuousOptions[self.cont_var_hints[DefaultKey]].label.lower()
        if single_disc and single_cont:
            self.report_items(
                (("Categorical variables", single_disc),
                 ("Numeric variables", single_cont))
            )
        else:
            if single_disc:
                self.report_paragraph("Categorical variables", single_disc)
            elif len(self.disc_view.model()) > 0:
                self.report_items(
                    "Categorical variables",
                    [("Preset" if name == DefaultKey else name,
                      DiscreteOptions[id_].label.lower())
                     for name, id_ in self.disc_var_hints.items()])
            if single_cont:
                self.report_paragraph("Numeric variables", single_cont)
            elif len(self.cont_view.model()) > 0:
                self.report_items(
                    "Numeric variables",
                    [("Preset" if name == DefaultKey else name,
                      ContinuousOptions[id_].label.lower())
                     for name, id_ in self.cont_var_hints.items()])
            self.report_paragraph("Unlisted",
                "Any unlisted attributes default to preset option, and "
                "unlisted meta attributes and target variables are kept "
                "as they are")

    @classmethod
    def migrate_settings(cls, settings, version):
        if version < 2:
            cont_treat = settings.pop("continuous_treatment", 0)
            zero_based = settings.pop("zero_based", True)
            if cont_treat == 1:
                if zero_based:
                    settings["continuous_treatment"] = Normalize.Normalize01
                else:
                    settings["continuous_treatment"] = Normalize.Normalize11
            elif cont_treat == 2:
                settings["continuous_treatment"] = Normalize.Standardize
        if version < 3:
            settings["cont_var_hints"] = \
                {DefaultKey:
                 settings.pop("continuous_treatment", Normalize.Leave)}
            settings["disc_var_hints"] = \
                {DefaultKey:
                 settings.pop("multinomial_treatment", Continuize.FirstAsBase)}
            class_treatment = settings.pop("class_treatment", Continuize.Leave)
            if class_treatment != Continuize.Leave:
                settings["disc_var_hints"][BackCompatClass] = class_treatment


# Backward compatibility for unpickling settings
OWContinuize.Normalize = Normalize


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

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