{
    "file_diffs": [
        {
            "old_file_content": "from collections import namedtuple\nfrom typing import Optional\n\nfrom AnyQt.QtWidgets import QListView, QHBoxLayout, QStyledItemDelegate\nfrom AnyQt.QtCore import Qt\n\nimport Orange.data\nimport Orange.preprocess.discretize as disc\n\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.utils import itemmodels, vartype\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\n__all__ = [\"OWDiscretize\"]\n\n# 'Default' method delegates to 'method'\nDefault = namedtuple(\"Default\", [\"method\"])\nLeave = namedtuple(\"Leave\", [])\nMDL = namedtuple(\"MDL\", [])\nEqualFreq = namedtuple(\"EqualFreq\", [\"k\"])\nEqualWidth = namedtuple(\"EqualWidth\", [\"k\"])\nRemove = namedtuple(\"Remove\", [])\nCustom = namedtuple(\"Custom\", [\"points\"])\n\nMETHODS = [\n    (Default, ),\n    (Leave, ),\n    (MDL, ),\n    (EqualFreq, ),\n    (EqualWidth, ),\n    (Remove, ),\n    (Custom, )\n]\n\n_dispatch = {\n    Default:\n        lambda m, data, var: _dispatch[type(m.method)](m.method, data, var),\n    Leave: lambda m, data, var: var,\n    MDL: lambda m, data, var: disc.EntropyMDL()(data, var),\n    EqualFreq: lambda m, data, var: disc.EqualFreq(m.k)(data, var),\n    EqualWidth: lambda m, data, var: disc.EqualWidth(m.k)(data, var),\n    Remove: lambda m, data, var: None,\n    Custom:\n        lambda m, data, var:\n        disc.Discretizer.create_discretized_var(var, m.points)\n}\n\n\n# Variable discretization state\nDState = namedtuple(\n    \"DState\",\n    [\"method\",    # discretization method\n     \"points\",    # induced cut points\n     \"disc_var\"]  # induced discretized variable\n)\n\n\ndef is_derived(var):\n    return var.compute_value is not None\n\n\ndef is_discretized(var):\n    return isinstance(var.compute_value, disc.Discretizer)\n\n\ndef variable_key(var):\n    return vartype(var), var.name\n\n\ndef button_group_reset(group):\n    button = group.checkedButton()\n    if button is not None:\n        group.setExclusive(False)\n        button.setChecked(False)\n        group.setExclusive(True)\n\n\nclass DiscDelegate(QStyledItemDelegate):\n    def initStyleOption(self, option, index):\n        super().initStyleOption(option, index)\n        state = index.data(Qt.UserRole)\n\n        if state is not None:\n            extra = self.cutsText(state)\n            option.text = option.text + \": \" + extra\n\n    @staticmethod\n    def cutsText(state):\n        # This function has many branches, but they don't hurt readabability\n        # pylint: disable=too-many-branches\n        method = state.method\n        name = None\n        # Need a better way to distinguish discretization states\n        # i.e. between 'induced no points v.s. 'removed by choice'\n        if state.points is None and state.disc_var is not None:\n            points = \"\"\n        elif state.points is None:\n            points = \"...\"\n        elif state.points == []:\n            points = \"<removed>\"\n        else:\n            points = \", \".join(map(\"{:.2f}\".format, state.points))\n\n        if isinstance(method, Default):\n            name = None\n        elif isinstance(method, Leave):\n            name = \"(leave)\"\n        elif isinstance(method, MDL):\n            name = \"(entropy)\"\n        elif isinstance(method, EqualFreq):\n            name = \"(equal frequency k={})\".format(method.k)\n        elif isinstance(method, EqualWidth):\n            name = \"(equal width k={})\".format(method.k)\n        elif isinstance(method, Remove):\n            name = \"(removed)\"\n        elif isinstance(method, Custom):\n            name = \"(custom)\"\n        else:\n            assert False\n\n        if name is not None:\n            return points + \" \" + name\n        else:\n            return points\n\n\nclass OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n        else:\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWDiscretize).run(Orange.data.Table(\"brown-selected\"))\n",
            "new_file_content": "from collections import namedtuple\nfrom typing import Optional\n\nfrom AnyQt.QtWidgets import QListView, QHBoxLayout, QStyledItemDelegate\nfrom AnyQt.QtCore import Qt\n\nimport Orange.data\nimport Orange.preprocess.discretize as disc\n\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.utils import itemmodels, vartype\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\n__all__ = [\"OWDiscretize\"]\n\n# 'Default' method delegates to 'method'\nDefault = namedtuple(\"Default\", [\"method\"])\nLeave = namedtuple(\"Leave\", [])\nMDL = namedtuple(\"MDL\", [])\nEqualFreq = namedtuple(\"EqualFreq\", [\"k\"])\nEqualWidth = namedtuple(\"EqualWidth\", [\"k\"])\nRemove = namedtuple(\"Remove\", [])\nCustom = namedtuple(\"Custom\", [\"points\"])\n\nMETHODS = [\n    (Default, ),\n    (Leave, ),\n    (MDL, ),\n    (EqualFreq, ),\n    (EqualWidth, ),\n    (Remove, ),\n    (Custom, )\n]\n\n_dispatch = {\n    Default:\n        lambda m, data, var: _dispatch[type(m.method)](m.method, data, var),\n    Leave: lambda m, data, var: var,\n    MDL: lambda m, data, var: disc.EntropyMDL()(data, var),\n    EqualFreq: lambda m, data, var: disc.EqualFreq(m.k)(data, var),\n    EqualWidth: lambda m, data, var: disc.EqualWidth(m.k)(data, var),\n    Remove: lambda m, data, var: None,\n    Custom:\n        lambda m, data, var:\n        disc.Discretizer.create_discretized_var(var, m.points)\n}\n\n\n# Variable discretization state\nDState = namedtuple(\n    \"DState\",\n    [\"method\",    # discretization method\n     \"points\",    # induced cut points\n     \"disc_var\"]  # induced discretized variable\n)\n\n\ndef is_derived(var):\n    return var.compute_value is not None\n\n\ndef is_discretized(var):\n    return isinstance(var.compute_value, disc.Discretizer)\n\n\ndef variable_key(var):\n    return vartype(var), var.name\n\n\ndef button_group_reset(group):\n    button = group.checkedButton()\n    if button is not None:\n        group.setExclusive(False)\n        button.setChecked(False)\n        group.setExclusive(True)\n\n\nclass DiscDelegate(QStyledItemDelegate):\n    def initStyleOption(self, option, index):\n        super().initStyleOption(option, index)\n        state = index.data(Qt.UserRole)\n\n        if state is not None:\n            extra = self.cutsText(state)\n            option.text = option.text + \": \" + extra\n\n    @staticmethod\n    def cutsText(state):\n        # This function has many branches, but they don't hurt readabability\n        # pylint: disable=too-many-branches\n        method = state.method\n        name = None\n        # Need a better way to distinguish discretization states\n        # i.e. between 'induced no points v.s. 'removed by choice'\n        if state.points is None and state.disc_var is not None:\n            points = \"\"\n        elif state.points is None:\n            points = \"...\"\n        elif state.points == []:\n            points = \"<removed>\"\n        else:\n            points = \", \".join(map(\"{:.2f}\".format, state.points))\n\n        if isinstance(method, Default):\n            name = None\n        elif isinstance(method, Leave):\n            name = \"(leave)\"\n        elif isinstance(method, MDL):\n            name = \"(entropy)\"\n        elif isinstance(method, EqualFreq):\n            name = \"(equal frequency k={})\".format(method.k)\n        elif isinstance(method, EqualWidth):\n            name = \"(equal width k={})\".format(method.k)\n        elif isinstance(method, Remove):\n            name = \"(removed)\"\n        elif isinstance(method, Custom):\n            name = \"(custom)\"\n        else:\n            assert False\n\n        if name is not None:\n            return points + \" \" + name\n        else:\n            return points\n\n\nclass OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWDiscretize).run(Orange.data.Table(\"brown-selected\"))\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/owdiscretize.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "c4b880e35",
                "new_commit_hash": "edfe15ecb",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/owdiscretize.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/owdiscretize.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 245,
                            "length": 6
                        },
                        "new_range": {
                            "start": 245,
                            "length": 9
                        },
                        "section": "class OWDiscretize(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self._update_spin_positions()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.info.set_input_summary(self.info.NoInput)",
                                "type": "added"
                            },
                            {
                                "content": "        self.info.set_output_summary(self.info.NoOutput)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    @Inputs.data",
                                "type": "context"
                            },
                            {
                                "content": "    def set_data(self, data):",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdiscretize.py",
                            "type": "class",
                            "name": "OWDiscretize",
                            "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 128,
                            "end_lineno": 506,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owdiscretize.py",
                            "type": "method",
                            "name": "OWDiscretize.__init__",
                            "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 153,
                            "end_lineno": 249,
                            "parent": {
                                "file_name": "Orange/widgets/data/owdiscretize.py",
                                "type": "class",
                                "name": "OWDiscretize",
                                "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 128,
                                "end_lineno": 506,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 257,
                            "length": 7
                        },
                        "new_range": {
                            "start": 260,
                            "length": 9
                        },
                        "section": "class OWDiscretize(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            self._restore(self.saved_var_states)",
                                "type": "context"
                            },
                            {
                                "content": "            # Complete the induction of cut points",
                                "type": "context"
                            },
                            {
                                "content": "            self._update_points()",
                                "type": "context"
                            },
                            {
                                "content": "            self.info.set_input_summary(len(data))",
                                "type": "added"
                            },
                            {
                                "content": "        else:",
                                "type": "context"
                            },
                            {
                                "content": "            self.info.set_input_summary(self.info.NoInput)",
                                "type": "added"
                            },
                            {
                                "content": "            self._clear()",
                                "type": "context"
                            },
                            {
                                "content": "        self.unconditional_commit()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdiscretize.py",
                            "type": "class",
                            "name": "OWDiscretize",
                            "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 128,
                            "end_lineno": 506,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owdiscretize.py",
                            "type": "method",
                            "name": "OWDiscretize.set_data",
                            "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 253,
                            "end_lineno": 267,
                            "parent": {
                                "file_name": "Orange/widgets/data/owdiscretize.py",
                                "type": "class",
                                "name": "OWDiscretize",
                                "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 128,
                                "end_lineno": 506,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 478,
                            "length": 6
                        },
                        "new_range": {
                            "start": 483,
                            "length": 9
                        },
                        "section": "class OWDiscretize(widget.OWWidget):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        if self.data is not None and len(self.data):",
                                "type": "context"
                            },
                            {
                                "content": "            domain = self.discretized_domain()",
                                "type": "context"
                            },
                            {
                                "content": "            output = self.data.transform(domain)",
                                "type": "context"
                            },
                            {
                                "content": "            self.info.set_output_summary(len(output))",
                                "type": "added"
                            },
                            {
                                "content": "        else:",
                                "type": "added"
                            },
                            {
                                "content": "            self.info.set_output_summary(self.info.NoOutput)",
                                "type": "added"
                            },
                            {
                                "content": "        self.Outputs.data.send(output)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def storeSpecificSettings(self):",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owdiscretize.py",
                            "type": "method",
                            "name": "OWDiscretize.commit",
                            "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 481,
                            "end_lineno": 489,
                            "parent": {
                                "file_name": "Orange/widgets/data/owdiscretize.py",
                                "type": "class",
                                "name": "OWDiscretize",
                                "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 128,
                                "end_lineno": 506,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/data/owdiscretize.py",
                            "type": "class",
                            "name": "OWDiscretize",
                            "content": "class OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n            self.info.set_input_summary(len(data))\n        else:\n            self.info.set_input_summary(self.info.NoInput)\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n            self.info.set_output_summary(len(output))\n        else:\n            self.info.set_output_summary(self.info.NoOutput)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 128,
                            "end_lineno": 506,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nfrom Orange.data import Table\nfrom Orange.widgets.data.owdiscretize import OWDiscretize\nfrom Orange.widgets.tests.base import WidgetTest\n\n\nclass TestOWDiscretize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDiscretize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n        widget.default_method = 3\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.unconditional_commit()\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,unsubscriptable-object\nfrom unittest.mock import Mock\n\nfrom Orange.data import Table\nfrom Orange.widgets.data.owdiscretize import OWDiscretize\nfrom Orange.widgets.tests.base import WidgetTest\nfrom orangewidget.widget import StateInfo\n\n\nclass TestOWDiscretize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDiscretize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n        widget.default_method = 3\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.unconditional_commit()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        input_sum = self.widget.info.set_input_summary = Mock()\n        output_sum = self.widget.info.set_output_summary = Mock()\n\n        data = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, data)\n        input_sum.assert_called_with(int(StateInfo.format_number(len(data))))\n        output = self.get_output(self.widget.Outputs.data)\n        output_sum.assert_called_with(int(StateInfo.format_number(len(output))))\n\n        input_sum.reset_mock()\n        output_sum.reset_mock()\n        self.send_signal(self.widget.Inputs.data, None)\n        input_sum.assert_called_once()\n        self.assertEqual(input_sum.call_args[0][0].brief, \"\")\n        output_sum.assert_called_once()\n        self.assertEqual(output_sum.call_args[0][0].brief, \"\")\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/tests/test_owdiscretize.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "6c5d70ee3",
                "new_commit_hash": "2a148c394",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/tests/test_owdiscretize.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/tests/test_owdiscretize.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 1,
                            "length": 8
                        },
                        "new_range": {
                            "start": 1,
                            "length": 11
                        },
                        "section": ""
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "# Test methods with long descriptive names can omit docstrings",
                                "type": "context"
                            },
                            {
                                "content": "# pylint: disable=missing-docstring",
                                "type": "deleted"
                            },
                            {
                                "content": "# pylint: disable=missing-docstring,unsubscriptable-object",
                                "type": "added"
                            },
                            {
                                "content": "from unittest.mock import Mock",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.data import Table",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.data.owdiscretize import OWDiscretize",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.tests.base import WidgetTest",
                                "type": "context"
                            },
                            {
                                "content": "from orangewidget.widget import StateInfo",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class TestOWDiscretize(WidgetTest):",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdiscretize.py",
                            "type": "statement",
                            "name": "",
                            "content": "from orangewidget.widget import StateInfo",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 8,
                            "end_lineno": 8,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdiscretize.py",
                            "type": "statement",
                            "name": "",
                            "content": "from unittest.mock import Mock",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 3,
                            "end_lineno": 3,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 17,
                            "length": 3
                        },
                        "new_range": {
                            "start": 20,
                            "length": 22
                        },
                        "section": "class TestOWDiscretize(WidgetTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data,",
                                "type": "context"
                            },
                            {
                                "content": "                         Table.from_domain(data.domain))",
                                "type": "context"
                            },
                            {
                                "content": "        widget.unconditional_commit()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_summary(self):",
                                "type": "added"
                            },
                            {
                                "content": "        \"\"\"Check if status bar is updated when data is received\"\"\"",
                                "type": "added"
                            },
                            {
                                "content": "        input_sum = self.widget.info.set_input_summary = Mock()",
                                "type": "added"
                            },
                            {
                                "content": "        output_sum = self.widget.info.set_output_summary = Mock()",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        data = Table(\"iris\")",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, data)",
                                "type": "added"
                            },
                            {
                                "content": "        input_sum.assert_called_with(int(StateInfo.format_number(len(data))))",
                                "type": "added"
                            },
                            {
                                "content": "        output = self.get_output(self.widget.Outputs.data)",
                                "type": "added"
                            },
                            {
                                "content": "        output_sum.assert_called_with(int(StateInfo.format_number(len(output))))",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        input_sum.reset_mock()",
                                "type": "added"
                            },
                            {
                                "content": "        output_sum.reset_mock()",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, None)",
                                "type": "added"
                            },
                            {
                                "content": "        input_sum.assert_called_once()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(input_sum.call_args[0][0].brief, \"\")",
                                "type": "added"
                            },
                            {
                                "content": "        output_sum.assert_called_once()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(output_sum.call_args[0][0].brief, \"\")",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdiscretize.py",
                            "type": "class",
                            "name": "TestOWDiscretize",
                            "content": "class TestOWDiscretize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDiscretize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n        widget.default_method = 3\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.unconditional_commit()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        input_sum = self.widget.info.set_input_summary = Mock()\n        output_sum = self.widget.info.set_output_summary = Mock()\n\n        data = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, data)\n        input_sum.assert_called_with(int(StateInfo.format_number(len(data))))\n        output = self.get_output(self.widget.Outputs.data)\n        output_sum.assert_called_with(int(StateInfo.format_number(len(output))))\n\n        input_sum.reset_mock()\n        output_sum.reset_mock()\n        self.send_signal(self.widget.Inputs.data, None)\n        input_sum.assert_called_once()\n        self.assertEqual(input_sum.call_args[0][0].brief, \"\")\n        output_sum.assert_called_once()\n        self.assertEqual(output_sum.call_args[0][0].brief, \"\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 11,
                            "end_lineno": 41,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owdiscretize.py",
                            "type": "method",
                            "name": "TestOWDiscretize.test_summary",
                            "content": "class TestOWDiscretize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDiscretize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n        widget.default_method = 3\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.unconditional_commit()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        input_sum = self.widget.info.set_input_summary = Mock()\n        output_sum = self.widget.info.set_output_summary = Mock()\n\n        data = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, data)\n        input_sum.assert_called_with(int(StateInfo.format_number(len(data))))\n        output = self.get_output(self.widget.Outputs.data)\n        output_sum.assert_called_with(int(StateInfo.format_number(len(output))))\n\n        input_sum.reset_mock()\n        output_sum.reset_mock()\n        self.send_signal(self.widget.Inputs.data, None)\n        input_sum.assert_called_once()\n        self.assertEqual(input_sum.call_args[0][0].brief, \"\")\n        output_sum.assert_called_once()\n        self.assertEqual(output_sum.call_args[0][0].brief, \"\")",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 24,
                            "end_lineno": 41,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owdiscretize.py",
                                "type": "class",
                                "name": "TestOWDiscretize",
                                "content": "class TestOWDiscretize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDiscretize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n        widget.default_method = 3\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.unconditional_commit()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        input_sum = self.widget.info.set_input_summary = Mock()\n        output_sum = self.widget.info.set_output_summary = Mock()\n\n        data = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, data)\n        input_sum.assert_called_with(int(StateInfo.format_number(len(data))))\n        output = self.get_output(self.widget.Outputs.data)\n        output_sum.assert_called_with(int(StateInfo.format_number(len(output))))\n\n        input_sum.reset_mock()\n        output_sum.reset_mock()\n        self.send_signal(self.widget.Inputs.data, None)\n        input_sum.assert_called_once()\n        self.assertEqual(input_sum.call_args[0][0].brief, \"\")\n        output_sum.assert_called_once()\n        self.assertEqual(output_sum.call_args[0][0].brief, \"\")",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 11,
                                "end_lineno": 41,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "2bcef21f05c5b9e913ddeca0d0f076d1ab53f754^",
    "new_commit_hash": "2bcef21f05c5b9e913ddeca0d0f076d1ab53f754",
    "commit_message": "Merge pull request #4331 from aturanjanin/owdiscretize\n\n[ENH] OWDiscretize: data info displayed in status bar",
    "commit_date": "2020-01-17T07:59:05+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "2bcef21f05c5b9e913ddeca0d0f076d1ab53f754",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring,unsubscriptable-object\nfrom unittest.mock import Mock\n\nfrom Orange.data import Table\nfrom Orange.widgets.data.owdiscretize import OWDiscretize\nfrom Orange.widgets.tests.base import WidgetTest\nfrom orangewidget.widget import StateInfo\n\n\nclass TestOWDiscretize(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWDiscretize)\n\n    def test_empty_data(self):\n        \"\"\"No crash on empty data\"\"\"\n        data = Table(\"iris\")\n        widget = self.widget\n        widget.default_method = 3\n        self.send_signal(self.widget.Inputs.data,\n                         Table.from_domain(data.domain))\n        widget.unconditional_commit()\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        input_sum = self.widget.info.set_input_summary = Mock()\n        output_sum = self.widget.info.set_output_summary = Mock()\n\n        data = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, data)\n        input_sum.assert_called_with(int(StateInfo.format_number(len(data))))\n        output = self.get_output(self.widget.Outputs.data)\n        output_sum.assert_called_with(int(StateInfo.format_number(len(output))))\n\n        input_sum.reset_mock()\n        output_sum.reset_mock()\n        self.send_signal(self.widget.Inputs.data, None)\n        input_sum.assert_called_once()\n        self.assertEqual(input_sum.call_args[0][0].brief, \"\")\n        output_sum.assert_called_once()\n        self.assertEqual(output_sum.call_args[0][0].brief, \"\")\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmprpxuvnp5/tmp\ncreating /tmp/tmprpxuvnp5/tmp/tmprpxuvnp5\ncompile options: '-MMD -MF /tmp/tmprpxuvnp5/file.c.d -c'\ncc: /tmp/tmprpxuvnp5/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmp7hivxacd/tmp\ncreating /tmp/tmp7hivxacd/tmp/tmp7hivxacd\ncompile options: '-MMD -MF /tmp/tmp7hivxacd/file.c.d -c'\ncc: /tmp/tmp7hivxacd/file.c\ncustomize UnixCCompiler using build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_simple_tree.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_tree_scorers.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_valuecount.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_contingency.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_io.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_variable.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/distance/_distance.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/preprocess/_discretize.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/preprocess/_relieff.cpp\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/projection/_som.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/widgets/utils/_grid_density.cpp\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nrunning develop\nrunning build_scripts\nrunning egg_info\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching 'COPYING'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpz94b1lj_/tmp\ncreating /tmp/tmpz94b1lj_/tmp/tmpz94b1lj_\ncompile options: '-MMD -MF /tmp/tmpz94b1lj_/file.c.d -c'\ncc: /tmp/tmpz94b1lj_/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpfbncd8ua/tmp\ncreating /tmp/tmpfbncd8ua/tmp/tmpfbncd8ua\ncompile options: '-MMD -MF /tmp/tmpfbncd8ua/file.c.d -c'\ncc: /tmp/tmpfbncd8ua/file.c\ncustomize UnixCCompiler using build_ext\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.25.0.dev0+2bcef21 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754\nProcessing dependencies for Orange3==3.25.0.dev0+2bcef21\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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for setuptools==59.8.0\nBest match: setuptools 59.8.0\nAdding setuptools 59.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for scipy==1.7.3\nBest match: scipy 1.7.3\nAdding scipy 1.7.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==1.0.2\nBest match: scikit-learn 1.0.2\nAdding scikit-learn 1.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for requests==2.31.0\nBest match: requests 2.31.0\nAdding requests 2.31.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for PyYAML==6.0.1\nBest match: PyYAML 6.0.1\nAdding PyYAML 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.4\nBest match: pyqtgraph 0.12.4\nAdding pyqtgraph 0.12.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for pip==24.0\nBest match: pip 24.0\nAdding pip 24.0 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for pandas==1.3.5\nBest match: pandas 1.3.5\nAdding pandas 1.3.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for openpyxl==3.1.3\nBest match: openpyxl 3.1.3\nAdding openpyxl 3.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for numpy==1.17.5\nBest match: numpy 1.17.5\nAdding numpy 1.17.5 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for networkx==2.6.3\nBest match: networkx 2.6.3\nAdding networkx 2.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for matplotlib==3.5.3\nBest match: matplotlib 3.5.3\nAdding matplotlib 3.5.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for keyrings.alt==4.2.0\nBest match: keyrings.alt 4.2.0\nAdding keyrings.alt 4.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for keyring==24.1.1\nBest match: keyring 24.1.1\nAdding keyring 24.1.1 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for joblib==1.3.2\nBest match: joblib 1.3.2\nAdding joblib 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for threadpoolctl==3.1.0\nBest match: threadpoolctl 3.1.0\nAdding threadpoolctl 3.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for urllib3==2.0.7\nBest match: urllib3 2.0.7\nAdding urllib3 2.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for typing-extensions==4.7.1\nBest match: typing-extensions 4.7.1\nAdding typing-extensions 4.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for importlib-metadata==6.7.0\nBest match: importlib-metadata 6.7.0\nAdding importlib-metadata 6.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for requests-cache==1.1.1\nBest match: requests-cache 1.1.1\nAdding requests-cache 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for qasync==0.25.0\nBest match: qasync 0.25.0\nAdding qasync 0.25.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for packaging==24.0\nBest match: packaging 24.0\nAdding packaging 24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for et-xmlfile==1.1.0\nBest match: et-xmlfile 1.1.0\nAdding et-xmlfile 1.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for cycler==0.11.0\nBest match: cycler 0.11.0\nAdding cycler 0.11.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for Pillow==9.5.0\nBest match: Pillow 9.5.0\nAdding Pillow 9.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for kiwisolver==1.4.5\nBest match: kiwisolver 1.4.5\nAdding kiwisolver 1.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for fonttools==4.38.0\nBest match: fonttools 4.38.0\nAdding fonttools 4.38.0 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for jaraco.classes==3.2.3\nBest match: jaraco.classes 3.2.3\nAdding jaraco.classes 3.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for importlib-resources==5.12.0\nBest match: importlib-resources 5.12.0\nAdding importlib-resources 5.12.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for zipp==3.15.0\nBest match: zipp 3.15.0\nAdding zipp 3.15.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for platformdirs==4.0.0\nBest match: platformdirs 4.0.0\nAdding platformdirs 4.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for cattrs==23.1.2\nBest match: cattrs 23.1.2\nAdding cattrs 23.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for attrs==24.2.0\nBest match: attrs 24.2.0\nAdding attrs 24.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for more-itertools==9.1.0\nBest match: more-itertools 9.1.0\nAdding more-itertools 9.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for cffi==1.15.1\nBest match: cffi 1.15.1\nAdding cffi 1.15.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nSearching for pycparser==2.21\nBest match: pycparser 2.21\nAdding pycparser 2.21 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.25.0.dev0+2bcef21\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.7\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 158ms\nPrepared 18 packages in 2ms\nInstalled 18 packages in 304ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 40 packages in 206ms\nInstalled 35 packages in 833ms\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + et-xmlfile==1.1.0\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pip==24.0\n + pycparser==2.21\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 34 packages in 179ms\nInstalled 19 packages in 141ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + cycler==0.11.0\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + fonttools==4.38.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + pillow==9.5.0\n + platformdirs==4.0.0\n + pyparsing==3.1.4\n + pyqtgraph==0.12.4\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 3ms\nInstalled 2 packages in 26ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nAudited 1 package in 67ms\nAudited 2 packages in 1ms\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3115:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3115 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4619:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4619 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5396:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5396 |           for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5517:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5517 |           __pyx_t_27 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5523:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5523 |           __pyx_t_27 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7051:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7051 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7741:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7741 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7801:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7801 |               __pyx_t_17 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_18 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:3881:24: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3881 |           __pyx_v_decs = (__pyx_v_decs / 10.0);\n      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:4070:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4070 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:480:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  480 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1301:7: note: ‘__pyx_v_attr_index’ was declared here\n 1301 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:2935:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2935 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:581:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3655:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3655 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3654:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3654 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4547:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4547 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4114:7: note: ‘__pyx_v_win_y’ was declared here\n 4114 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4536:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4536 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4113:7: note: ‘__pyx_v_win_x’ was declared here\n 4113 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4746:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4746 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4745:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4745 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3141:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3141 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:2964:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2964 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2665:7: note: ‘__pyx_v_win_y’ was declared here\n 2665 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:2953:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2953 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2664:7: note: ‘__pyx_v_win_x’ was declared here\n 2664 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5515:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5515 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5514:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5514 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.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_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754/.venv/lib/python3.7/site-packages/setuptools/command/egg_info.py:628: SetuptoolsDeprecationWarning: Custom 'build_py' does not implement 'get_data_files_without_manifest'.\nPlease extend command classes from setuptools instead of distutils.\n  SetuptoolsDeprecationWarning\n",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754\ncollected 8 items\n\nr2e_tests/test_1.py sss..F..                                             [100%]\n\n=================================== FAILURES ===================================\n______________________ TestOWDiscretize.test_minimum_size ______________________\n\nself = <r2e_tests.test_1.TestOWDiscretize testMethod=test_minimum_size>\n\n    def test_minimum_size(self):\n        widget = getattr(self, \"widget\", None)\n        if widget is None:\n            self.skipTest(\"minimum size not tested as .widget was not set\")\n>       self.check_minimum_size(widget)\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:242: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:615: in check_minimum_size\n    self.assertLess(min_size.width(), 800)\nE   AssertionError: 1028 not less than 800\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWDiscretize::test_empty_data\nPASSED r2e_tests/test_1.py::TestOWDiscretize::test_image_export\nPASSED r2e_tests/test_1.py::TestOWDiscretize::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWDiscretize::test_summary\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWDiscretize::test_minimum_size - AssertionEr...\n==================== 1 failed, 4 passed, 3 skipped in 3.66s ====================\nWidgets left: 0    Max widgets: 395 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_2bcef21f05c5b9e913ddeca0d0f076d1ab53f754\ncollected 8 items\n\nr2e_tests/test_1.py sss..F.F                                             [100%]\n\n=================================== FAILURES ===================================\n______________________ TestOWDiscretize.test_minimum_size ______________________\n\nself = <r2e_tests.test_1.TestOWDiscretize testMethod=test_minimum_size>\n\n    def test_minimum_size(self):\n        widget = getattr(self, \"widget\", None)\n        if widget is None:\n            self.skipTest(\"minimum size not tested as .widget was not set\")\n>       self.check_minimum_size(widget)\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:242: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:615: in check_minimum_size\n    self.assertLess(min_size.width(), 800)\nE   AssertionError: 1028 not less than 800\n________________________ TestOWDiscretize.test_summary _________________________\n\nself = <r2e_tests.test_1.TestOWDiscretize testMethod=test_summary>\n\n    def test_summary(self):\n        \"\"\"Check if status bar is updated when data is received\"\"\"\n        input_sum = self.widget.info.set_input_summary = Mock()\n        output_sum = self.widget.info.set_output_summary = Mock()\n    \n        data = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, data)\n>       input_sum.assert_called_with(int(StateInfo.format_number(len(data))))\n\nr2e_tests/test_1.py:31: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\n_mock_self = <Mock id='131290900679056'>, args = (150,), kwargs = {}\nexpected = 'mock(150)'\n\n    def assert_called_with(_mock_self, *args, **kwargs):\n        \"\"\"assert that the mock was called with the specified arguments.\n    \n        Raises an AssertionError if the args and keyword args passed in are\n        different to the last call to the mock.\"\"\"\n        self = _mock_self\n        if self.call_args is None:\n            expected = self._format_mock_call_signature(args, kwargs)\n>           raise AssertionError('Expected call: %s\\nNot called' % (expected,))\nE           AssertionError: Expected call: mock(150)\nE           Not called\n\n../../../../.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py:869: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWDiscretize::test_empty_data\nPASSED r2e_tests/test_1.py::TestOWDiscretize::test_image_export\nPASSED r2e_tests/test_1.py::TestOWDiscretize::test_msg_base_class\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWDiscretize::test_minimum_size - AssertionEr...\nFAILED r2e_tests/test_1.py::TestOWDiscretize::test_summary - AssertionError: ...\n==================== 2 failed, 3 passed, 3 skipped in 2.18s ====================\nWidgets left: 0    Max widgets: 395 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/data/owdiscretize.py Orange/widgets/data/tests/test_owdiscretize.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** OWDiscretize Widget Fails to Update Status Bar with Data Summaries

**Description:**
When loading data into the OWDiscretize widget, the status bar does not display the number of input and output instances. This omission makes it difficult for users to verify that data is correctly loaded and processed.

**Example Code:**
```python
from Orange.data import Table
from Orange.widgets.data.owdiscretize import OWDiscretize

def load_and_discretize_data():
    data = Table("iris")
    widget = OWDiscretize()
    widget.set_data(data)
    # Expect the status bar to show input summary as 150
    # Currently, it shows 'No Input' instead
```

**Expected Behavior:**
After setting the data, the status bar should display a summary indicating the number of input instances (e.g., "150") and the number of output instances after discretization.

**Actual Behavior:**
The status bar displays "No Input" and "No Output" even after data is loaded and processed, preventing users from seeing relevant data summaries.
[/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/owdiscretize.py
from collections import namedtuple
from typing import Optional

from AnyQt.QtWidgets import QListView, QHBoxLayout, QStyledItemDelegate
from AnyQt.QtCore import Qt

import Orange.data
import Orange.preprocess.discretize as disc

from Orange.widgets import widget, gui, settings
from Orange.widgets.utils import itemmodels, vartype
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output

__all__ = ["OWDiscretize"]

# 'Default' method delegates to 'method'
Default = namedtuple("Default", ["method"])
Leave = namedtuple("Leave", [])
MDL = namedtuple("MDL", [])
EqualFreq = namedtuple("EqualFreq", ["k"])
EqualWidth = namedtuple("EqualWidth", ["k"])
Remove = namedtuple("Remove", [])
Custom = namedtuple("Custom", ["points"])

METHODS = [
    (Default, ),
    (Leave, ),
    (MDL, ),
    (EqualFreq, ),
    (EqualWidth, ),
    (Remove, ),
    (Custom, )
]

_dispatch = {
    Default:
        lambda m, data, var: _dispatch[type(m.method)](m.method, data, var),
    Leave: lambda m, data, var: var,
    MDL: lambda m, data, var: disc.EntropyMDL()(data, var),
    EqualFreq: lambda m, data, var: disc.EqualFreq(m.k)(data, var),
    EqualWidth: lambda m, data, var: disc.EqualWidth(m.k)(data, var),
    Remove: lambda m, data, var: None,
    Custom:
        lambda m, data, var:
        disc.Discretizer.create_discretized_var(var, m.points)
}


# Variable discretization state
DState = namedtuple(
    "DState",
    ["method",    # discretization method
     "points",    # induced cut points
     "disc_var"]  # induced discretized variable
)


def is_derived(var):
    return var.compute_value is not None


def is_discretized(var):
    return isinstance(var.compute_value, disc.Discretizer)


def variable_key(var):
    return vartype(var), var.name


def button_group_reset(group):
    button = group.checkedButton()
    if button is not None:
        group.setExclusive(False)
        button.setChecked(False)
        group.setExclusive(True)


class DiscDelegate(QStyledItemDelegate):
    def initStyleOption(self, option, index):
        super().initStyleOption(option, index)
        state = index.data(Qt.UserRole)

        if state is not None:
            extra = self.cutsText(state)
            option.text = option.text + ": " + extra

    @staticmethod
    def cutsText(state):
        # This function has many branches, but they don't hurt readabability
        # pylint: disable=too-many-branches
        method = state.method
        name = None
        # Need a better way to distinguish discretization states
        # i.e. between 'induced no points v.s. 'removed by choice'
        if state.points is None and state.disc_var is not None:
            points = ""
        elif state.points is None:
            points = "..."
        elif state.points == []:
            points = "<removed>"
        else:
            points = ", ".join(map("{:.2f}".format, state.points))

        if isinstance(method, Default):
            name = None
        elif isinstance(method, Leave):
            name = "(leave)"
        elif isinstance(method, MDL):
            name = "(entropy)"
        elif isinstance(method, EqualFreq):
            name = "(equal frequency k={})".format(method.k)
        elif isinstance(method, EqualWidth):
            name = "(equal width k={})".format(method.k)
        elif isinstance(method, Remove):
            name = "(removed)"
        elif isinstance(method, Custom):
            name = "(custom)"
        else:
            assert False

        if name is not None:
            return points + " " + name
        else:
            return points


class OWDiscretize(widget.OWWidget):
    name = "Discretize"
    description = "Discretize the numeric data features."
    icon = "icons/Discretize.svg"
    keywords = []

    class Inputs:
        data = Input("Data", Orange.data.Table, doc="Input data table")

    class Outputs:
        data = Output("Data", Orange.data.Table, doc="Table with discretized features")

    settingsHandler = settings.DomainContextHandler()
    saved_var_states = settings.ContextSetting({})

    default_method = settings.Setting(2)
    default_k = settings.Setting(3)
    autosend = settings.Setting(True)

    #: Discretization methods
    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)

    want_main_area = False
    resizing_enabled = False

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

        #: input data
        self.data = None
        self.class_var = None
        #: Current variable discretization state
        self.var_state = {}
        #: Saved variable discretization settings (context setting)
        self.saved_var_states = {}

        self.method = 0
        self.k = 5
        self.cutpoints = []

        box = gui.vBox(self.controlArea, self.tr("Default Discretization"))
        self.default_bbox = rbox = gui.radioButtons(
            box, self, "default_method", callback=self._default_disc_changed)
        rb = gui.hBox(rbox)
        self.left = gui.vBox(rb)
        right = gui.vBox(rb)
        rb.layout().setStretch(0, 1)
        rb.layout().setStretch(1, 1)
        options = self.options = [
            self.tr("Default"),
            self.tr("Leave numeric"),
            self.tr("Entropy-MDL discretization"),
            self.tr("Equal-frequency discretization"),
            self.tr("Equal-width discretization"),
            self.tr("Remove numeric variables")
        ]

        for opt in options[1:]:
            t = gui.appendRadioButton(rbox, opt)
            # This condition is ugly, but it keeps the same order of
            # options for backward compatibility of saved schemata
            [right, self.left][opt.startswith("Equal")].layout().addWidget(t)
        gui.separator(right, 18, 18)

        def _intbox(parent, attr, callback):
            box = gui.indentedBox(parent)
            s = gui.spin(
                box, self, attr, minv=2, maxv=10, label="Num. of intervals:",
                callback=callback)
            s.setMaximumWidth(60)
            s.setAlignment(Qt.AlignRight)
            gui.rubber(s.box)
            return box.box

        self.k_general = _intbox(self.left, "default_k",
                                 self._default_disc_changed)
        self.k_general.layout().setContentsMargins(0, 0, 0, 0)
        vlayout = QHBoxLayout()
        box = gui.widgetBox(
            self.controlArea, "Individual Attribute Settings",
            orientation=vlayout, spacing=8
        )

        # List view with all attributes
        self.varview = QListView(
            selectionMode=QListView.ExtendedSelection,
            uniformItemSizes=True,
        )
        self.varview.setItemDelegate(DiscDelegate())
        self.varmodel = itemmodels.VariableListModel()
        self.varview.setModel(self.varmodel)
        self.varview.selectionModel().selectionChanged.connect(
            self._var_selection_changed
        )

        vlayout.addWidget(self.varview)
        # Controls for individual attr settings
        self.bbox = controlbox = gui.radioButtons(
            box, self, "method", callback=self._disc_method_changed
        )
        vlayout.addWidget(controlbox)

        for opt in options[:5]:
            gui.appendRadioButton(controlbox, opt)

        self.k_specific = _intbox(controlbox, "k", self._disc_method_changed)

        gui.appendRadioButton(controlbox, "Remove attribute")

        gui.rubber(controlbox)
        controlbox.setEnabled(False)

        self.controlbox = controlbox

        box = gui.auto_apply(self.controlArea, self, "autosend")
        box.button.setFixedWidth(180)
        box.layout().insertStretch(0)

        self._update_spin_positions()


    @Inputs.data
    def set_data(self, data):
        self.closeContext()
        self.data = data
        if self.data is not None:
            self._initialize(data)
            self.openContext(data)
            # Restore the per variable discretization settings
            self._restore(self.saved_var_states)
            # Complete the induction of cut points
            self._update_points()
        else:
            self._clear()
        self.unconditional_commit()

    def _initialize(self, data):
        # Initialize the default variable states for new data.
        self.class_var = data.domain.class_var
        cvars = [var for var in data.domain.variables
                 if var.is_continuous]
        self.varmodel[:] = cvars

        has_disc_class = data.domain.has_discrete_class

        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)
        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)

        # If the newly disabled MDL button is checked then change it
        if not has_disc_class and self.default_method == self.MDL - 1:
            self.default_method = 0
        if not has_disc_class and self.method == self.MDL:
            self.method = 0

        # Reset (initialize) the variable discretization states.
        self._reset()

    def _restore(self, saved_state):
        # Restore variable states from a saved_state dictionary.
        def_method = self._current_default_method()
        for i, var in enumerate(self.varmodel):
            key = variable_key(var)
            if key in saved_state:
                state = saved_state[key]
                if isinstance(state.method, Default):
                    state = DState(Default(def_method), None, None)
                self._set_var_state(i, state)

    def _reset(self):
        # restore the individual variable settings back to defaults.
        def_method = self._current_default_method()
        self.var_state = {}
        for i in range(len(self.varmodel)):
            state = DState(Default(def_method), None, None)
            self._set_var_state(i, state)

    def _set_var_state(self, index, state):
        # set the state of variable at `index` to `state`.
        self.var_state[index] = state
        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)

    def _clear(self):
        self.data = None
        self.varmodel[:] = []
        self.var_state = {}
        self.saved_var_states = {}
        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)
        self.bbox.buttons[self.MDL].setEnabled(True)

    def _update_points(self):
        """
        Update the induced cut points.
        """
        if self.data is None or not len(self.data):
            return

        def induce_cuts(method, data, var):
            dvar = _dispatch[type(method)](method, data, var)
            if dvar is None:
                # removed
                return [], None
            elif dvar is var:
                # no transformation took place
                return None, var
            elif is_discretized(dvar):
                return dvar.compute_value.points, dvar
            assert False
            return None

        for i, var in enumerate(self.varmodel):
            state = self.var_state[i]
            if state.points is None and state.disc_var is None:
                points, dvar = induce_cuts(state.method, self.data, var)
                new_state = state._replace(points=points, disc_var=dvar)
                self._set_var_state(i, new_state)

    @staticmethod
    def _method_index(method):
        return METHODS.index((type(method), ))

    def _current_default_method(self):
        method = self.default_method + 1
        k = self.default_k
        if method == OWDiscretize.Leave:
            def_method = Leave()
        elif method == OWDiscretize.MDL:
            def_method = MDL()
        elif method == OWDiscretize.EqualFreq:
            def_method = EqualFreq(k)
        elif method == OWDiscretize.EqualWidth:
            def_method = EqualWidth(k)
        elif method == OWDiscretize.Remove:
            def_method = Remove()
        else:
            assert False
        return def_method

    def _current_method(self):
        if self.method == OWDiscretize.Default:
            method = Default(self._current_default_method())
        elif self.method == OWDiscretize.Leave:
            method = Leave()
        elif self.method == OWDiscretize.MDL:
            method = MDL()
        elif self.method == OWDiscretize.EqualFreq:
            method = EqualFreq(self.k)
        elif self.method == OWDiscretize.EqualWidth:
            method = EqualWidth(self.k)
        elif self.method == OWDiscretize.Remove:
            method = Remove()
        elif self.method == OWDiscretize.Custom:
            method = Custom(self.cutpoints)
        else:
            assert False
        return method

    def _update_spin_positions(self):
        self.k_general.setDisabled(self.default_method not in [2, 3])
        if self.default_method == 2:
            self.left.layout().insertWidget(1, self.k_general)
        elif self.default_method == 3:
            self.left.layout().insertWidget(2, self.k_general)

        self.k_specific.setDisabled(self.method not in [3, 4])
        if self.method == 3:
            self.bbox.layout().insertWidget(4, self.k_specific)
        elif self.method == 4:
            self.bbox.layout().insertWidget(5, self.k_specific)

    def _default_disc_changed(self):
        self._update_spin_positions()
        method = self._current_default_method()
        state = DState(Default(method), None, None)
        for i, _ in enumerate(self.varmodel):
            if isinstance(self.var_state[i].method, Default):
                self._set_var_state(i, state)
        self._update_points()
        self.commit()

    def _disc_method_changed(self):
        self._update_spin_positions()
        indices = self.selected_indices()
        method = self._current_method()
        state = DState(method, None, None)
        for idx in indices:
            self._set_var_state(idx, state)
        self._update_points()
        self.commit()

    def _var_selection_changed(self, *_):
        indices = self.selected_indices()
        # set of all methods for the current selection
        methods = [self.var_state[i].method for i in indices]
        mset = set(methods)
        self.controlbox.setEnabled(len(mset) > 0)
        if len(mset) == 1:
            method = mset.pop()
            self.method = self._method_index(method)
            if isinstance(method, (EqualFreq, EqualWidth)):
                self.k = method.k
            elif isinstance(method, Custom):
                self.cutpoints = method.points
        else:
            # deselect the current button
            self.method = -1
            bg = self.controlbox.group
            button_group_reset(bg)
        self._update_spin_positions()

    def selected_indices(self):
        rows = self.varview.selectionModel().selectedRows()
        return [index.row() for index in rows]

    def discretized_var(self, index):
        # type: (int) -> Optional[Orange.data.DiscreteVariable]
        state = self.var_state[index]
        if state.disc_var is not None and state.points == []:
            # Removed by MDL Entropy
            return None
        else:
            return state.disc_var

    def discretized_domain(self):
        """
        Return the current effective discretized domain.
        """
        if self.data is None:
            return None

        # a mapping of all applied changes for variables in `varmodel`
        mapping = {var: self.discretized_var(i)
                   for i, var in enumerate(self.varmodel)}

        def disc_var(source):
            return mapping.get(source, source)

        # map the full input domain to the new variables (where applicable)
        attributes = [disc_var(v) for v in self.data.domain.attributes]
        attributes = [v for v in attributes if v is not None]

        class_vars = [disc_var(v) for v in self.data.domain.class_vars]
        class_vars = [v for v in class_vars if v is not None]

        domain = Orange.data.Domain(
            attributes, class_vars, metas=self.data.domain.metas
        )
        return domain

    def commit(self):
        output = None
        if self.data is not None and len(self.data):
            domain = self.discretized_domain()
            output = self.data.transform(domain)
        self.Outputs.data.send(output)

    def storeSpecificSettings(self):
        super().storeSpecificSettings()
        self.saved_var_states = {
            variable_key(var):
                self.var_state[i]._replace(points=None, disc_var=None)
            for i, var in enumerate(self.varmodel)
        }

    def send_report(self):
        self.report_items((
            ("Default method", self.options[self.default_method + 1]),))
        if self.varmodel:
            self.report_items("Thresholds", [
                (var.name,
                 DiscDelegate.cutsText(self.var_state[i]) or "leave numeric")
                for i, var in enumerate(self.varmodel)])


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWDiscretize).run(Orange.data.Table("brown-selected"))

```
--- 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:** OWDiscretize Widget Fails to Update Status Bar with Data Summaries

**Description:**
When loading data into the OWDiscretize widget, the status bar does not display the number of input and output instances. This omission makes it difficult for users to verify that data is correctly loaded and processed.

**Example Code:**
```python
from Orange.data import Table
from Orange.widgets.data.owdiscretize import OWDiscretize

def load_and_discretize_data():
    data = Table("iris")
    widget = OWDiscretize()
    widget.set_data(data)
    # Expect the status bar to show input summary as 150
    # Currently, it shows 'No Input' instead
```

**Expected Behavior:**
After setting the data, the status bar should display a summary indicating the number of input instances (e.g., "150") and the number of output instances after discretization.

**Actual Behavior:**
The status bar displays "No Input" and "No Output" even after data is loaded and processed, preventing users from seeing relevant data summaries.
[/ISSUE]
{
    "TestOWDiscretize.test_empty_data": "PASSED",
    "TestOWDiscretize.test_image_export": "PASSED",
    "TestOWDiscretize.test_msg_base_class": "PASSED",
    "TestOWDiscretize.test_summary": "PASSED",
    "TestOWDiscretize.test_minimum_size": "FAILED"
}
diff --git a/Orange/widgets/data/owdiscretize.py b/Orange/widgets/data/owdiscretize.py
index c4b880e35..edfe15ecb 100644
--- a/Orange/widgets/data/owdiscretize.py
+++ b/Orange/widgets/data/owdiscretize.py
@@ -245,6 +245,9 @@ class OWDiscretize(widget.OWWidget):
 
         self._update_spin_positions()
 
+        self.info.set_input_summary(self.info.NoInput)
+        self.info.set_output_summary(self.info.NoOutput)
+
 
     @Inputs.data
     def set_data(self, data):
@@ -257,7 +260,9 @@ class OWDiscretize(widget.OWWidget):
             self._restore(self.saved_var_states)
             # Complete the induction of cut points
             self._update_points()
+            self.info.set_input_summary(len(data))
         else:
+            self.info.set_input_summary(self.info.NoInput)
             self._clear()
         self.unconditional_commit()
 
@@ -478,6 +483,9 @@ class OWDiscretize(widget.OWWidget):
         if self.data is not None and len(self.data):
             domain = self.discretized_domain()
             output = self.data.transform(domain)
+            self.info.set_output_summary(len(output))
+        else:
+            self.info.set_output_summary(self.info.NoOutput)
         self.Outputs.data.send(output)
 
     def storeSpecificSettings(self):

{"Orange/widgets/data/owdiscretize.py": "from collections import namedtuple\nfrom typing import Optional\n\nfrom AnyQt.QtWidgets import QListView, QHBoxLayout, QStyledItemDelegate\nfrom AnyQt.QtCore import Qt\n\nimport Orange.data\nimport Orange.preprocess.discretize as disc\n\nfrom Orange.widgets import widget, gui, settings\nfrom Orange.widgets.utils import itemmodels, vartype\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.widget import Input, Output\n\n__all__ = [\"OWDiscretize\"]\n\n# 'Default' method delegates to 'method'\nDefault = namedtuple(\"Default\", [\"method\"])\nLeave = namedtuple(\"Leave\", [])\nMDL = namedtuple(\"MDL\", [])\nEqualFreq = namedtuple(\"EqualFreq\", [\"k\"])\nEqualWidth = namedtuple(\"EqualWidth\", [\"k\"])\nRemove = namedtuple(\"Remove\", [])\nCustom = namedtuple(\"Custom\", [\"points\"])\n\nMETHODS = [\n    (Default, ),\n    (Leave, ),\n    (MDL, ),\n    (EqualFreq, ),\n    (EqualWidth, ),\n    (Remove, ),\n    (Custom, )\n]\n\n_dispatch = {\n    Default:\n        lambda m, data, var: _dispatch[type(m.method)](m.method, data, var),\n    Leave: lambda m, data, var: var,\n    MDL: lambda m, data, var: disc.EntropyMDL()(data, var),\n    EqualFreq: lambda m, data, var: disc.EqualFreq(m.k)(data, var),\n    EqualWidth: lambda m, data, var: disc.EqualWidth(m.k)(data, var),\n    Remove: lambda m, data, var: None,\n    Custom:\n        lambda m, data, var:\n        disc.Discretizer.create_discretized_var(var, m.points)\n}\n\n\n# Variable discretization state\nDState = namedtuple(\n    \"DState\",\n    [\"method\",    # discretization method\n     \"points\",    # induced cut points\n     \"disc_var\"]  # induced discretized variable\n)\n\n\ndef is_derived(var):\n    return var.compute_value is not None\n\n\ndef is_discretized(var):\n    return isinstance(var.compute_value, disc.Discretizer)\n\n\ndef variable_key(var):\n    return vartype(var), var.name\n\n\ndef button_group_reset(group):\n    button = group.checkedButton()\n    if button is not None:\n        group.setExclusive(False)\n        button.setChecked(False)\n        group.setExclusive(True)\n\n\nclass DiscDelegate(QStyledItemDelegate):\n    def initStyleOption(self, option, index):\n        super().initStyleOption(option, index)\n        state = index.data(Qt.UserRole)\n\n        if state is not None:\n            extra = self.cutsText(state)\n            option.text = option.text + \": \" + extra\n\n    @staticmethod\n    def cutsText(state):\n        # This function has many branches, but they don't hurt readabability\n        # pylint: disable=too-many-branches\n        method = state.method\n        name = None\n        # Need a better way to distinguish discretization states\n        # i.e. between 'induced no points v.s. 'removed by choice'\n        if state.points is None and state.disc_var is not None:\n            points = \"\"\n        elif state.points is None:\n            points = \"...\"\n        elif state.points == []:\n            points = \"<removed>\"\n        else:\n            points = \", \".join(map(\"{:.2f}\".format, state.points))\n\n        if isinstance(method, Default):\n            name = None\n        elif isinstance(method, Leave):\n            name = \"(leave)\"\n        elif isinstance(method, MDL):\n            name = \"(entropy)\"\n        elif isinstance(method, EqualFreq):\n            name = \"(equal frequency k={})\".format(method.k)\n        elif isinstance(method, EqualWidth):\n            name = \"(equal width k={})\".format(method.k)\n        elif isinstance(method, Remove):\n            name = \"(removed)\"\n        elif isinstance(method, Custom):\n            name = \"(custom)\"\n        else:\n            assert False\n\n        if name is not None:\n            return points + \" \" + name\n        else:\n            return points\n\n\nclass OWDiscretize(widget.OWWidget):\n    name = \"Discretize\"\n    description = \"Discretize the numeric data features.\"\n    icon = \"icons/Discretize.svg\"\n    keywords = []\n\n    class Inputs:\n        data = Input(\"Data\", Orange.data.Table, doc=\"Input data table\")\n\n    class Outputs:\n        data = Output(\"Data\", Orange.data.Table, doc=\"Table with discretized features\")\n\n    settingsHandler = settings.DomainContextHandler()\n    saved_var_states = settings.ContextSetting({})\n\n    default_method = settings.Setting(2)\n    default_k = settings.Setting(3)\n    autosend = settings.Setting(True)\n\n    #: Discretization methods\n    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    def __init__(self):\n        super().__init__()\n\n        #: input data\n        self.data = None\n        self.class_var = None\n        #: Current variable discretization state\n        self.var_state = {}\n        #: Saved variable discretization settings (context setting)\n        self.saved_var_states = {}\n\n        self.method = 0\n        self.k = 5\n        self.cutpoints = []\n\n        box = gui.vBox(self.controlArea, self.tr(\"Default Discretization\"))\n        self.default_bbox = rbox = gui.radioButtons(\n            box, self, \"default_method\", callback=self._default_disc_changed)\n        rb = gui.hBox(rbox)\n        self.left = gui.vBox(rb)\n        right = gui.vBox(rb)\n        rb.layout().setStretch(0, 1)\n        rb.layout().setStretch(1, 1)\n        options = self.options = [\n            self.tr(\"Default\"),\n            self.tr(\"Leave numeric\"),\n            self.tr(\"Entropy-MDL discretization\"),\n            self.tr(\"Equal-frequency discretization\"),\n            self.tr(\"Equal-width discretization\"),\n            self.tr(\"Remove numeric variables\")\n        ]\n\n        for opt in options[1:]:\n            t = gui.appendRadioButton(rbox, opt)\n            # This condition is ugly, but it keeps the same order of\n            # options for backward compatibility of saved schemata\n            [right, self.left][opt.startswith(\"Equal\")].layout().addWidget(t)\n        gui.separator(right, 18, 18)\n\n        def _intbox(parent, attr, callback):\n            box = gui.indentedBox(parent)\n            s = gui.spin(\n                box, self, attr, minv=2, maxv=10, label=\"Num. of intervals:\",\n                callback=callback)\n            s.setMaximumWidth(60)\n            s.setAlignment(Qt.AlignRight)\n            gui.rubber(s.box)\n            return box.box\n\n        self.k_general = _intbox(self.left, \"default_k\",\n                                 self._default_disc_changed)\n        self.k_general.layout().setContentsMargins(0, 0, 0, 0)\n        vlayout = QHBoxLayout()\n        box = gui.widgetBox(\n            self.controlArea, \"Individual Attribute Settings\",\n            orientation=vlayout, spacing=8\n        )\n\n        # List view with all attributes\n        self.varview = QListView(\n            selectionMode=QListView.ExtendedSelection,\n            uniformItemSizes=True,\n        )\n        self.varview.setItemDelegate(DiscDelegate())\n        self.varmodel = itemmodels.VariableListModel()\n        self.varview.setModel(self.varmodel)\n        self.varview.selectionModel().selectionChanged.connect(\n            self._var_selection_changed\n        )\n\n        vlayout.addWidget(self.varview)\n        # Controls for individual attr settings\n        self.bbox = controlbox = gui.radioButtons(\n            box, self, \"method\", callback=self._disc_method_changed\n        )\n        vlayout.addWidget(controlbox)\n\n        for opt in options[:5]:\n            gui.appendRadioButton(controlbox, opt)\n\n        self.k_specific = _intbox(controlbox, \"k\", self._disc_method_changed)\n\n        gui.appendRadioButton(controlbox, \"Remove attribute\")\n\n        gui.rubber(controlbox)\n        controlbox.setEnabled(False)\n\n        self.controlbox = controlbox\n\n        box = gui.auto_apply(self.controlArea, self, \"autosend\")\n        box.button.setFixedWidth(180)\n        box.layout().insertStretch(0)\n\n        self._update_spin_positions()\n\n\n    @Inputs.data\n    def set_data(self, data):\n        self.closeContext()\n        self.data = data\n        if self.data is not None:\n            self._initialize(data)\n            self.openContext(data)\n            # Restore the per variable discretization settings\n            self._restore(self.saved_var_states)\n            # Complete the induction of cut points\n            self._update_points()\n        else:\n            self._clear()\n        self.unconditional_commit()\n\n    def _initialize(self, data):\n        # Initialize the default variable states for new data.\n        self.class_var = data.domain.class_var\n        cvars = [var for var in data.domain.variables\n                 if var.is_continuous]\n        self.varmodel[:] = cvars\n\n        has_disc_class = data.domain.has_discrete_class\n\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)\n        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)\n\n        # If the newly disabled MDL button is checked then change it\n        if not has_disc_class and self.default_method == self.MDL - 1:\n            self.default_method = 0\n        if not has_disc_class and self.method == self.MDL:\n            self.method = 0\n\n        # Reset (initialize) the variable discretization states.\n        self._reset()\n\n    def _restore(self, saved_state):\n        # Restore variable states from a saved_state dictionary.\n        def_method = self._current_default_method()\n        for i, var in enumerate(self.varmodel):\n            key = variable_key(var)\n            if key in saved_state:\n                state = saved_state[key]\n                if isinstance(state.method, Default):\n                    state = DState(Default(def_method), None, None)\n                self._set_var_state(i, state)\n\n    def _reset(self):\n        # restore the individual variable settings back to defaults.\n        def_method = self._current_default_method()\n        self.var_state = {}\n        for i in range(len(self.varmodel)):\n            state = DState(Default(def_method), None, None)\n            self._set_var_state(i, state)\n\n    def _set_var_state(self, index, state):\n        # set the state of variable at `index` to `state`.\n        self.var_state[index] = state\n        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)\n\n    def _clear(self):\n        self.data = None\n        self.varmodel[:] = []\n        self.var_state = {}\n        self.saved_var_states = {}\n        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)\n        self.bbox.buttons[self.MDL].setEnabled(True)\n\n    def _update_points(self):\n        \"\"\"\n        Update the induced cut points.\n        \"\"\"\n        if self.data is None or not len(self.data):\n            return\n\n        def induce_cuts(method, data, var):\n            dvar = _dispatch[type(method)](method, data, var)\n            if dvar is None:\n                # removed\n                return [], None\n            elif dvar is var:\n                # no transformation took place\n                return None, var\n            elif is_discretized(dvar):\n                return dvar.compute_value.points, dvar\n            assert False\n            return None\n\n        for i, var in enumerate(self.varmodel):\n            state = self.var_state[i]\n            if state.points is None and state.disc_var is None:\n                points, dvar = induce_cuts(state.method, self.data, var)\n                new_state = state._replace(points=points, disc_var=dvar)\n                self._set_var_state(i, new_state)\n\n    @staticmethod\n    def _method_index(method):\n        return METHODS.index((type(method), ))\n\n    def _current_default_method(self):\n        method = self.default_method + 1\n        k = self.default_k\n        if method == OWDiscretize.Leave:\n            def_method = Leave()\n        elif method == OWDiscretize.MDL:\n            def_method = MDL()\n        elif method == OWDiscretize.EqualFreq:\n            def_method = EqualFreq(k)\n        elif method == OWDiscretize.EqualWidth:\n            def_method = EqualWidth(k)\n        elif method == OWDiscretize.Remove:\n            def_method = Remove()\n        else:\n            assert False\n        return def_method\n\n    def _current_method(self):\n        if self.method == OWDiscretize.Default:\n            method = Default(self._current_default_method())\n        elif self.method == OWDiscretize.Leave:\n            method = Leave()\n        elif self.method == OWDiscretize.MDL:\n            method = MDL()\n        elif self.method == OWDiscretize.EqualFreq:\n            method = EqualFreq(self.k)\n        elif self.method == OWDiscretize.EqualWidth:\n            method = EqualWidth(self.k)\n        elif self.method == OWDiscretize.Remove:\n            method = Remove()\n        elif self.method == OWDiscretize.Custom:\n            method = Custom(self.cutpoints)\n        else:\n            assert False\n        return method\n\n    def _update_spin_positions(self):\n        self.k_general.setDisabled(self.default_method not in [2, 3])\n        if self.default_method == 2:\n            self.left.layout().insertWidget(1, self.k_general)\n        elif self.default_method == 3:\n            self.left.layout().insertWidget(2, self.k_general)\n\n        self.k_specific.setDisabled(self.method not in [3, 4])\n        if self.method == 3:\n            self.bbox.layout().insertWidget(4, self.k_specific)\n        elif self.method == 4:\n            self.bbox.layout().insertWidget(5, self.k_specific)\n\n    def _default_disc_changed(self):\n        self._update_spin_positions()\n        method = self._current_default_method()\n        state = DState(Default(method), None, None)\n        for i, _ in enumerate(self.varmodel):\n            if isinstance(self.var_state[i].method, Default):\n                self._set_var_state(i, state)\n        self._update_points()\n        self.commit()\n\n    def _disc_method_changed(self):\n        self._update_spin_positions()\n        indices = self.selected_indices()\n        method = self._current_method()\n        state = DState(method, None, None)\n        for idx in indices:\n            self._set_var_state(idx, state)\n        self._update_points()\n        self.commit()\n\n    def _var_selection_changed(self, *_):\n        indices = self.selected_indices()\n        # set of all methods for the current selection\n        methods = [self.var_state[i].method for i in indices]\n        mset = set(methods)\n        self.controlbox.setEnabled(len(mset) > 0)\n        if len(mset) == 1:\n            method = mset.pop()\n            self.method = self._method_index(method)\n            if isinstance(method, (EqualFreq, EqualWidth)):\n                self.k = method.k\n            elif isinstance(method, Custom):\n                self.cutpoints = method.points\n        else:\n            # deselect the current button\n            self.method = -1\n            bg = self.controlbox.group\n            button_group_reset(bg)\n        self._update_spin_positions()\n\n    def selected_indices(self):\n        rows = self.varview.selectionModel().selectedRows()\n        return [index.row() for index in rows]\n\n    def discretized_var(self, index):\n        # type: (int) -> Optional[Orange.data.DiscreteVariable]\n        state = self.var_state[index]\n        if state.disc_var is not None and state.points == []:\n            # Removed by MDL Entropy\n            return None\n        else:\n            return state.disc_var\n\n    def discretized_domain(self):\n        \"\"\"\n        Return the current effective discretized domain.\n        \"\"\"\n        if self.data is None:\n            return None\n\n        # a mapping of all applied changes for variables in `varmodel`\n        mapping = {var: self.discretized_var(i)\n                   for i, var in enumerate(self.varmodel)}\n\n        def disc_var(source):\n            return mapping.get(source, source)\n\n        # map the full input domain to the new variables (where applicable)\n        attributes = [disc_var(v) for v in self.data.domain.attributes]\n        attributes = [v for v in attributes if v is not None]\n\n        class_vars = [disc_var(v) for v in self.data.domain.class_vars]\n        class_vars = [v for v in class_vars if v is not None]\n\n        domain = Orange.data.Domain(\n            attributes, class_vars, metas=self.data.domain.metas\n        )\n        return domain\n\n    def commit(self):\n        output = None\n        if self.data is not None and len(self.data):\n            domain = self.discretized_domain()\n            output = self.data.transform(domain)\n        self.Outputs.data.send(output)\n\n    def storeSpecificSettings(self):\n        super().storeSpecificSettings()\n        self.saved_var_states = {\n            variable_key(var):\n                self.var_state[i]._replace(points=None, disc_var=None)\n            for i, var in enumerate(self.varmodel)\n        }\n\n    def send_report(self):\n        self.report_items((\n            (\"Default method\", self.options[self.default_method + 1]),))\n        if self.varmodel:\n            self.report_items(\"Thresholds\", [\n                (var.name,\n                 DiscDelegate.cutsText(self.var_state[i]) or \"leave numeric\")\n                for i, var in enumerate(self.varmodel)])\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    WidgetPreview(OWDiscretize).run(Orange.data.Table(\"brown-selected\"))\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:** OWDiscretize Widget Fails to Update Status Bar with Data Summaries

**Description:**
When loading data into the OWDiscretize widget, the status bar does not display the number of input and output instances. This omission makes it difficult for users to verify that data is correctly loaded and processed.

**Example Code:**
```python
from Orange.data import Table
from Orange.widgets.data.owdiscretize import OWDiscretize

def load_and_discretize_data():
    data = Table("iris")
    widget = OWDiscretize()
    widget.set_data(data)
    # Expect the status bar to show input summary as 150
    # Currently, it shows 'No Input' instead
```

**Expected Behavior:**
After setting the data, the status bar should display a summary indicating the number of input instances (e.g., "150") and the number of output instances after discretization.

**Actual Behavior:**
The status bar displays "No Input" and "No Output" even after data is loaded and processed, preventing users from seeing relevant data summaries.
[/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/owdiscretize.py
from collections import namedtuple
from typing import Optional

from AnyQt.QtWidgets import QListView, QHBoxLayout, QStyledItemDelegate
from AnyQt.QtCore import Qt

import Orange.data
import Orange.preprocess.discretize as disc

from Orange.widgets import widget, gui, settings
from Orange.widgets.utils import itemmodels, vartype
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output

__all__ = ["OWDiscretize"]

# 'Default' method delegates to 'method'
Default = namedtuple("Default", ["method"])
Leave = namedtuple("Leave", [])
MDL = namedtuple("MDL", [])
EqualFreq = namedtuple("EqualFreq", ["k"])
EqualWidth = namedtuple("EqualWidth", ["k"])
Remove = namedtuple("Remove", [])
Custom = namedtuple("Custom", ["points"])

METHODS = [
    (Default, ),
    (Leave, ),
    (MDL, ),
    (EqualFreq, ),
    (EqualWidth, ),
    (Remove, ),
    (Custom, )
]

_dispatch = {
    Default:
        lambda m, data, var: _dispatch[type(m.method)](m.method, data, var),
    Leave: lambda m, data, var: var,
    MDL: lambda m, data, var: disc.EntropyMDL()(data, var),
    EqualFreq: lambda m, data, var: disc.EqualFreq(m.k)(data, var),
    EqualWidth: lambda m, data, var: disc.EqualWidth(m.k)(data, var),
    Remove: lambda m, data, var: None,
    Custom:
        lambda m, data, var:
        disc.Discretizer.create_discretized_var(var, m.points)
}


# Variable discretization state
DState = namedtuple(
    "DState",
    ["method",    # discretization method
     "points",    # induced cut points
     "disc_var"]  # induced discretized variable
)


def is_derived(var):
    return var.compute_value is not None


def is_discretized(var):
    return isinstance(var.compute_value, disc.Discretizer)


def variable_key(var):
    return vartype(var), var.name


def button_group_reset(group):
    button = group.checkedButton()
    if button is not None:
        group.setExclusive(False)
        button.setChecked(False)
        group.setExclusive(True)


class DiscDelegate(QStyledItemDelegate):
    def initStyleOption(self, option, index):
        super().initStyleOption(option, index)
        state = index.data(Qt.UserRole)

        if state is not None:
            extra = self.cutsText(state)
            option.text = option.text + ": " + extra

    @staticmethod
    def cutsText(state):
        # This function has many branches, but they don't hurt readabability
        # pylint: disable=too-many-branches
        method = state.method
        name = None
        # Need a better way to distinguish discretization states
        # i.e. between 'induced no points v.s. 'removed by choice'
        if state.points is None and state.disc_var is not None:
            points = ""
        elif state.points is None:
            points = "..."
        elif state.points == []:
            points = "<removed>"
        else:
            points = ", ".join(map("{:.2f}".format, state.points))

        if isinstance(method, Default):
            name = None
        elif isinstance(method, Leave):
            name = "(leave)"
        elif isinstance(method, MDL):
            name = "(entropy)"
        elif isinstance(method, EqualFreq):
            name = "(equal frequency k={})".format(method.k)
        elif isinstance(method, EqualWidth):
            name = "(equal width k={})".format(method.k)
        elif isinstance(method, Remove):
            name = "(removed)"
        elif isinstance(method, Custom):
            name = "(custom)"
        else:
            assert False

        if name is not None:
            return points + " " + name
        else:
            return points


class OWDiscretize(widget.OWWidget):
    name = "Discretize"
    description = "Discretize the numeric data features."
    icon = "icons/Discretize.svg"
    keywords = []

    class Inputs:
        data = Input("Data", Orange.data.Table, doc="Input data table")

    class Outputs:
        data = Output("Data", Orange.data.Table, doc="Table with discretized features")

    settingsHandler = settings.DomainContextHandler()
    saved_var_states = settings.ContextSetting({})

    default_method = settings.Setting(2)
    default_k = settings.Setting(3)
    autosend = settings.Setting(True)

    #: Discretization methods
    Default, Leave, MDL, EqualFreq, EqualWidth, Remove, Custom = range(7)

    want_main_area = False
    resizing_enabled = False

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

        #: input data
        self.data = None
        self.class_var = None
        #: Current variable discretization state
        self.var_state = {}
        #: Saved variable discretization settings (context setting)
        self.saved_var_states = {}

        self.method = 0
        self.k = 5
        self.cutpoints = []

        box = gui.vBox(self.controlArea, self.tr("Default Discretization"))
        self.default_bbox = rbox = gui.radioButtons(
            box, self, "default_method", callback=self._default_disc_changed)
        rb = gui.hBox(rbox)
        self.left = gui.vBox(rb)
        right = gui.vBox(rb)
        rb.layout().setStretch(0, 1)
        rb.layout().setStretch(1, 1)
        options = self.options = [
            self.tr("Default"),
            self.tr("Leave numeric"),
            self.tr("Entropy-MDL discretization"),
            self.tr("Equal-frequency discretization"),
            self.tr("Equal-width discretization"),
            self.tr("Remove numeric variables")
        ]

        for opt in options[1:]:
            t = gui.appendRadioButton(rbox, opt)
            # This condition is ugly, but it keeps the same order of
            # options for backward compatibility of saved schemata
            [right, self.left][opt.startswith("Equal")].layout().addWidget(t)
        gui.separator(right, 18, 18)

        def _intbox(parent, attr, callback):
            box = gui.indentedBox(parent)
            s = gui.spin(
                box, self, attr, minv=2, maxv=10, label="Num. of intervals:",
                callback=callback)
            s.setMaximumWidth(60)
            s.setAlignment(Qt.AlignRight)
            gui.rubber(s.box)
            return box.box

        self.k_general = _intbox(self.left, "default_k",
                                 self._default_disc_changed)
        self.k_general.layout().setContentsMargins(0, 0, 0, 0)
        vlayout = QHBoxLayout()
        box = gui.widgetBox(
            self.controlArea, "Individual Attribute Settings",
            orientation=vlayout, spacing=8
        )

        # List view with all attributes
        self.varview = QListView(
            selectionMode=QListView.ExtendedSelection,
            uniformItemSizes=True,
        )
        self.varview.setItemDelegate(DiscDelegate())
        self.varmodel = itemmodels.VariableListModel()
        self.varview.setModel(self.varmodel)
        self.varview.selectionModel().selectionChanged.connect(
            self._var_selection_changed
        )

        vlayout.addWidget(self.varview)
        # Controls for individual attr settings
        self.bbox = controlbox = gui.radioButtons(
            box, self, "method", callback=self._disc_method_changed
        )
        vlayout.addWidget(controlbox)

        for opt in options[:5]:
            gui.appendRadioButton(controlbox, opt)

        self.k_specific = _intbox(controlbox, "k", self._disc_method_changed)

        gui.appendRadioButton(controlbox, "Remove attribute")

        gui.rubber(controlbox)
        controlbox.setEnabled(False)

        self.controlbox = controlbox

        box = gui.auto_apply(self.controlArea, self, "autosend")
        box.button.setFixedWidth(180)
        box.layout().insertStretch(0)

        self._update_spin_positions()


    @Inputs.data
    def set_data(self, data):
        self.closeContext()
        self.data = data
        if self.data is not None:
            self._initialize(data)
            self.openContext(data)
            # Restore the per variable discretization settings
            self._restore(self.saved_var_states)
            # Complete the induction of cut points
            self._update_points()
        else:
            self._clear()
        self.unconditional_commit()

    def _initialize(self, data):
        # Initialize the default variable states for new data.
        self.class_var = data.domain.class_var
        cvars = [var for var in data.domain.variables
                 if var.is_continuous]
        self.varmodel[:] = cvars

        has_disc_class = data.domain.has_discrete_class

        self.default_bbox.buttons[self.MDL - 1].setEnabled(has_disc_class)
        self.bbox.buttons[self.MDL].setEnabled(has_disc_class)

        # If the newly disabled MDL button is checked then change it
        if not has_disc_class and self.default_method == self.MDL - 1:
            self.default_method = 0
        if not has_disc_class and self.method == self.MDL:
            self.method = 0

        # Reset (initialize) the variable discretization states.
        self._reset()

    def _restore(self, saved_state):
        # Restore variable states from a saved_state dictionary.
        def_method = self._current_default_method()
        for i, var in enumerate(self.varmodel):
            key = variable_key(var)
            if key in saved_state:
                state = saved_state[key]
                if isinstance(state.method, Default):
                    state = DState(Default(def_method), None, None)
                self._set_var_state(i, state)

    def _reset(self):
        # restore the individual variable settings back to defaults.
        def_method = self._current_default_method()
        self.var_state = {}
        for i in range(len(self.varmodel)):
            state = DState(Default(def_method), None, None)
            self._set_var_state(i, state)

    def _set_var_state(self, index, state):
        # set the state of variable at `index` to `state`.
        self.var_state[index] = state
        self.varmodel.setData(self.varmodel.index(index), state, Qt.UserRole)

    def _clear(self):
        self.data = None
        self.varmodel[:] = []
        self.var_state = {}
        self.saved_var_states = {}
        self.default_bbox.buttons[self.MDL - 1].setEnabled(True)
        self.bbox.buttons[self.MDL].setEnabled(True)

    def _update_points(self):
        """
        Update the induced cut points.
        """
        if self.data is None or not len(self.data):
            return

        def induce_cuts(method, data, var):
            dvar = _dispatch[type(method)](method, data, var)
            if dvar is None:
                # removed
                return [], None
            elif dvar is var:
                # no transformation took place
                return None, var
            elif is_discretized(dvar):
                return dvar.compute_value.points, dvar
            assert False
            return None

        for i, var in enumerate(self.varmodel):
            state = self.var_state[i]
            if state.points is None and state.disc_var is None:
                points, dvar = induce_cuts(state.method, self.data, var)
                new_state = state._replace(points=points, disc_var=dvar)
                self._set_var_state(i, new_state)

    @staticmethod
    def _method_index(method):
        return METHODS.index((type(method), ))

    def _current_default_method(self):
        method = self.default_method + 1
        k = self.default_k
        if method == OWDiscretize.Leave:
            def_method = Leave()
        elif method == OWDiscretize.MDL:
            def_method = MDL()
        elif method == OWDiscretize.EqualFreq:
            def_method = EqualFreq(k)
        elif method == OWDiscretize.EqualWidth:
            def_method = EqualWidth(k)
        elif method == OWDiscretize.Remove:
            def_method = Remove()
        else:
            assert False
        return def_method

    def _current_method(self):
        if self.method == OWDiscretize.Default:
            method = Default(self._current_default_method())
        elif self.method == OWDiscretize.Leave:
            method = Leave()
        elif self.method == OWDiscretize.MDL:
            method = MDL()
        elif self.method == OWDiscretize.EqualFreq:
            method = EqualFreq(self.k)
        elif self.method == OWDiscretize.EqualWidth:
            method = EqualWidth(self.k)
        elif self.method == OWDiscretize.Remove:
            method = Remove()
        elif self.method == OWDiscretize.Custom:
            method = Custom(self.cutpoints)
        else:
            assert False
        return method

    def _update_spin_positions(self):
        self.k_general.setDisabled(self.default_method not in [2, 3])
        if self.default_method == 2:
            self.left.layout().insertWidget(1, self.k_general)
        elif self.default_method == 3:
            self.left.layout().insertWidget(2, self.k_general)

        self.k_specific.setDisabled(self.method not in [3, 4])
        if self.method == 3:
            self.bbox.layout().insertWidget(4, self.k_specific)
        elif self.method == 4:
            self.bbox.layout().insertWidget(5, self.k_specific)

    def _default_disc_changed(self):
        self._update_spin_positions()
        method = self._current_default_method()
        state = DState(Default(method), None, None)
        for i, _ in enumerate(self.varmodel):
            if isinstance(self.var_state[i].method, Default):
                self._set_var_state(i, state)
        self._update_points()
        self.commit()

    def _disc_method_changed(self):
        self._update_spin_positions()
        indices = self.selected_indices()
        method = self._current_method()
        state = DState(method, None, None)
        for idx in indices:
            self._set_var_state(idx, state)
        self._update_points()
        self.commit()

    def _var_selection_changed(self, *_):
        indices = self.selected_indices()
        # set of all methods for the current selection
        methods = [self.var_state[i].method for i in indices]
        mset = set(methods)
        self.controlbox.setEnabled(len(mset) > 0)
        if len(mset) == 1:
            method = mset.pop()
            self.method = self._method_index(method)
            if isinstance(method, (EqualFreq, EqualWidth)):
                self.k = method.k
            elif isinstance(method, Custom):
                self.cutpoints = method.points
        else:
            # deselect the current button
            self.method = -1
            bg = self.controlbox.group
            button_group_reset(bg)
        self._update_spin_positions()

    def selected_indices(self):
        rows = self.varview.selectionModel().selectedRows()
        return [index.row() for index in rows]

    def discretized_var(self, index):
        # type: (int) -> Optional[Orange.data.DiscreteVariable]
        state = self.var_state[index]
        if state.disc_var is not None and state.points == []:
            # Removed by MDL Entropy
            return None
        else:
            return state.disc_var

    def discretized_domain(self):
        """
        Return the current effective discretized domain.
        """
        if self.data is None:
            return None

        # a mapping of all applied changes for variables in `varmodel`
        mapping = {var: self.discretized_var(i)
                   for i, var in enumerate(self.varmodel)}

        def disc_var(source):
            return mapping.get(source, source)

        # map the full input domain to the new variables (where applicable)
        attributes = [disc_var(v) for v in self.data.domain.attributes]
        attributes = [v for v in attributes if v is not None]

        class_vars = [disc_var(v) for v in self.data.domain.class_vars]
        class_vars = [v for v in class_vars if v is not None]

        domain = Orange.data.Domain(
            attributes, class_vars, metas=self.data.domain.metas
        )
        return domain

    def commit(self):
        output = None
        if self.data is not None and len(self.data):
            domain = self.discretized_domain()
            output = self.data.transform(domain)
        self.Outputs.data.send(output)

    def storeSpecificSettings(self):
        super().storeSpecificSettings()
        self.saved_var_states = {
            variable_key(var):
                self.var_state[i]._replace(points=None, disc_var=None)
            for i, var in enumerate(self.varmodel)
        }

    def send_report(self):
        self.report_items((
            ("Default method", self.options[self.default_method + 1]),))
        if self.varmodel:
            self.report_items("Thresholds", [
                (var.name,
                 DiscDelegate.cutsText(self.var_state[i]) or "leave numeric")
                for i, var in enumerate(self.varmodel)])


if __name__ == "__main__":  # pragma: no cover
    WidgetPreview(OWDiscretize).run(Orange.data.Table("brown-selected"))

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