{
    "file_diffs": [
        {
            "old_file_content": "from collections import namedtuple\n\nimport numpy as np\n\nfrom Orange.data import Domain, DiscreteVariable, Table\nfrom Orange.preprocess.transformation import Lookup\nfrom Orange.statistics.util import nanunique\nfrom .preprocess import Preprocess\n\n__all__ = [\"Remove\"]\n\n\nclass Remove(Preprocess):\n    \"\"\"\n    Construct a preprocessor for removing constant features/classes\n    and unused values.\n    Given a data table, preprocessor returns a new table and a list of\n    results. In the new table, the constant features/classes and unused\n    values are removed. The list of results consists of two dictionaries.\n    The first one contains numbers of 'removed', 'reduced' and 'sorted'\n    features. The second one contains numbers of 'removed', 'reduced'\n    and 'sorted' features.\n\n    Parameters\n    ----------\n    attr_flags : int (default: 0)\n        If SortValues, values of discrete attributes are sorted.\n        If RemoveConstant, unused attributes are removed.\n        If RemoveUnusedValues, unused values are removed from discrete\n        attributes.\n        It is possible to merge operations in one by summing several types.\n\n    class_flags: int (default: 0)\n        If SortValues, values of discrete class attributes are sorted.\n        If RemoveConstant, unused class attributes are removed.\n        If RemoveUnusedValues, unused values are removed from discrete\n        class attributes.\n        It is possible to merge operations in one by summing several types.\n\n    Examples\n    --------\n    >>> from Orange.data import Table\n    >>> from Orange.preprocess import Remove\n    >>> data = Table(\"zoo\")[:10]\n    >>> flags = sum([Remove.SortValues, Remove.RemoveConstant, Remove.RemoveUnusedValues])\n    >>> remover = Remove(attr_flags=flags, class_flags=flags)\n    >>> new_data = remover(data)\n    >>> attr_results, class_results = remover.attr_results, remover.class_results\n    \"\"\"\n\n    SortValues, RemoveConstant, RemoveUnusedValues = 1, 2, 4\n\n    def __init__(self, attr_flags=0, class_flags=0, meta_flags=0):\n        self.attr_flags = attr_flags\n        self.class_flags = class_flags\n        self.meta_flags = meta_flags\n        self.attr_results = None\n        self.class_results = None\n        self.meta_results = None\n\n    def __call__(self, data):\n        \"\"\"\n        Removes unused features or classes from the given data. Returns a new\n        data table.\n\n        Parameters\n        ----------\n        data : Orange.data.Table\n            A data table to remove features or classes from.\n\n        Returns\n        -------\n        data : Orange.data.Table\n            New data table.\n        \"\"\"\n        if data is None:\n            return None\n\n        domain = data.domain\n        attrs_state = [purge_var_M(var, data, self.attr_flags)\n                       for var in domain.attributes]\n        class_state = [purge_var_M(var, data, self.class_flags)\n                       for var in domain.class_vars]\n        metas_state = [purge_var_M(var, data, self.meta_flags)\n                       for var in domain.metas]\n\n        att_vars, self.attr_results = self.get_vars_and_results(attrs_state)\n        cls_vars, self.class_results = self.get_vars_and_results(class_state)\n        meta_vars, self.meta_results = self.get_vars_and_results(metas_state)\n\n        domain = Domain(att_vars, cls_vars, meta_vars)\n        return data.transform(domain)\n\n    def get_vars_and_results(self, state):\n        removed, reduced, sorted = 0, 0, 0\n        vars = []\n        for st in state:\n            removed += is_removed(st)\n            reduced += not is_removed(st) and is_reduced(st)\n            sorted += not is_removed(st) and is_sorted(st)\n            if not is_removed(st):\n                vars.append(merge_transforms(st).var)\n        res = {'removed': removed, 'reduced': reduced, 'sorted': sorted}\n        return vars, res\n\n\n# Define a simple Purge expression 'language'.\n#: A input variable (leaf expression).\nVar = namedtuple(\"Var\", [\"var\"])\n#: Removed variable (can only ever be present as a root node).\nRemoved = namedtuple(\"Removed\", [\"sub\", \"var\"])\n#: A reduced variable\nReduced = namedtuple(\"Reduced\", [\"sub\", \"var\"])\n#: A sorted variable\nSorted = namedtuple(\"Sorted\", [\"sub\", \"var\"])\n#: A general (lookup) transformed variable.\n#: (this node is returned as a result of `merge` which joins consecutive\n#: Removed/Reduced nodes into a single Transformed node)\nTransformed = namedtuple(\"Transformed\", [\"sub\", \"var\"])\n\n\ndef is_var(exp):\n    \"\"\"Is `exp` a `Var` node.\"\"\"\n    return isinstance(exp, Var)\n\n\ndef is_removed(exp):\n    \"\"\"Is `exp` a `Removed` node.\"\"\"\n    return isinstance(exp, Removed)\n\n\ndef _contains(exp, cls):\n    \"\"\"Does `node` contain a sub node of type `cls`\"\"\"\n    if isinstance(exp, cls):\n        return True\n    elif isinstance(exp, Var):\n        return False\n    else:\n        return _contains(exp.sub, cls)\n\n\ndef is_reduced(exp):\n    \"\"\"Does `exp` contain a `Reduced` node.\"\"\"\n    return _contains(exp, Reduced)\n\n\ndef is_sorted(exp):\n    \"\"\"Does `exp` contain a `Reduced` node.\"\"\"\n    return _contains(exp, Sorted)\n\n\ndef merge_transforms(exp):\n    \"\"\"\n    Merge consecutive Removed, Reduced or Transformed nodes.\n\n    .. note:: Removed nodes are returned unchanged.\n\n    \"\"\"\n    if isinstance(exp, (Var, Removed)):\n        return exp\n    elif isinstance(exp, (Reduced, Sorted, Transformed)):\n        prev = merge_transforms(exp.sub)\n        if isinstance(prev, (Reduced, Sorted, Transformed)):\n            B = exp.var.compute_value\n            assert isinstance(B, Lookup)\n            A = B.variable.compute_value\n            assert isinstance(A, Lookup)\n\n            new_var = DiscreteVariable(\n                exp.var.name,\n                values=exp.var.values,\n                ordered=exp.var.ordered,\n                compute_value=merge_lookup(A, B),\n                sparse=exp.var.sparse,\n            )\n            assert isinstance(prev.sub, Var)\n            return Transformed(prev.sub, new_var)\n        else:\n            assert prev is exp.sub\n            return exp\n    else:\n        raise TypeError\n\n\ndef purge_var_M(var, data, flags):\n    state = Var(var)\n    if flags & Remove.RemoveConstant:\n        var = remove_constant(state.var, data)\n        if var is None:\n            return Removed(state, state.var)\n\n    if state.var.is_discrete:\n        if flags & Remove.RemoveUnusedValues:\n            newattr = remove_unused_values(state.var, data)\n\n            if newattr is not state.var:\n                state = Reduced(state, newattr)\n\n            if flags & Remove.RemoveConstant and len(state.var.values) < 2:\n                return Removed(state, state.var)\n\n        if flags & Remove.SortValues:\n            newattr = sort_var_values(state.var)\n            if newattr is not state.var:\n                state = Sorted(state, newattr)\n\n    return state\n\n\ndef has_at_least_two_values(data, var):\n    ((dist, unknowns),) = data._compute_distributions([var])\n    # TODO this check is suboptimal for sparse since get_column_view\n    # densifies the data. Should be irrelevant after Pandas.\n    _, sparse = data.get_column_view(var)\n    if var.is_continuous:\n        dist = dist[1, :]\n    min_size = 0 if sparse and unknowns else 1\n    return np.sum(dist > 0.0) > min_size\n\n\ndef remove_constant(var, data):\n    if var.is_continuous:\n        if not has_at_least_two_values(data, var):\n            return None\n        else:\n            return var\n    elif var.is_discrete:\n        if len(var.values) < 2:\n            return None\n        else:\n            return var\n    else:\n        return var\n\n\ndef remove_unused_values(var, data):\n    unique = nanunique(data.get_column_view(var)[0].astype(float)).astype(int)\n    if len(unique) == len(var.values):\n        return var\n    used_values = [var.values[i] for i in unique]\n    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse)\n\n\ndef sort_var_values(var):\n    newvalues = list(sorted(var.values))\n\n    if newvalues == list(var.values):\n        return var\n\n    translation_table = np.array(\n        [float(newvalues.index(value)) for value in var.values]\n    )\n\n    return DiscreteVariable(var.name, values=newvalues,\n                            compute_value=Lookup(var, translation_table),\n                            sparse=var.sparse)\n\n\ndef merge_lookup(A, B):\n    \"\"\"\n    Merge two consecutive Lookup transforms into one.\n    \"\"\"\n    lookup_table = np.array(A.lookup_table)\n    mask = np.isfinite(lookup_table)\n    indices = np.array(lookup_table[mask], dtype=int)\n    lookup_table[mask] = B.lookup_table[indices]\n    return Lookup(A.variable, lookup_table)\n",
            "new_file_content": "from collections import namedtuple\n\nimport numpy as np\n\nfrom Orange.data import Domain, DiscreteVariable\nfrom Orange.preprocess.transformation import Lookup\nfrom Orange.statistics.util import nanunique\nfrom .preprocess import Preprocess\n\n__all__ = [\"Remove\"]\n\n\nclass Remove(Preprocess):\n    \"\"\"\n    Construct a preprocessor for removing constant features/classes\n    and unused values.\n    Given a data table, preprocessor returns a new table and a list of\n    results. In the new table, the constant features/classes and unused\n    values are removed. The list of results consists of two dictionaries.\n    The first one contains numbers of 'removed', 'reduced' and 'sorted'\n    features. The second one contains numbers of 'removed', 'reduced'\n    and 'sorted' features.\n\n    Parameters\n    ----------\n    attr_flags : int (default: 0)\n        If SortValues, values of discrete attributes are sorted.\n        If RemoveConstant, unused attributes are removed.\n        If RemoveUnusedValues, unused values are removed from discrete\n        attributes.\n        It is possible to merge operations in one by summing several types.\n\n    class_flags: int (default: 0)\n        If SortValues, values of discrete class attributes are sorted.\n        If RemoveConstant, unused class attributes are removed.\n        If RemoveUnusedValues, unused values are removed from discrete\n        class attributes.\n        It is possible to merge operations in one by summing several types.\n\n    Examples\n    --------\n    >>> from Orange.data import Table\n    >>> from Orange.preprocess import Remove\n    >>> data = Table(\"zoo\")[:10]\n    >>> flags = sum([Remove.SortValues, Remove.RemoveConstant, Remove.RemoveUnusedValues])\n    >>> remover = Remove(attr_flags=flags, class_flags=flags)\n    >>> new_data = remover(data)\n    >>> attr_results, class_results = remover.attr_results, remover.class_results\n    \"\"\"\n\n    SortValues, RemoveConstant, RemoveUnusedValues = 1, 2, 4\n\n    def __init__(self, attr_flags=0, class_flags=0, meta_flags=0):\n        self.attr_flags = attr_flags\n        self.class_flags = class_flags\n        self.meta_flags = meta_flags\n        self.attr_results = None\n        self.class_results = None\n        self.meta_results = None\n\n    def __call__(self, data):\n        \"\"\"\n        Removes unused features or classes from the given data. Returns a new\n        data table.\n\n        Parameters\n        ----------\n        data : Orange.data.Table\n            A data table to remove features or classes from.\n\n        Returns\n        -------\n        data : Orange.data.Table\n            New data table.\n        \"\"\"\n        if data is None:\n            return None\n\n        domain = data.domain\n        attrs_state = [purge_var_M(var, data, self.attr_flags)\n                       for var in domain.attributes]\n        class_state = [purge_var_M(var, data, self.class_flags)\n                       for var in domain.class_vars]\n        metas_state = [purge_var_M(var, data, self.meta_flags)\n                       for var in domain.metas]\n\n        att_vars, self.attr_results = self.get_vars_and_results(attrs_state)\n        cls_vars, self.class_results = self.get_vars_and_results(class_state)\n        meta_vars, self.meta_results = self.get_vars_and_results(metas_state)\n\n        domain = Domain(att_vars, cls_vars, meta_vars)\n        return data.transform(domain)\n\n    def get_vars_and_results(self, state):\n        removed, reduced, sorted = 0, 0, 0\n        vars = []\n        for st in state:\n            removed += is_removed(st)\n            reduced += not is_removed(st) and is_reduced(st)\n            sorted += not is_removed(st) and is_sorted(st)\n            if not is_removed(st):\n                vars.append(merge_transforms(st).var)\n        res = {'removed': removed, 'reduced': reduced, 'sorted': sorted}\n        return vars, res\n\n\n# Define a simple Purge expression 'language'.\n#: A input variable (leaf expression).\nVar = namedtuple(\"Var\", [\"var\"])\n#: Removed variable (can only ever be present as a root node).\nRemoved = namedtuple(\"Removed\", [\"sub\", \"var\"])\n#: A reduced variable\nReduced = namedtuple(\"Reduced\", [\"sub\", \"var\"])\n#: A sorted variable\nSorted = namedtuple(\"Sorted\", [\"sub\", \"var\"])\n#: A general (lookup) transformed variable.\n#: (this node is returned as a result of `merge` which joins consecutive\n#: Removed/Reduced nodes into a single Transformed node)\nTransformed = namedtuple(\"Transformed\", [\"sub\", \"var\"])\n\n\ndef is_var(exp):\n    \"\"\"Is `exp` a `Var` node.\"\"\"\n    return isinstance(exp, Var)\n\n\ndef is_removed(exp):\n    \"\"\"Is `exp` a `Removed` node.\"\"\"\n    return isinstance(exp, Removed)\n\n\ndef _contains(exp, cls):\n    \"\"\"Does `node` contain a sub node of type `cls`\"\"\"\n    if isinstance(exp, cls):\n        return True\n    elif isinstance(exp, Var):\n        return False\n    else:\n        return _contains(exp.sub, cls)\n\n\ndef is_reduced(exp):\n    \"\"\"Does `exp` contain a `Reduced` node.\"\"\"\n    return _contains(exp, Reduced)\n\n\ndef is_sorted(exp):\n    \"\"\"Does `exp` contain a `Reduced` node.\"\"\"\n    return _contains(exp, Sorted)\n\n\ndef merge_transforms(exp):\n    \"\"\"\n    Merge consecutive Removed, Reduced or Transformed nodes.\n\n    .. note:: Removed nodes are returned unchanged.\n\n    \"\"\"\n    if isinstance(exp, (Var, Removed)):\n        return exp\n    elif isinstance(exp, (Reduced, Sorted, Transformed)):\n        prev = merge_transforms(exp.sub)\n        if isinstance(prev, (Reduced, Sorted, Transformed)):\n            B = exp.var.compute_value\n            assert isinstance(B, Lookup)\n            A = B.variable.compute_value\n            assert isinstance(A, Lookup)\n\n            new_var = DiscreteVariable(\n                exp.var.name,\n                values=exp.var.values,\n                ordered=exp.var.ordered,\n                compute_value=merge_lookup(A, B),\n                sparse=exp.var.sparse,\n            )\n            assert isinstance(prev.sub, Var)\n            return Transformed(prev.sub, new_var)\n        else:\n            assert prev is exp.sub\n            return exp\n    else:\n        raise TypeError\n\n\ndef purge_var_M(var, data, flags):\n    state = Var(var)\n    if flags & Remove.RemoveConstant:\n        var = remove_constant(state.var, data)\n        if var is None:\n            return Removed(state, state.var)\n\n    if state.var.is_discrete:\n        if flags & Remove.RemoveUnusedValues:\n            newattr = remove_unused_values(state.var, data)\n\n            if newattr is not state.var:\n                state = Reduced(state, newattr)\n\n            if flags & Remove.RemoveConstant and len(state.var.values) < 2:\n                return Removed(state, state.var)\n\n        if flags & Remove.SortValues:\n            newattr = sort_var_values(state.var)\n            if newattr is not state.var:\n                state = Sorted(state, newattr)\n\n    return state\n\n\ndef has_at_least_two_values(data, var):\n    ((dist, unknowns),) = data._compute_distributions([var])\n    # TODO this check is suboptimal for sparse since get_column_view\n    # densifies the data. Should be irrelevant after Pandas.\n    _, sparse = data.get_column_view(var)\n    if var.is_continuous:\n        dist = dist[1, :]\n    min_size = 0 if sparse and unknowns else 1\n    return np.sum(dist > 0.0) > min_size\n\n\ndef remove_constant(var, data):\n    if var.is_continuous:\n        if not has_at_least_two_values(data, var):\n            return None\n        else:\n            return var\n    elif var.is_discrete:\n        if len(var.values) < 2:\n            return None\n        else:\n            return var\n    else:\n        return var\n\n\ndef remove_unused_values(var, data):\n    unique = nanunique(data.get_column_view(var)[0].astype(float)).astype(int)\n    if len(unique) == len(var.values):\n        return var\n    used_values = [var.values[i] for i in unique]\n    translation_table = np.array([np.NaN] * len(var.values))\n    translation_table[unique] = range(len(used_values))\n    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse,\n                            compute_value=Lookup(var, translation_table))\n\n\ndef sort_var_values(var):\n    newvalues = list(sorted(var.values))\n\n    if newvalues == list(var.values):\n        return var\n\n    translation_table = np.array(\n        [float(newvalues.index(value)) for value in var.values]\n    )\n\n    return DiscreteVariable(var.name, values=newvalues,\n                            compute_value=Lookup(var, translation_table),\n                            sparse=var.sparse)\n\n\ndef merge_lookup(A, B):\n    \"\"\"\n    Merge two consecutive Lookup transforms into one.\n    \"\"\"\n    lookup_table = np.array(A.lookup_table)\n    mask = np.isfinite(lookup_table)\n    indices = np.array(lookup_table[mask], dtype=int)\n    lookup_table[mask] = B.lookup_table[indices]\n    return Lookup(A.variable, lookup_table)\n",
            "header": {
                "file": {
                    "path": "Orange/preprocess/remove.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "7ae17376a",
                "new_commit_hash": "52a9bd5ef",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/preprocess/remove.py"
            },
            "plus_file": {
                "path": "b/Orange/preprocess/remove.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 2,
                            "length": 7
                        },
                        "new_range": {
                            "start": 2,
                            "length": 7
                        },
                        "section": "from collections import namedtuple"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Domain, DiscreteVariable, Table",
                                "type": "deleted"
                            },
                            {
                                "content": "from Orange.data import Domain, DiscreteVariable",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.preprocess.transformation import Lookup",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.statistics.util import nanunique",
                                "type": "context"
                            },
                            {
                                "content": "from .preprocess import Preprocess",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/preprocess/remove.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.data import Domain, DiscreteVariable",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 5,
                            "end_lineno": 5,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/preprocess/remove.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.data import Domain, DiscreteVariable, Table",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 5,
                            "end_lineno": 5,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 238,
                            "length": 7
                        },
                        "new_range": {
                            "start": 238,
                            "length": 10
                        },
                        "section": "def remove_unused_values(var, data):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    if len(unique) == len(var.values):",
                                "type": "context"
                            },
                            {
                                "content": "        return var",
                                "type": "context"
                            },
                            {
                                "content": "    used_values = [var.values[i] for i in unique]",
                                "type": "context"
                            },
                            {
                                "content": "    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse)",
                                "type": "deleted"
                            },
                            {
                                "content": "    translation_table = np.array([np.NaN] * len(var.values))",
                                "type": "added"
                            },
                            {
                                "content": "    translation_table[unique] = range(len(used_values))",
                                "type": "added"
                            },
                            {
                                "content": "    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse,",
                                "type": "added"
                            },
                            {
                                "content": "                            compute_value=Lookup(var, translation_table))",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "def sort_var_values(var):",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/preprocess/remove.py",
                            "type": "function",
                            "name": "remove_unused_values",
                            "content": "def remove_unused_values(var, data):\n    unique = nanunique(data.get_column_view(var)[0].astype(float)).astype(int)\n    if len(unique) == len(var.values):\n        return var\n    used_values = [var.values[i] for i in unique]\n    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse)",
                            "ast_type_str": "FunctionDef",
                            "start_lineno": 236,
                            "end_lineno": 241,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport unittest\n\nimport numpy as np\n\nfrom Orange.data import Table\nfrom Orange.preprocess import Remove\nfrom Orange.tests import test_filename\n\n\nclass TestRemover(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        cls.test8 = Table(test_filename('datasets/test8.tab'))\n\n    def test_remove(self):\n        data = Table(\"iris\")[:5]\n        attr_flags = sum([Remove.SortValues,\n                          Remove.RemoveConstant,\n                          Remove.RemoveUnusedValues])\n        class_flags = sum([Remove.SortValues,\n                           Remove.RemoveConstant,\n                           Remove.RemoveUnusedValues])\n        remover = Remove(attr_flags, class_flags)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"sepal length\", \"sepal width\", \"petal length\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars], [])\n        self.assertDictEqual(attr_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_attr(self):\n        data = self.test8\n        remover = Remove(Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, np.hstack((data[:, 1],\n                                                       data[:, 3])))\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c0\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_class(self):\n        data = self.test8\n        remover = Remove(class_flags=Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, np.hstack((data[:, 4],\n                                                       data[:, 5])))\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_attr(self):\n        data = self.test8\n        data = data[1:]\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_class(self):\n        data = self.test8\n        data = data[:2]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        for i in range(len(data)):\n            for j in range(len(data[i])):\n                self.assertEqual(new_data[i, j], data[i, j])\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_unused_values_metas(self):\n        data = Table(test_filename(\"datasets/test9.tab\"))\n        subset = data[:4]\n        res = Remove(attr_flags=Remove.RemoveUnusedValues,\n                     meta_flags=Remove.RemoveUnusedValues)(subset)\n\n        self.assertEqual(res.domain[\"b\"].values, res.domain[\"c\"].values)\n        self.assertEqual(res.domain[\"d\"].values, [\"1\", \"2\"])\n        self.assertEqual(res.domain[\"f\"].values, ['1', 'hey'])\n\n    def test_remove_unused_values_attr_sparse(self):\n        data = self.test8\n        data = data[1:].to_sparse()\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res = remover.attr_results\n\n        self.assertEqual((new_data.X != data.X).nnz, 0)\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_mapping(self):\n        data = Table(\"iris\")\n        x = np.vstack((data.X[:50], data.X[100:]))\n        y = np.hstack((data.Y[:50], data.Y[100:]))\n        data = Table.from_numpy(data.domain, x, y)\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_array_equal(cleaned.Y[:50], 0)\n        np.testing.assert_array_equal(cleaned.Y[50:], 1)\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport unittest\n\nimport numpy as np\n\nfrom Orange.data import Table\nfrom Orange.preprocess import Remove, discretize\nfrom Orange.tests import test_filename\n\n\nclass TestRemover(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        cls.test8 = Table(test_filename('datasets/test8.tab'))\n\n    def test_remove(self):\n        data = Table(\"iris\")[:5]\n        attr_flags = sum([Remove.SortValues,\n                          Remove.RemoveConstant,\n                          Remove.RemoveUnusedValues])\n        class_flags = sum([Remove.SortValues,\n                           Remove.RemoveConstant,\n                           Remove.RemoveUnusedValues])\n        remover = Remove(attr_flags, class_flags)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"sepal length\", \"sepal width\", \"petal length\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars], [])\n        self.assertDictEqual(attr_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_attr(self):\n        data = self.test8\n        remover = Remove(Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, np.hstack((data[:, 1],\n                                                       data[:, 3])))\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c0\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_class(self):\n        data = self.test8\n        remover = Remove(class_flags=Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, np.hstack((data[:, 4],\n                                                       data[:, 5])))\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_attr(self):\n        data = self.test8\n        data = data[1:]\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_class(self):\n        data = self.test8\n        data = data[:2]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        for i in range(len(data)):\n            for j in range(len(data[i])):\n                self.assertEqual(new_data[i, j], data[i, j])\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_unused_values_metas(self):\n        data = Table(test_filename(\"datasets/test9.tab\"))\n        subset = data[:4]\n        res = Remove(attr_flags=Remove.RemoveUnusedValues,\n                     meta_flags=Remove.RemoveUnusedValues)(subset)\n\n        self.assertEqual(res.domain[\"b\"].values, res.domain[\"c\"].values)\n        self.assertEqual(res.domain[\"d\"].values, [\"1\", \"2\"])\n        self.assertEqual(res.domain[\"f\"].values, ['1', 'hey'])\n\n    def test_remove_unused_values_attr_sparse(self):\n        data = self.test8\n        data = data[1:].to_sparse()\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res = remover.attr_results\n\n        self.assertEqual((new_data.X != data.X).nnz, 0)\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_mapping(self):\n        data = Table(\"iris\")\n        x = np.vstack((data.X[:50], data.X[100:]))\n        y = np.hstack((data.Y[:50], data.Y[100:]))\n        data = Table.from_numpy(data.domain, x, y)\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_array_equal(cleaned.Y[:50], 0)\n        np.testing.assert_array_equal(cleaned.Y[50:], 1)\n\n    def test_remove_mapping_after_compute_value(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        val12 = np.nonzero(data.Y > 0)[0]\n        data = data[val12]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_equal(cleaned.Y, data.Y - 1)\n",
            "header": {
                "file": {
                    "path": "Orange/tests/test_remove.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "cf5ccc9dd",
                "new_commit_hash": "92f8dbb47",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/tests/test_remove.py"
            },
            "plus_file": {
                "path": "b/Orange/tests/test_remove.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 6,
                            "length": 7
                        },
                        "new_range": {
                            "start": 6,
                            "length": 7
                        },
                        "section": "import unittest"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Table",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.preprocess import Remove",
                                "type": "deleted"
                            },
                            {
                                "content": "from Orange.preprocess import Remove, discretize",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.tests import test_filename",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/tests/test_remove.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.preprocess import Remove, discretize",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 9,
                            "end_lineno": 9,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/tests/test_remove.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.preprocess import Remove",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 9,
                            "end_lineno": 9,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 160,
                            "length": 3
                        },
                        "new_range": {
                            "start": 160,
                            "length": 16
                        },
                        "section": "class TestRemover(unittest.TestCase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        cleaned = remover(data)",
                                "type": "context"
                            },
                            {
                                "content": "        np.testing.assert_array_equal(cleaned.Y[:50], 0)",
                                "type": "context"
                            },
                            {
                                "content": "        np.testing.assert_array_equal(cleaned.Y[50:], 1)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_remove_mapping_after_compute_value(self):",
                                "type": "added"
                            },
                            {
                                "content": "        housing = Table(\"housing\")",
                                "type": "added"
                            },
                            {
                                "content": "        method = discretize.EqualFreq(n=3)",
                                "type": "added"
                            },
                            {
                                "content": "        discretizer = discretize.DomainDiscretizer(",
                                "type": "added"
                            },
                            {
                                "content": "            discretize_class=True, method=method)",
                                "type": "added"
                            },
                            {
                                "content": "        domain = discretizer(housing)",
                                "type": "added"
                            },
                            {
                                "content": "        data = housing.transform(domain)",
                                "type": "added"
                            },
                            {
                                "content": "        val12 = np.nonzero(data.Y > 0)[0]",
                                "type": "added"
                            },
                            {
                                "content": "        data = data[val12]",
                                "type": "added"
                            },
                            {
                                "content": "        remover = Remove(class_flags=Remove.RemoveUnusedValues)",
                                "type": "added"
                            },
                            {
                                "content": "        cleaned = remover(data)",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_equal(cleaned.Y, data.Y - 1)",
                                "type": "added"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/tests/test_remove.py",
                            "type": "class",
                            "name": "TestRemover",
                            "content": "class TestRemover(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        cls.test8 = Table(test_filename('datasets/test8.tab'))\n\n    def test_remove(self):\n        data = Table(\"iris\")[:5]\n        attr_flags = sum([Remove.SortValues,\n                          Remove.RemoveConstant,\n                          Remove.RemoveUnusedValues])\n        class_flags = sum([Remove.SortValues,\n                           Remove.RemoveConstant,\n                           Remove.RemoveUnusedValues])\n        remover = Remove(attr_flags, class_flags)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"sepal length\", \"sepal width\", \"petal length\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars], [])\n        self.assertDictEqual(attr_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_attr(self):\n        data = self.test8\n        remover = Remove(Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, np.hstack((data[:, 1],\n                                                       data[:, 3])))\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c0\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_class(self):\n        data = self.test8\n        remover = Remove(class_flags=Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, np.hstack((data[:, 4],\n                                                       data[:, 5])))\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_attr(self):\n        data = self.test8\n        data = data[1:]\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_class(self):\n        data = self.test8\n        data = data[:2]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        for i in range(len(data)):\n            for j in range(len(data[i])):\n                self.assertEqual(new_data[i, j], data[i, j])\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_unused_values_metas(self):\n        data = Table(test_filename(\"datasets/test9.tab\"))\n        subset = data[:4]\n        res = Remove(attr_flags=Remove.RemoveUnusedValues,\n                     meta_flags=Remove.RemoveUnusedValues)(subset)\n\n        self.assertEqual(res.domain[\"b\"].values, res.domain[\"c\"].values)\n        self.assertEqual(res.domain[\"d\"].values, [\"1\", \"2\"])\n        self.assertEqual(res.domain[\"f\"].values, ['1', 'hey'])\n\n    def test_remove_unused_values_attr_sparse(self):\n        data = self.test8\n        data = data[1:].to_sparse()\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res = remover.attr_results\n\n        self.assertEqual((new_data.X != data.X).nnz, 0)\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_mapping(self):\n        data = Table(\"iris\")\n        x = np.vstack((data.X[:50], data.X[100:]))\n        y = np.hstack((data.Y[:50], data.Y[100:]))\n        data = Table.from_numpy(data.domain, x, y)\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_array_equal(cleaned.Y[:50], 0)\n        np.testing.assert_array_equal(cleaned.Y[50:], 1)\n\n    def test_remove_mapping_after_compute_value(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        val12 = np.nonzero(data.Y > 0)[0]\n        data = data[val12]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_equal(cleaned.Y, data.Y - 1)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 13,
                            "end_lineno": 175,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/tests/test_remove.py",
                            "type": "method",
                            "name": "TestRemover.test_remove_mapping_after_compute_value",
                            "content": "class TestRemover(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        cls.test8 = Table(test_filename('datasets/test8.tab'))\n\n    def test_remove(self):\n        data = Table(\"iris\")[:5]\n        attr_flags = sum([Remove.SortValues,\n                          Remove.RemoveConstant,\n                          Remove.RemoveUnusedValues])\n        class_flags = sum([Remove.SortValues,\n                           Remove.RemoveConstant,\n                           Remove.RemoveUnusedValues])\n        remover = Remove(attr_flags, class_flags)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"sepal length\", \"sepal width\", \"petal length\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars], [])\n        self.assertDictEqual(attr_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_attr(self):\n        data = self.test8\n        remover = Remove(Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, np.hstack((data[:, 1],\n                                                       data[:, 3])))\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c0\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_class(self):\n        data = self.test8\n        remover = Remove(class_flags=Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, np.hstack((data[:, 4],\n                                                       data[:, 5])))\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_attr(self):\n        data = self.test8\n        data = data[1:]\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_class(self):\n        data = self.test8\n        data = data[:2]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        for i in range(len(data)):\n            for j in range(len(data[i])):\n                self.assertEqual(new_data[i, j], data[i, j])\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_unused_values_metas(self):\n        data = Table(test_filename(\"datasets/test9.tab\"))\n        subset = data[:4]\n        res = Remove(attr_flags=Remove.RemoveUnusedValues,\n                     meta_flags=Remove.RemoveUnusedValues)(subset)\n\n        self.assertEqual(res.domain[\"b\"].values, res.domain[\"c\"].values)\n        self.assertEqual(res.domain[\"d\"].values, [\"1\", \"2\"])\n        self.assertEqual(res.domain[\"f\"].values, ['1', 'hey'])\n\n    def test_remove_unused_values_attr_sparse(self):\n        data = self.test8\n        data = data[1:].to_sparse()\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res = remover.attr_results\n\n        self.assertEqual((new_data.X != data.X).nnz, 0)\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_mapping(self):\n        data = Table(\"iris\")\n        x = np.vstack((data.X[:50], data.X[100:]))\n        y = np.hstack((data.Y[:50], data.Y[100:]))\n        data = Table.from_numpy(data.domain, x, y)\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_array_equal(cleaned.Y[:50], 0)\n        np.testing.assert_array_equal(cleaned.Y[50:], 1)\n\n    def test_remove_mapping_after_compute_value(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        val12 = np.nonzero(data.Y > 0)[0]\n        data = data[val12]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_equal(cleaned.Y, data.Y - 1)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 164,
                            "end_lineno": 175,
                            "parent": {
                                "file_name": "Orange/tests/test_remove.py",
                                "type": "class",
                                "name": "TestRemover",
                                "content": "class TestRemover(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        cls.test8 = Table(test_filename('datasets/test8.tab'))\n\n    def test_remove(self):\n        data = Table(\"iris\")[:5]\n        attr_flags = sum([Remove.SortValues,\n                          Remove.RemoveConstant,\n                          Remove.RemoveUnusedValues])\n        class_flags = sum([Remove.SortValues,\n                           Remove.RemoveConstant,\n                           Remove.RemoveUnusedValues])\n        remover = Remove(attr_flags, class_flags)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"sepal length\", \"sepal width\", \"petal length\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars], [])\n        self.assertDictEqual(attr_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_attr(self):\n        data = self.test8\n        remover = Remove(Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, np.hstack((data[:, 1],\n                                                       data[:, 3])))\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c0\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_class(self):\n        data = self.test8\n        remover = Remove(class_flags=Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, np.hstack((data[:, 4],\n                                                       data[:, 5])))\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_attr(self):\n        data = self.test8\n        data = data[1:]\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_class(self):\n        data = self.test8\n        data = data[:2]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        for i in range(len(data)):\n            for j in range(len(data[i])):\n                self.assertEqual(new_data[i, j], data[i, j])\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_unused_values_metas(self):\n        data = Table(test_filename(\"datasets/test9.tab\"))\n        subset = data[:4]\n        res = Remove(attr_flags=Remove.RemoveUnusedValues,\n                     meta_flags=Remove.RemoveUnusedValues)(subset)\n\n        self.assertEqual(res.domain[\"b\"].values, res.domain[\"c\"].values)\n        self.assertEqual(res.domain[\"d\"].values, [\"1\", \"2\"])\n        self.assertEqual(res.domain[\"f\"].values, ['1', 'hey'])\n\n    def test_remove_unused_values_attr_sparse(self):\n        data = self.test8\n        data = data[1:].to_sparse()\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res = remover.attr_results\n\n        self.assertEqual((new_data.X != data.X).nnz, 0)\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_mapping(self):\n        data = Table(\"iris\")\n        x = np.vstack((data.X[:50], data.X[100:]))\n        y = np.hstack((data.Y[:50], data.Y[100:]))\n        data = Table.from_numpy(data.domain, x, y)\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_array_equal(cleaned.Y[:50], 0)\n        np.testing.assert_array_equal(cleaned.Y[50:], 1)\n\n    def test_remove_mapping_after_compute_value(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        val12 = np.nonzero(data.Y > 0)[0]\n        data = data[val12]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_equal(cleaned.Y, data.Y - 1)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 13,
                                "end_lineno": 175,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nimport time\n\nfrom AnyQt.QtCore import QLocale, Qt\nfrom AnyQt.QtTest import QTest\nfrom AnyQt.QtWidgets import QLineEdit, QComboBox\n\nimport numpy as np\n\nfrom Orange.data import (\n    Table, ContinuousVariable, StringVariable, DiscreteVariable, Domain)\nfrom Orange.widgets.data.owselectrows import (\n    OWSelectRows, FilterDiscreteType, SelectRowsContextHandler)\nfrom Orange.widgets.tests.base import WidgetTest, datasets\n\nfrom Orange.data.filter import FilterContinuous, FilterString\nfrom Orange.widgets.tests.utils import simulate, override_locale\nfrom Orange.widgets.utils.annotated_data import ANNOTATED_DATA_FEATURE_NAME\nfrom Orange.tests import test_filename\nfrom orangewidget.settings import VERSION_KEY\n\nCFValues = {\n    FilterContinuous.Equal: [\"5.4\"],\n    FilterContinuous.NotEqual: [\"5.4\"],\n    FilterContinuous.Less: [\"5.4\"],\n    FilterContinuous.LessEqual: [\"5.4\"],\n    FilterContinuous.Greater: [\"5.4\"],\n    FilterContinuous.GreaterEqual: [\"5.4\"],\n    FilterContinuous.Between: [\"5.4\", \"6.0\"],\n    FilterContinuous.Outside: [\"5.4\", \"6.0\"],\n    FilterContinuous.IsDefined: [],\n}\n\n\nSFValues = {\n    FilterString.Equal: [\"aardwark\"],\n    FilterString.NotEqual: [\"aardwark\"],\n    FilterString.Less: [\"aardwark\"],\n    FilterString.LessEqual: [\"aardwark\"],\n    FilterString.Greater: [\"aardwark\"],\n    FilterString.GreaterEqual: [\"aardwark\"],\n    FilterString.Between: [\"aardwark\", \"cat\"],\n    FilterString.Outside: [\"aardwark\"],\n    FilterString.Contains: [\"aa\"],\n    FilterString.StartsWith: [\"aa\"],\n    FilterString.EndsWith: [\"ark\"],\n    FilterString.IsDefined: []\n}\n\nDFValues = {\n    FilterDiscreteType.Equal: [0],\n    FilterDiscreteType.NotEqual: [0],\n    FilterDiscreteType.In: [0, 1],\n    FilterDiscreteType.IsDefined: [],\n}\n\n\nclass TestOWSelectRows(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSelectRows)  # type: OWSelectRows\n\n    def test_filter_cont(self):\n        iris = Table(\"iris\")[::5]\n        self.widget.auto_commit = True\n        self.widget.set_data(iris)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[ContinuousVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, CFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_str(self):\n        zoo = Table(\"zoo\")[::5]\n        self.widget.auto_commit = False\n        self.widget.set_data(zoo)\n        for i, (op, _) in enumerate(OWSelectRows.Operators[StringVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, SFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_disc(self):\n        lenses = Table(test_filename(\"datasets/lenses.tab\"))\n        self.widget.auto_commit = False\n        self.widget.set_data(lenses)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[DiscreteVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(0, i, DFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    @override_locale(QLocale.C)  # Locale with decimal point\n    def test_continuous_filter_with_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # Validating with C locale should accept decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5.2\",))\n\n        # but not decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)  # Locale with decimal comma\n    def test_continuous_filter_with_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        # but not decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)\n    def test_stores_settings_in_invariant_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        context = self.widget.current_context\n        self.send_signal(self.widget.Inputs.data, None)\n        saved_condition = context.values[\"conditions\"][0]\n        self.assertEqual(saved_condition[3][0], 5.2)\n\n    @override_locale(QLocale.C)\n    def test_restores_continuous_filter_in_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n    @override_locale(QLocale.Slovenian)\n    def test_restores_continuous_filter_in_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n    @override_locale(QLocale.C)\n    def test_partial_matches(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n        self.widget = self.widget_with_context(\n            domain, [[domain[0].name, 2, (\"5.2\",)]])\n        iris2 = iris.transform(Domain(domain.attributes[:2], None))\n        self.send_signal(self.widget.Inputs.data, iris2)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_load_settings(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        sepal_length, sepal_width = iris.domain[:2]\n\n        self.widget.remove_all_button.click()\n        self.enterFilter(sepal_width, \"is below\", \"5.2\")\n        self.enterFilter(sepal_length, \"is at most\", \"4\")\n        data = self.widget.settingsHandler.pack_data(self.widget)\n\n        w2 = self.create_widget(OWSelectRows, data)\n        self.send_signal(self.widget.Inputs.data, iris, widget=w2)\n\n        var_combo = w2.cond_list.cellWidget(0, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal width\")\n        oper_combo = w2.cond_list.cellWidget(0, 1)\n        self.assertEqual(oper_combo.currentText(), \"is below\")\n\n        var_combo = w2.cond_list.cellWidget(1, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal length\")\n        oper_combo = w2.cond_list.cellWidget(1, 1)\n        self.assertEqual(oper_combo.currentText(), \"is at most\")\n\n    def test_is_defined_on_continuous_variable(self):\n        # gh-2054 regression\n\n        data = Table(datasets.path(\"testing_dataset_cls\"))\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[\"c2\"], \"is defined\")\n        self.assertFalse(self.widget.Error.parsing_error.is_shown())\n        self.assertEqual(len(self.get_output(\"Matching Data\")), 3)\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), 1)\n        self.assertEqual(len(self.get_output(\"Data\")), len(data))\n\n        # Test saving of settings\n        self.widget.settingsHandler.pack_data(self.widget)\n\n    def test_output_filter(self):\n        \"\"\"\n        None on output when there is no data.\n        GH-2726\n        \"\"\"\n        data = Table(\"iris\")[:10]\n        len_data = len(data)\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[0], \"is below\", \"-1\")\n        self.assertIsNone(self.get_output(\"Matching Data\"))\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n        self.widget.remove_all_button.click()\n        self.enterFilter(data.domain[0], \"is below\", \"10\")\n        self.assertIsNone(self.get_output(\"Unmatched Data\"))\n        self.assertEqual(len(self.get_output(\"Matching Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n\n    def test_annotated_data(self):\n        iris = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        self.enterFilter(iris.domain[\"iris\"], \"is\", \"Iris-setosa\")\n\n        annotated = self.get_output(self.widget.Outputs.annotated_data)\n        self.assertEqual(len(annotated), 150)\n        annotations = annotated.get_column_view(ANNOTATED_DATA_FEATURE_NAME)[0]\n        np.testing.assert_equal(annotations[:50], True)\n        np.testing.assert_equal(annotations[50:], False)\n\n    def test_change_var_type(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n\n        self.send_signal(self.widget.Inputs.data, iris)\n        self.widget.remove_all_button.click()\n        self.enterFilter(domain[0], \"is below\", \"5.2\")\n\n        var0vals = list({str(x) for x in iris.X[:, 0]})\n        new_domain = Domain(\n            (DiscreteVariable(domain[0].name, values=var0vals), )\n            + domain.attributes[1:],\n            domain.class_var)\n        new_iris = iris.transform(new_domain)\n        self.send_signal(self.widget.Inputs.data, new_iris)\n\n    # Uncomment this on 2022/2/2\n    #\n    # def test_migration_to_version_1(self):\n    #     iris = Table(\"iris\")\n    #\n    #     ch = SelectRowsContextHandler()\n    #     context = ch.new_context(iris.domain, *ch.encode_domain(iris.domain))\n    #     context.values = dict(conditions=[[\"petal length\", 2, (5.2,)]])\n    #     settings = dict(context_settings=[context])\n    #     widget = self.create_widget(OWSelectRows, settings)\n    #     self.assertEqual(widget.conditions, [])\n\n    @override_locale(QLocale.C)\n    def test_support_old_settings(self):\n        iris = Table(\"iris\")\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_end_support_for_version_1(self):\n        if time.gmtime() >= (2022, 2, 2):\n            self.fail(\"\"\"\nHappy 22/2/2!\n\nNow remove support for version==None settings in\nSelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nand uncomment OWSelectRows.migrate.\n\nIn tests, uncomment test_migration_to_version_1,\nand remove test_support_old_settings and this test.\n\nBasically, revert this commit.\n\"\"\")\n\n    def widget_with_context(self, domain, conditions):\n        ch = SelectRowsContextHandler()\n        context = ch.new_context(domain, *ch.encode_domain(domain))\n        context.values = {\"conditions\": conditions,\n                          VERSION_KEY: OWSelectRows.settings_version}\n        settings = dict(context_settings=[context])\n\n        return self.create_widget(OWSelectRows, settings)\n\n    def enterFilter(self, variable, filter, value1=None, value2=None):\n        # pylint: disable=redefined-builtin\n        row = self.widget.cond_list.model().rowCount()\n        self.widget.add_button.click()\n\n        var_combo = self.widget.cond_list.cellWidget(row, 0)\n        simulate.combobox_activate_item(var_combo, variable.name, delay=0)\n\n        oper_combo = self.widget.cond_list.cellWidget(row, 1)\n        simulate.combobox_activate_item(oper_combo, filter, delay=0)\n\n        value_inputs = self.__get_value_widgets(row)\n        for i, value in enumerate([value1, value2]):\n            if value is None:\n                continue\n            self.__set_value(value_inputs[i], value)\n\n    def __get_value_widgets(self, row):\n        value_inputs = self.widget.cond_list.cellWidget(row, 2)\n        if value_inputs:\n            if isinstance(value_inputs, QComboBox):\n                value_inputs = [value_inputs]\n            else:\n                value_inputs = [\n                    w for w in value_inputs.children()\n                    if isinstance(w, QLineEdit)]\n        return value_inputs\n\n    @staticmethod\n    def __set_value(widget, value):\n        if isinstance(widget, QLineEdit):\n            QTest.mouseClick(widget, Qt.LeftButton)\n            QTest.keyClicks(widget, value, delay=0)\n            QTest.keyClick(widget, Qt.Key_Enter)\n        elif isinstance(widget, QComboBox):\n            simulate.combobox_activate_item(widget, value)\n        else:\n            raise ValueError(\"Unsupported widget {}\".format(widget))\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nimport time\n\nfrom AnyQt.QtCore import QLocale, Qt\nfrom AnyQt.QtTest import QTest\nfrom AnyQt.QtWidgets import QLineEdit, QComboBox\n\nimport numpy as np\n\nfrom Orange.data import (\n    Table, ContinuousVariable, StringVariable, DiscreteVariable, Domain)\nfrom Orange.preprocess import discretize\nfrom Orange.widgets.data.owselectrows import (\n    OWSelectRows, FilterDiscreteType, SelectRowsContextHandler)\nfrom Orange.widgets.tests.base import WidgetTest, datasets\n\nfrom Orange.data.filter import FilterContinuous, FilterString\nfrom Orange.widgets.tests.utils import simulate, override_locale\nfrom Orange.widgets.utils.annotated_data import ANNOTATED_DATA_FEATURE_NAME\nfrom Orange.tests import test_filename\nfrom orangewidget.settings import VERSION_KEY\n\nCFValues = {\n    FilterContinuous.Equal: [\"5.4\"],\n    FilterContinuous.NotEqual: [\"5.4\"],\n    FilterContinuous.Less: [\"5.4\"],\n    FilterContinuous.LessEqual: [\"5.4\"],\n    FilterContinuous.Greater: [\"5.4\"],\n    FilterContinuous.GreaterEqual: [\"5.4\"],\n    FilterContinuous.Between: [\"5.4\", \"6.0\"],\n    FilterContinuous.Outside: [\"5.4\", \"6.0\"],\n    FilterContinuous.IsDefined: [],\n}\n\n\nSFValues = {\n    FilterString.Equal: [\"aardwark\"],\n    FilterString.NotEqual: [\"aardwark\"],\n    FilterString.Less: [\"aardwark\"],\n    FilterString.LessEqual: [\"aardwark\"],\n    FilterString.Greater: [\"aardwark\"],\n    FilterString.GreaterEqual: [\"aardwark\"],\n    FilterString.Between: [\"aardwark\", \"cat\"],\n    FilterString.Outside: [\"aardwark\"],\n    FilterString.Contains: [\"aa\"],\n    FilterString.StartsWith: [\"aa\"],\n    FilterString.EndsWith: [\"ark\"],\n    FilterString.IsDefined: []\n}\n\nDFValues = {\n    FilterDiscreteType.Equal: [0],\n    FilterDiscreteType.NotEqual: [0],\n    FilterDiscreteType.In: [0, 1],\n    FilterDiscreteType.IsDefined: [],\n}\n\n\nclass TestOWSelectRows(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSelectRows)  # type: OWSelectRows\n\n    def test_filter_cont(self):\n        iris = Table(\"iris\")[::5]\n        self.widget.auto_commit = True\n        self.widget.set_data(iris)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[ContinuousVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, CFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_str(self):\n        zoo = Table(\"zoo\")[::5]\n        self.widget.auto_commit = False\n        self.widget.set_data(zoo)\n        for i, (op, _) in enumerate(OWSelectRows.Operators[StringVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, SFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_disc(self):\n        lenses = Table(test_filename(\"datasets/lenses.tab\"))\n        self.widget.auto_commit = False\n        self.widget.set_data(lenses)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[DiscreteVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(0, i, DFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    @override_locale(QLocale.C)  # Locale with decimal point\n    def test_continuous_filter_with_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # Validating with C locale should accept decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5.2\",))\n\n        # but not decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)  # Locale with decimal comma\n    def test_continuous_filter_with_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        # but not decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)\n    def test_stores_settings_in_invariant_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        context = self.widget.current_context\n        self.send_signal(self.widget.Inputs.data, None)\n        saved_condition = context.values[\"conditions\"][0]\n        self.assertEqual(saved_condition[3][0], 5.2)\n\n    @override_locale(QLocale.C)\n    def test_restores_continuous_filter_in_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n    @override_locale(QLocale.Slovenian)\n    def test_restores_continuous_filter_in_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n    @override_locale(QLocale.C)\n    def test_partial_matches(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n        self.widget = self.widget_with_context(\n            domain, [[domain[0].name, 2, (\"5.2\",)]])\n        iris2 = iris.transform(Domain(domain.attributes[:2], None))\n        self.send_signal(self.widget.Inputs.data, iris2)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_load_settings(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        sepal_length, sepal_width = iris.domain[:2]\n\n        self.widget.remove_all_button.click()\n        self.enterFilter(sepal_width, \"is below\", \"5.2\")\n        self.enterFilter(sepal_length, \"is at most\", \"4\")\n        data = self.widget.settingsHandler.pack_data(self.widget)\n\n        w2 = self.create_widget(OWSelectRows, data)\n        self.send_signal(self.widget.Inputs.data, iris, widget=w2)\n\n        var_combo = w2.cond_list.cellWidget(0, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal width\")\n        oper_combo = w2.cond_list.cellWidget(0, 1)\n        self.assertEqual(oper_combo.currentText(), \"is below\")\n\n        var_combo = w2.cond_list.cellWidget(1, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal length\")\n        oper_combo = w2.cond_list.cellWidget(1, 1)\n        self.assertEqual(oper_combo.currentText(), \"is at most\")\n\n    def test_is_defined_on_continuous_variable(self):\n        # gh-2054 regression\n\n        data = Table(datasets.path(\"testing_dataset_cls\"))\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[\"c2\"], \"is defined\")\n        self.assertFalse(self.widget.Error.parsing_error.is_shown())\n        self.assertEqual(len(self.get_output(\"Matching Data\")), 3)\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), 1)\n        self.assertEqual(len(self.get_output(\"Data\")), len(data))\n\n        # Test saving of settings\n        self.widget.settingsHandler.pack_data(self.widget)\n\n    def test_output_filter(self):\n        \"\"\"\n        None on output when there is no data.\n        GH-2726\n        \"\"\"\n        data = Table(\"iris\")[:10]\n        len_data = len(data)\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[0], \"is below\", \"-1\")\n        self.assertIsNone(self.get_output(\"Matching Data\"))\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n        self.widget.remove_all_button.click()\n        self.enterFilter(data.domain[0], \"is below\", \"10\")\n        self.assertIsNone(self.get_output(\"Unmatched Data\"))\n        self.assertEqual(len(self.get_output(\"Matching Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n\n    def test_annotated_data(self):\n        iris = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        self.enterFilter(iris.domain[\"iris\"], \"is\", \"Iris-setosa\")\n\n        annotated = self.get_output(self.widget.Outputs.annotated_data)\n        self.assertEqual(len(annotated), 150)\n        annotations = annotated.get_column_view(ANNOTATED_DATA_FEATURE_NAME)[0]\n        np.testing.assert_equal(annotations[:50], True)\n        np.testing.assert_equal(annotations[50:], False)\n\n    def test_change_var_type(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n\n        self.send_signal(self.widget.Inputs.data, iris)\n        self.widget.remove_all_button.click()\n        self.enterFilter(domain[0], \"is below\", \"5.2\")\n\n        var0vals = list({str(x) for x in iris.X[:, 0]})\n        new_domain = Domain(\n            (DiscreteVariable(domain[0].name, values=var0vals), )\n            + domain.attributes[1:],\n            domain.class_var)\n        new_iris = iris.transform(new_domain)\n        self.send_signal(self.widget.Inputs.data, new_iris)\n\n    # Uncomment this on 2022/2/2\n    #\n    # def test_migration_to_version_1(self):\n    #     iris = Table(\"iris\")\n    #\n    #     ch = SelectRowsContextHandler()\n    #     context = ch.new_context(iris.domain, *ch.encode_domain(iris.domain))\n    #     context.values = dict(conditions=[[\"petal length\", 2, (5.2,)]])\n    #     settings = dict(context_settings=[context])\n    #     widget = self.create_widget(OWSelectRows, settings)\n    #     self.assertEqual(widget.conditions, [])\n\n    @override_locale(QLocale.C)\n    def test_support_old_settings(self):\n        iris = Table(\"iris\")\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_end_support_for_version_1(self):\n        if time.gmtime() >= (2022, 2, 2):\n            self.fail(\"\"\"\nHappy 22/2/2!\n\nNow remove support for version==None settings in\nSelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nand uncomment OWSelectRows.migrate.\n\nIn tests, uncomment test_migration_to_version_1,\nand remove test_support_old_settings and this test.\n\nBasically, revert this commit.\n\"\"\")\n\n    def test_purge_discretized(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        widget = self.widget_with_context(domain, [[\"MEDV\", 2, (2, 3)]])\n        widget.purge_classes = True\n        self.send_signal(widget.Inputs.data, data)\n        out = self.get_output(widget.Outputs.matching_data)\n        expected = data.Y[(data.Y == 1) + (data.Y == 2)]\n        expected = (expected == 2).astype(float)\n        np.testing.assert_equal(out.Y, expected)\n\n    def widget_with_context(self, domain, conditions):\n        ch = SelectRowsContextHandler()\n        context = ch.new_context(domain, *ch.encode_domain(domain))\n        context.values = {\"conditions\": conditions,\n                          VERSION_KEY: OWSelectRows.settings_version}\n        settings = dict(context_settings=[context])\n\n        return self.create_widget(OWSelectRows, settings)\n\n    def enterFilter(self, variable, filter, value1=None, value2=None):\n        # pylint: disable=redefined-builtin\n        row = self.widget.cond_list.model().rowCount()\n        self.widget.add_button.click()\n\n        var_combo = self.widget.cond_list.cellWidget(row, 0)\n        simulate.combobox_activate_item(var_combo, variable.name, delay=0)\n\n        oper_combo = self.widget.cond_list.cellWidget(row, 1)\n        simulate.combobox_activate_item(oper_combo, filter, delay=0)\n\n        value_inputs = self.__get_value_widgets(row)\n        for i, value in enumerate([value1, value2]):\n            if value is None:\n                continue\n            self.__set_value(value_inputs[i], value)\n\n    def __get_value_widgets(self, row):\n        value_inputs = self.widget.cond_list.cellWidget(row, 2)\n        if value_inputs:\n            if isinstance(value_inputs, QComboBox):\n                value_inputs = [value_inputs]\n            else:\n                value_inputs = [\n                    w for w in value_inputs.children()\n                    if isinstance(w, QLineEdit)]\n        return value_inputs\n\n    @staticmethod\n    def __set_value(widget, value):\n        if isinstance(widget, QLineEdit):\n            QTest.mouseClick(widget, Qt.LeftButton)\n            QTest.keyClicks(widget, value, delay=0)\n            QTest.keyClick(widget, Qt.Key_Enter)\n        elif isinstance(widget, QComboBox):\n            simulate.combobox_activate_item(widget, value)\n        else:\n            raise ValueError(\"Unsupported widget {}\".format(widget))\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/tests/test_owselectrows.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "c26fed71d",
                "new_commit_hash": "9d7cad92d",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/tests/test_owselectrows.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/tests/test_owselectrows.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 10,
                            "length": 6
                        },
                        "new_range": {
                            "start": 10,
                            "length": 7
                        },
                        "section": "import numpy as np"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import (",
                                "type": "context"
                            },
                            {
                                "content": "    Table, ContinuousVariable, StringVariable, DiscreteVariable, Domain)",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.preprocess import discretize",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.widgets.data.owselectrows import (",
                                "type": "context"
                            },
                            {
                                "content": "    OWSelectRows, FilterDiscreteType, SelectRowsContextHandler)",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.widgets.tests.base import WidgetTest, datasets",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owselectrows.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.preprocess import discretize",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 13,
                            "end_lineno": 13,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 312,
                            "length": 6
                        },
                        "new_range": {
                            "start": 313,
                            "length": 21
                        },
                        "section": "and remove test_support_old_settings and this test."
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "Basically, revert this commit.",
                                "type": "context"
                            },
                            {
                                "content": "\"\"\")",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_purge_discretized(self):",
                                "type": "added"
                            },
                            {
                                "content": "        housing = Table(\"housing\")",
                                "type": "added"
                            },
                            {
                                "content": "        method = discretize.EqualFreq(n=3)",
                                "type": "added"
                            },
                            {
                                "content": "        discretizer = discretize.DomainDiscretizer(",
                                "type": "added"
                            },
                            {
                                "content": "            discretize_class=True, method=method)",
                                "type": "added"
                            },
                            {
                                "content": "        domain = discretizer(housing)",
                                "type": "added"
                            },
                            {
                                "content": "        data = housing.transform(domain)",
                                "type": "added"
                            },
                            {
                                "content": "        widget = self.widget_with_context(domain, [[\"MEDV\", 2, (2, 3)]])",
                                "type": "added"
                            },
                            {
                                "content": "        widget.purge_classes = True",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(widget.Inputs.data, data)",
                                "type": "added"
                            },
                            {
                                "content": "        out = self.get_output(widget.Outputs.matching_data)",
                                "type": "added"
                            },
                            {
                                "content": "        expected = data.Y[(data.Y == 1) + (data.Y == 2)]",
                                "type": "added"
                            },
                            {
                                "content": "        expected = (expected == 2).astype(float)",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_equal(out.Y, expected)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def widget_with_context(self, domain, conditions):",
                                "type": "context"
                            },
                            {
                                "content": "        ch = SelectRowsContextHandler()",
                                "type": "context"
                            },
                            {
                                "content": "        context = ch.new_context(domain, *ch.encode_domain(domain))",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owselectrows.py",
                            "type": "class",
                            "name": "TestOWSelectRows",
                            "content": "class TestOWSelectRows(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSelectRows)  # type: OWSelectRows\n\n    def test_filter_cont(self):\n        iris = Table(\"iris\")[::5]\n        self.widget.auto_commit = True\n        self.widget.set_data(iris)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[ContinuousVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, CFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_str(self):\n        zoo = Table(\"zoo\")[::5]\n        self.widget.auto_commit = False\n        self.widget.set_data(zoo)\n        for i, (op, _) in enumerate(OWSelectRows.Operators[StringVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, SFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_disc(self):\n        lenses = Table(test_filename(\"datasets/lenses.tab\"))\n        self.widget.auto_commit = False\n        self.widget.set_data(lenses)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[DiscreteVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(0, i, DFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    @override_locale(QLocale.C)  # Locale with decimal point\n    def test_continuous_filter_with_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # Validating with C locale should accept decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5.2\",))\n\n        # but not decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)  # Locale with decimal comma\n    def test_continuous_filter_with_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        # but not decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)\n    def test_stores_settings_in_invariant_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        context = self.widget.current_context\n        self.send_signal(self.widget.Inputs.data, None)\n        saved_condition = context.values[\"conditions\"][0]\n        self.assertEqual(saved_condition[3][0], 5.2)\n\n    @override_locale(QLocale.C)\n    def test_restores_continuous_filter_in_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n    @override_locale(QLocale.Slovenian)\n    def test_restores_continuous_filter_in_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n    @override_locale(QLocale.C)\n    def test_partial_matches(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n        self.widget = self.widget_with_context(\n            domain, [[domain[0].name, 2, (\"5.2\",)]])\n        iris2 = iris.transform(Domain(domain.attributes[:2], None))\n        self.send_signal(self.widget.Inputs.data, iris2)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_load_settings(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        sepal_length, sepal_width = iris.domain[:2]\n\n        self.widget.remove_all_button.click()\n        self.enterFilter(sepal_width, \"is below\", \"5.2\")\n        self.enterFilter(sepal_length, \"is at most\", \"4\")\n        data = self.widget.settingsHandler.pack_data(self.widget)\n\n        w2 = self.create_widget(OWSelectRows, data)\n        self.send_signal(self.widget.Inputs.data, iris, widget=w2)\n\n        var_combo = w2.cond_list.cellWidget(0, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal width\")\n        oper_combo = w2.cond_list.cellWidget(0, 1)\n        self.assertEqual(oper_combo.currentText(), \"is below\")\n\n        var_combo = w2.cond_list.cellWidget(1, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal length\")\n        oper_combo = w2.cond_list.cellWidget(1, 1)\n        self.assertEqual(oper_combo.currentText(), \"is at most\")\n\n    def test_is_defined_on_continuous_variable(self):\n        # gh-2054 regression\n\n        data = Table(datasets.path(\"testing_dataset_cls\"))\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[\"c2\"], \"is defined\")\n        self.assertFalse(self.widget.Error.parsing_error.is_shown())\n        self.assertEqual(len(self.get_output(\"Matching Data\")), 3)\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), 1)\n        self.assertEqual(len(self.get_output(\"Data\")), len(data))\n\n        # Test saving of settings\n        self.widget.settingsHandler.pack_data(self.widget)\n\n    def test_output_filter(self):\n        \"\"\"\n        None on output when there is no data.\n        GH-2726\n        \"\"\"\n        data = Table(\"iris\")[:10]\n        len_data = len(data)\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[0], \"is below\", \"-1\")\n        self.assertIsNone(self.get_output(\"Matching Data\"))\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n        self.widget.remove_all_button.click()\n        self.enterFilter(data.domain[0], \"is below\", \"10\")\n        self.assertIsNone(self.get_output(\"Unmatched Data\"))\n        self.assertEqual(len(self.get_output(\"Matching Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n\n    def test_annotated_data(self):\n        iris = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        self.enterFilter(iris.domain[\"iris\"], \"is\", \"Iris-setosa\")\n\n        annotated = self.get_output(self.widget.Outputs.annotated_data)\n        self.assertEqual(len(annotated), 150)\n        annotations = annotated.get_column_view(ANNOTATED_DATA_FEATURE_NAME)[0]\n        np.testing.assert_equal(annotations[:50], True)\n        np.testing.assert_equal(annotations[50:], False)\n\n    def test_change_var_type(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n\n        self.send_signal(self.widget.Inputs.data, iris)\n        self.widget.remove_all_button.click()\n        self.enterFilter(domain[0], \"is below\", \"5.2\")\n\n        var0vals = list({str(x) for x in iris.X[:, 0]})\n        new_domain = Domain(\n            (DiscreteVariable(domain[0].name, values=var0vals), )\n            + domain.attributes[1:],\n            domain.class_var)\n        new_iris = iris.transform(new_domain)\n        self.send_signal(self.widget.Inputs.data, new_iris)\n\n    # Uncomment this on 2022/2/2\n    #\n    # def test_migration_to_version_1(self):\n    #     iris = Table(\"iris\")\n    #\n    #     ch = SelectRowsContextHandler()\n    #     context = ch.new_context(iris.domain, *ch.encode_domain(iris.domain))\n    #     context.values = dict(conditions=[[\"petal length\", 2, (5.2,)]])\n    #     settings = dict(context_settings=[context])\n    #     widget = self.create_widget(OWSelectRows, settings)\n    #     self.assertEqual(widget.conditions, [])\n\n    @override_locale(QLocale.C)\n    def test_support_old_settings(self):\n        iris = Table(\"iris\")\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_end_support_for_version_1(self):\n        if time.gmtime() >= (2022, 2, 2):\n            self.fail(\"\"\"\nHappy 22/2/2!\n\nNow remove support for version==None settings in\nSelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nand uncomment OWSelectRows.migrate.\n\nIn tests, uncomment test_migration_to_version_1,\nand remove test_support_old_settings and this test.\n\nBasically, revert this commit.\n\"\"\")\n\n    def test_purge_discretized(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        widget = self.widget_with_context(domain, [[\"MEDV\", 2, (2, 3)]])\n        widget.purge_classes = True\n        self.send_signal(widget.Inputs.data, data)\n        out = self.get_output(widget.Outputs.matching_data)\n        expected = data.Y[(data.Y == 1) + (data.Y == 2)]\n        expected = (expected == 2).astype(float)\n        np.testing.assert_equal(out.Y, expected)\n\n    def widget_with_context(self, domain, conditions):\n        ch = SelectRowsContextHandler()\n        context = ch.new_context(domain, *ch.encode_domain(domain))\n        context.values = {\"conditions\": conditions,\n                          VERSION_KEY: OWSelectRows.settings_version}\n        settings = dict(context_settings=[context])\n\n        return self.create_widget(OWSelectRows, settings)\n\n    def enterFilter(self, variable, filter, value1=None, value2=None):\n        # pylint: disable=redefined-builtin\n        row = self.widget.cond_list.model().rowCount()\n        self.widget.add_button.click()\n\n        var_combo = self.widget.cond_list.cellWidget(row, 0)\n        simulate.combobox_activate_item(var_combo, variable.name, delay=0)\n\n        oper_combo = self.widget.cond_list.cellWidget(row, 1)\n        simulate.combobox_activate_item(oper_combo, filter, delay=0)\n\n        value_inputs = self.__get_value_widgets(row)\n        for i, value in enumerate([value1, value2]):\n            if value is None:\n                continue\n            self.__set_value(value_inputs[i], value)\n\n    def __get_value_widgets(self, row):\n        value_inputs = self.widget.cond_list.cellWidget(row, 2)\n        if value_inputs:\n            if isinstance(value_inputs, QComboBox):\n                value_inputs = [value_inputs]\n            else:\n                value_inputs = [\n                    w for w in value_inputs.children()\n                    if isinstance(w, QLineEdit)]\n        return value_inputs\n\n    @staticmethod\n    def __set_value(widget, value):\n        if isinstance(widget, QLineEdit):\n            QTest.mouseClick(widget, Qt.LeftButton)\n            QTest.keyClicks(widget, value, delay=0)\n            QTest.keyClick(widget, Qt.Key_Enter)\n        elif isinstance(widget, QComboBox):\n            simulate.combobox_activate_item(widget, value)\n        else:\n            raise ValueError(\"Unsupported widget {}\".format(widget))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 60,
                            "end_lineno": 377,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/data/tests/test_owselectrows.py",
                            "type": "method",
                            "name": "TestOWSelectRows.test_purge_discretized",
                            "content": "class TestOWSelectRows(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSelectRows)  # type: OWSelectRows\n\n    def test_filter_cont(self):\n        iris = Table(\"iris\")[::5]\n        self.widget.auto_commit = True\n        self.widget.set_data(iris)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[ContinuousVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, CFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_str(self):\n        zoo = Table(\"zoo\")[::5]\n        self.widget.auto_commit = False\n        self.widget.set_data(zoo)\n        for i, (op, _) in enumerate(OWSelectRows.Operators[StringVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, SFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_disc(self):\n        lenses = Table(test_filename(\"datasets/lenses.tab\"))\n        self.widget.auto_commit = False\n        self.widget.set_data(lenses)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[DiscreteVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(0, i, DFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    @override_locale(QLocale.C)  # Locale with decimal point\n    def test_continuous_filter_with_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # Validating with C locale should accept decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5.2\",))\n\n        # but not decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)  # Locale with decimal comma\n    def test_continuous_filter_with_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        # but not decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)\n    def test_stores_settings_in_invariant_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        context = self.widget.current_context\n        self.send_signal(self.widget.Inputs.data, None)\n        saved_condition = context.values[\"conditions\"][0]\n        self.assertEqual(saved_condition[3][0], 5.2)\n\n    @override_locale(QLocale.C)\n    def test_restores_continuous_filter_in_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n    @override_locale(QLocale.Slovenian)\n    def test_restores_continuous_filter_in_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n    @override_locale(QLocale.C)\n    def test_partial_matches(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n        self.widget = self.widget_with_context(\n            domain, [[domain[0].name, 2, (\"5.2\",)]])\n        iris2 = iris.transform(Domain(domain.attributes[:2], None))\n        self.send_signal(self.widget.Inputs.data, iris2)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_load_settings(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        sepal_length, sepal_width = iris.domain[:2]\n\n        self.widget.remove_all_button.click()\n        self.enterFilter(sepal_width, \"is below\", \"5.2\")\n        self.enterFilter(sepal_length, \"is at most\", \"4\")\n        data = self.widget.settingsHandler.pack_data(self.widget)\n\n        w2 = self.create_widget(OWSelectRows, data)\n        self.send_signal(self.widget.Inputs.data, iris, widget=w2)\n\n        var_combo = w2.cond_list.cellWidget(0, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal width\")\n        oper_combo = w2.cond_list.cellWidget(0, 1)\n        self.assertEqual(oper_combo.currentText(), \"is below\")\n\n        var_combo = w2.cond_list.cellWidget(1, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal length\")\n        oper_combo = w2.cond_list.cellWidget(1, 1)\n        self.assertEqual(oper_combo.currentText(), \"is at most\")\n\n    def test_is_defined_on_continuous_variable(self):\n        # gh-2054 regression\n\n        data = Table(datasets.path(\"testing_dataset_cls\"))\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[\"c2\"], \"is defined\")\n        self.assertFalse(self.widget.Error.parsing_error.is_shown())\n        self.assertEqual(len(self.get_output(\"Matching Data\")), 3)\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), 1)\n        self.assertEqual(len(self.get_output(\"Data\")), len(data))\n\n        # Test saving of settings\n        self.widget.settingsHandler.pack_data(self.widget)\n\n    def test_output_filter(self):\n        \"\"\"\n        None on output when there is no data.\n        GH-2726\n        \"\"\"\n        data = Table(\"iris\")[:10]\n        len_data = len(data)\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[0], \"is below\", \"-1\")\n        self.assertIsNone(self.get_output(\"Matching Data\"))\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n        self.widget.remove_all_button.click()\n        self.enterFilter(data.domain[0], \"is below\", \"10\")\n        self.assertIsNone(self.get_output(\"Unmatched Data\"))\n        self.assertEqual(len(self.get_output(\"Matching Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n\n    def test_annotated_data(self):\n        iris = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        self.enterFilter(iris.domain[\"iris\"], \"is\", \"Iris-setosa\")\n\n        annotated = self.get_output(self.widget.Outputs.annotated_data)\n        self.assertEqual(len(annotated), 150)\n        annotations = annotated.get_column_view(ANNOTATED_DATA_FEATURE_NAME)[0]\n        np.testing.assert_equal(annotations[:50], True)\n        np.testing.assert_equal(annotations[50:], False)\n\n    def test_change_var_type(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n\n        self.send_signal(self.widget.Inputs.data, iris)\n        self.widget.remove_all_button.click()\n        self.enterFilter(domain[0], \"is below\", \"5.2\")\n\n        var0vals = list({str(x) for x in iris.X[:, 0]})\n        new_domain = Domain(\n            (DiscreteVariable(domain[0].name, values=var0vals), )\n            + domain.attributes[1:],\n            domain.class_var)\n        new_iris = iris.transform(new_domain)\n        self.send_signal(self.widget.Inputs.data, new_iris)\n\n    # Uncomment this on 2022/2/2\n    #\n    # def test_migration_to_version_1(self):\n    #     iris = Table(\"iris\")\n    #\n    #     ch = SelectRowsContextHandler()\n    #     context = ch.new_context(iris.domain, *ch.encode_domain(iris.domain))\n    #     context.values = dict(conditions=[[\"petal length\", 2, (5.2,)]])\n    #     settings = dict(context_settings=[context])\n    #     widget = self.create_widget(OWSelectRows, settings)\n    #     self.assertEqual(widget.conditions, [])\n\n    @override_locale(QLocale.C)\n    def test_support_old_settings(self):\n        iris = Table(\"iris\")\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_end_support_for_version_1(self):\n        if time.gmtime() >= (2022, 2, 2):\n            self.fail(\"\"\"\nHappy 22/2/2!\n\nNow remove support for version==None settings in\nSelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nand uncomment OWSelectRows.migrate.\n\nIn tests, uncomment test_migration_to_version_1,\nand remove test_support_old_settings and this test.\n\nBasically, revert this commit.\n\"\"\")\n\n    def test_purge_discretized(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        widget = self.widget_with_context(domain, [[\"MEDV\", 2, (2, 3)]])\n        widget.purge_classes = True\n        self.send_signal(widget.Inputs.data, data)\n        out = self.get_output(widget.Outputs.matching_data)\n        expected = data.Y[(data.Y == 1) + (data.Y == 2)]\n        expected = (expected == 2).astype(float)\n        np.testing.assert_equal(out.Y, expected)\n\n    def widget_with_context(self, domain, conditions):\n        ch = SelectRowsContextHandler()\n        context = ch.new_context(domain, *ch.encode_domain(domain))\n        context.values = {\"conditions\": conditions,\n                          VERSION_KEY: OWSelectRows.settings_version}\n        settings = dict(context_settings=[context])\n\n        return self.create_widget(OWSelectRows, settings)\n\n    def enterFilter(self, variable, filter, value1=None, value2=None):\n        # pylint: disable=redefined-builtin\n        row = self.widget.cond_list.model().rowCount()\n        self.widget.add_button.click()\n\n        var_combo = self.widget.cond_list.cellWidget(row, 0)\n        simulate.combobox_activate_item(var_combo, variable.name, delay=0)\n\n        oper_combo = self.widget.cond_list.cellWidget(row, 1)\n        simulate.combobox_activate_item(oper_combo, filter, delay=0)\n\n        value_inputs = self.__get_value_widgets(row)\n        for i, value in enumerate([value1, value2]):\n            if value is None:\n                continue\n            self.__set_value(value_inputs[i], value)\n\n    def __get_value_widgets(self, row):\n        value_inputs = self.widget.cond_list.cellWidget(row, 2)\n        if value_inputs:\n            if isinstance(value_inputs, QComboBox):\n                value_inputs = [value_inputs]\n            else:\n                value_inputs = [\n                    w for w in value_inputs.children()\n                    if isinstance(w, QLineEdit)]\n        return value_inputs\n\n    @staticmethod\n    def __set_value(widget, value):\n        if isinstance(widget, QLineEdit):\n            QTest.mouseClick(widget, Qt.LeftButton)\n            QTest.keyClicks(widget, value, delay=0)\n            QTest.keyClick(widget, Qt.Key_Enter)\n        elif isinstance(widget, QComboBox):\n            simulate.combobox_activate_item(widget, value)\n        else:\n            raise ValueError(\"Unsupported widget {}\".format(widget))",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 316,
                            "end_lineno": 329,
                            "parent": {
                                "file_name": "Orange/widgets/data/tests/test_owselectrows.py",
                                "type": "class",
                                "name": "TestOWSelectRows",
                                "content": "class TestOWSelectRows(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSelectRows)  # type: OWSelectRows\n\n    def test_filter_cont(self):\n        iris = Table(\"iris\")[::5]\n        self.widget.auto_commit = True\n        self.widget.set_data(iris)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[ContinuousVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, CFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_str(self):\n        zoo = Table(\"zoo\")[::5]\n        self.widget.auto_commit = False\n        self.widget.set_data(zoo)\n        for i, (op, _) in enumerate(OWSelectRows.Operators[StringVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, SFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_disc(self):\n        lenses = Table(test_filename(\"datasets/lenses.tab\"))\n        self.widget.auto_commit = False\n        self.widget.set_data(lenses)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[DiscreteVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(0, i, DFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    @override_locale(QLocale.C)  # Locale with decimal point\n    def test_continuous_filter_with_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # Validating with C locale should accept decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5.2\",))\n\n        # but not decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)  # Locale with decimal comma\n    def test_continuous_filter_with_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        # but not decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)\n    def test_stores_settings_in_invariant_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        context = self.widget.current_context\n        self.send_signal(self.widget.Inputs.data, None)\n        saved_condition = context.values[\"conditions\"][0]\n        self.assertEqual(saved_condition[3][0], 5.2)\n\n    @override_locale(QLocale.C)\n    def test_restores_continuous_filter_in_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n    @override_locale(QLocale.Slovenian)\n    def test_restores_continuous_filter_in_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n    @override_locale(QLocale.C)\n    def test_partial_matches(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n        self.widget = self.widget_with_context(\n            domain, [[domain[0].name, 2, (\"5.2\",)]])\n        iris2 = iris.transform(Domain(domain.attributes[:2], None))\n        self.send_signal(self.widget.Inputs.data, iris2)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_load_settings(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        sepal_length, sepal_width = iris.domain[:2]\n\n        self.widget.remove_all_button.click()\n        self.enterFilter(sepal_width, \"is below\", \"5.2\")\n        self.enterFilter(sepal_length, \"is at most\", \"4\")\n        data = self.widget.settingsHandler.pack_data(self.widget)\n\n        w2 = self.create_widget(OWSelectRows, data)\n        self.send_signal(self.widget.Inputs.data, iris, widget=w2)\n\n        var_combo = w2.cond_list.cellWidget(0, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal width\")\n        oper_combo = w2.cond_list.cellWidget(0, 1)\n        self.assertEqual(oper_combo.currentText(), \"is below\")\n\n        var_combo = w2.cond_list.cellWidget(1, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal length\")\n        oper_combo = w2.cond_list.cellWidget(1, 1)\n        self.assertEqual(oper_combo.currentText(), \"is at most\")\n\n    def test_is_defined_on_continuous_variable(self):\n        # gh-2054 regression\n\n        data = Table(datasets.path(\"testing_dataset_cls\"))\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[\"c2\"], \"is defined\")\n        self.assertFalse(self.widget.Error.parsing_error.is_shown())\n        self.assertEqual(len(self.get_output(\"Matching Data\")), 3)\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), 1)\n        self.assertEqual(len(self.get_output(\"Data\")), len(data))\n\n        # Test saving of settings\n        self.widget.settingsHandler.pack_data(self.widget)\n\n    def test_output_filter(self):\n        \"\"\"\n        None on output when there is no data.\n        GH-2726\n        \"\"\"\n        data = Table(\"iris\")[:10]\n        len_data = len(data)\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[0], \"is below\", \"-1\")\n        self.assertIsNone(self.get_output(\"Matching Data\"))\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n        self.widget.remove_all_button.click()\n        self.enterFilter(data.domain[0], \"is below\", \"10\")\n        self.assertIsNone(self.get_output(\"Unmatched Data\"))\n        self.assertEqual(len(self.get_output(\"Matching Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n\n    def test_annotated_data(self):\n        iris = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        self.enterFilter(iris.domain[\"iris\"], \"is\", \"Iris-setosa\")\n\n        annotated = self.get_output(self.widget.Outputs.annotated_data)\n        self.assertEqual(len(annotated), 150)\n        annotations = annotated.get_column_view(ANNOTATED_DATA_FEATURE_NAME)[0]\n        np.testing.assert_equal(annotations[:50], True)\n        np.testing.assert_equal(annotations[50:], False)\n\n    def test_change_var_type(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n\n        self.send_signal(self.widget.Inputs.data, iris)\n        self.widget.remove_all_button.click()\n        self.enterFilter(domain[0], \"is below\", \"5.2\")\n\n        var0vals = list({str(x) for x in iris.X[:, 0]})\n        new_domain = Domain(\n            (DiscreteVariable(domain[0].name, values=var0vals), )\n            + domain.attributes[1:],\n            domain.class_var)\n        new_iris = iris.transform(new_domain)\n        self.send_signal(self.widget.Inputs.data, new_iris)\n\n    # Uncomment this on 2022/2/2\n    #\n    # def test_migration_to_version_1(self):\n    #     iris = Table(\"iris\")\n    #\n    #     ch = SelectRowsContextHandler()\n    #     context = ch.new_context(iris.domain, *ch.encode_domain(iris.domain))\n    #     context.values = dict(conditions=[[\"petal length\", 2, (5.2,)]])\n    #     settings = dict(context_settings=[context])\n    #     widget = self.create_widget(OWSelectRows, settings)\n    #     self.assertEqual(widget.conditions, [])\n\n    @override_locale(QLocale.C)\n    def test_support_old_settings(self):\n        iris = Table(\"iris\")\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_end_support_for_version_1(self):\n        if time.gmtime() >= (2022, 2, 2):\n            self.fail(\"\"\"\nHappy 22/2/2!\n\nNow remove support for version==None settings in\nSelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nand uncomment OWSelectRows.migrate.\n\nIn tests, uncomment test_migration_to_version_1,\nand remove test_support_old_settings and this test.\n\nBasically, revert this commit.\n\"\"\")\n\n    def test_purge_discretized(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        widget = self.widget_with_context(domain, [[\"MEDV\", 2, (2, 3)]])\n        widget.purge_classes = True\n        self.send_signal(widget.Inputs.data, data)\n        out = self.get_output(widget.Outputs.matching_data)\n        expected = data.Y[(data.Y == 1) + (data.Y == 2)]\n        expected = (expected == 2).astype(float)\n        np.testing.assert_equal(out.Y, expected)\n\n    def widget_with_context(self, domain, conditions):\n        ch = SelectRowsContextHandler()\n        context = ch.new_context(domain, *ch.encode_domain(domain))\n        context.values = {\"conditions\": conditions,\n                          VERSION_KEY: OWSelectRows.settings_version}\n        settings = dict(context_settings=[context])\n\n        return self.create_widget(OWSelectRows, settings)\n\n    def enterFilter(self, variable, filter, value1=None, value2=None):\n        # pylint: disable=redefined-builtin\n        row = self.widget.cond_list.model().rowCount()\n        self.widget.add_button.click()\n\n        var_combo = self.widget.cond_list.cellWidget(row, 0)\n        simulate.combobox_activate_item(var_combo, variable.name, delay=0)\n\n        oper_combo = self.widget.cond_list.cellWidget(row, 1)\n        simulate.combobox_activate_item(oper_combo, filter, delay=0)\n\n        value_inputs = self.__get_value_widgets(row)\n        for i, value in enumerate([value1, value2]):\n            if value is None:\n                continue\n            self.__set_value(value_inputs[i], value)\n\n    def __get_value_widgets(self, row):\n        value_inputs = self.widget.cond_list.cellWidget(row, 2)\n        if value_inputs:\n            if isinstance(value_inputs, QComboBox):\n                value_inputs = [value_inputs]\n            else:\n                value_inputs = [\n                    w for w in value_inputs.children()\n                    if isinstance(w, QLineEdit)]\n        return value_inputs\n\n    @staticmethod\n    def __set_value(widget, value):\n        if isinstance(widget, QLineEdit):\n            QTest.mouseClick(widget, Qt.LeftButton)\n            QTest.keyClicks(widget, value, delay=0)\n            QTest.keyClick(widget, Qt.Key_Enter)\n        elif isinstance(widget, QComboBox):\n            simulate.combobox_activate_item(widget, value)\n        else:\n            raise ValueError(\"Unsupported widget {}\".format(widget))",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 60,
                                "end_lineno": 377,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "fd0c090a76bd2e4baba87e2df253a480b85660c7^",
    "new_commit_hash": "fd0c090a76bd2e4baba87e2df253a480b85660c7",
    "commit_message": "Orange.preprocess.remove.remove_unused_values: Fix compute_value",
    "commit_date": "2020-02-17T13:10:33+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "fd0c090a76bd2e4baba87e2df253a480b85660c7",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport unittest\n\nimport numpy as np\n\nfrom Orange.data import Table\nfrom Orange.preprocess import Remove, discretize\nfrom Orange.tests import test_filename\n\n\nclass TestRemover(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        cls.test8 = Table(test_filename('datasets/test8.tab'))\n\n    def test_remove(self):\n        data = Table(\"iris\")[:5]\n        attr_flags = sum([Remove.SortValues,\n                          Remove.RemoveConstant,\n                          Remove.RemoveUnusedValues])\n        class_flags = sum([Remove.SortValues,\n                           Remove.RemoveConstant,\n                           Remove.RemoveUnusedValues])\n        remover = Remove(attr_flags, class_flags)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"sepal length\", \"sepal width\", \"petal length\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars], [])\n        self.assertDictEqual(attr_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 1, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_attr(self):\n        data = self.test8\n        remover = Remove(Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, np.hstack((data[:, 1],\n                                                       data[:, 3])))\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c0\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_constant_class(self):\n        data = self.test8\n        remover = Remove(class_flags=Remove.RemoveConstant)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, np.hstack((data[:, 4],\n                                                       data[:, 5])))\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 2, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_attr(self):\n        data = self.test8\n        data = data[1:]\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        np.testing.assert_equal(new_data.X, data.X)\n        np.testing.assert_equal(new_data.Y, data.Y)\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n\n    def test_remove_unused_values_class(self):\n        data = self.test8\n        data = data[:2]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res, class_res = remover.attr_results, remover.class_results\n\n        for i in range(len(data)):\n            for j in range(len(data[i])):\n                self.assertEqual(new_data[i, j], data[i, j])\n\n        self.assertEqual([a.name for a in new_data.domain.attributes],\n                         [\"c1\", \"c0\", \"d1\", \"d0\"])\n        self.assertEqual([c.name for c in new_data.domain.class_vars],\n                         [\"cl1\", \"cl0\", \"cl3\", \"cl4\"])\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4', '6']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 0, 'sorted': 0})\n        self.assertDictEqual(class_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_unused_values_metas(self):\n        data = Table(test_filename(\"datasets/test9.tab\"))\n        subset = data[:4]\n        res = Remove(attr_flags=Remove.RemoveUnusedValues,\n                     meta_flags=Remove.RemoveUnusedValues)(subset)\n\n        self.assertEqual(res.domain[\"b\"].values, res.domain[\"c\"].values)\n        self.assertEqual(res.domain[\"d\"].values, [\"1\", \"2\"])\n        self.assertEqual(res.domain[\"f\"].values, ['1', 'hey'])\n\n    def test_remove_unused_values_attr_sparse(self):\n        data = self.test8\n        data = data[1:].to_sparse()\n        remover = Remove(Remove.RemoveUnusedValues)\n        new_data = remover(data)\n        attr_res = remover.attr_results\n\n        self.assertEqual((new_data.X != data.X).nnz, 0)\n        self.assertEqual([a.values for a in new_data.domain.attributes\n                          if a.is_discrete], [['1'], ['4']])\n        self.assertEqual([c.values for c in new_data.domain.class_vars\n                          if c.is_discrete], [['1', '2', '3'], ['2']])\n        self.assertDictEqual(attr_res,\n                             {'removed': 0, 'reduced': 1, 'sorted': 0})\n\n    def test_remove_mapping(self):\n        data = Table(\"iris\")\n        x = np.vstack((data.X[:50], data.X[100:]))\n        y = np.hstack((data.Y[:50], data.Y[100:]))\n        data = Table.from_numpy(data.domain, x, y)\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_array_equal(cleaned.Y[:50], 0)\n        np.testing.assert_array_equal(cleaned.Y[50:], 1)\n\n    def test_remove_mapping_after_compute_value(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        val12 = np.nonzero(data.Y > 0)[0]\n        data = data[val12]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n        np.testing.assert_equal(cleaned.Y, data.Y - 1)\n",
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nimport time\n\nfrom AnyQt.QtCore import QLocale, Qt\nfrom AnyQt.QtTest import QTest\nfrom AnyQt.QtWidgets import QLineEdit, QComboBox\n\nimport numpy as np\n\nfrom Orange.data import (\n    Table, ContinuousVariable, StringVariable, DiscreteVariable, Domain)\nfrom Orange.preprocess import discretize\nfrom Orange.widgets.data.owselectrows import (\n    OWSelectRows, FilterDiscreteType, SelectRowsContextHandler)\nfrom Orange.widgets.tests.base import WidgetTest, datasets\n\nfrom Orange.data.filter import FilterContinuous, FilterString\nfrom Orange.widgets.tests.utils import simulate, override_locale\nfrom Orange.widgets.utils.annotated_data import ANNOTATED_DATA_FEATURE_NAME\nfrom Orange.tests import test_filename\nfrom orangewidget.settings import VERSION_KEY\n\nCFValues = {\n    FilterContinuous.Equal: [\"5.4\"],\n    FilterContinuous.NotEqual: [\"5.4\"],\n    FilterContinuous.Less: [\"5.4\"],\n    FilterContinuous.LessEqual: [\"5.4\"],\n    FilterContinuous.Greater: [\"5.4\"],\n    FilterContinuous.GreaterEqual: [\"5.4\"],\n    FilterContinuous.Between: [\"5.4\", \"6.0\"],\n    FilterContinuous.Outside: [\"5.4\", \"6.0\"],\n    FilterContinuous.IsDefined: [],\n}\n\n\nSFValues = {\n    FilterString.Equal: [\"aardwark\"],\n    FilterString.NotEqual: [\"aardwark\"],\n    FilterString.Less: [\"aardwark\"],\n    FilterString.LessEqual: [\"aardwark\"],\n    FilterString.Greater: [\"aardwark\"],\n    FilterString.GreaterEqual: [\"aardwark\"],\n    FilterString.Between: [\"aardwark\", \"cat\"],\n    FilterString.Outside: [\"aardwark\"],\n    FilterString.Contains: [\"aa\"],\n    FilterString.StartsWith: [\"aa\"],\n    FilterString.EndsWith: [\"ark\"],\n    FilterString.IsDefined: []\n}\n\nDFValues = {\n    FilterDiscreteType.Equal: [0],\n    FilterDiscreteType.NotEqual: [0],\n    FilterDiscreteType.In: [0, 1],\n    FilterDiscreteType.IsDefined: [],\n}\n\n\nclass TestOWSelectRows(WidgetTest):\n    def setUp(self):\n        self.widget = self.create_widget(OWSelectRows)  # type: OWSelectRows\n\n    def test_filter_cont(self):\n        iris = Table(\"iris\")[::5]\n        self.widget.auto_commit = True\n        self.widget.set_data(iris)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[ContinuousVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, CFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_str(self):\n        zoo = Table(\"zoo\")[::5]\n        self.widget.auto_commit = False\n        self.widget.set_data(zoo)\n        for i, (op, _) in enumerate(OWSelectRows.Operators[StringVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(1, i, SFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    def test_filter_disc(self):\n        lenses = Table(test_filename(\"datasets/lenses.tab\"))\n        self.widget.auto_commit = False\n        self.widget.set_data(lenses)\n\n        for i, (op, _) in enumerate(OWSelectRows.Operators[DiscreteVariable]):\n            self.widget.remove_all()\n            self.widget.add_row(0, i, DFValues[op])\n            self.widget.conditions_changed()\n            self.widget.unconditional_commit()\n\n    @override_locale(QLocale.C)  # Locale with decimal point\n    def test_continuous_filter_with_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # Validating with C locale should accept decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5.2\",))\n\n        # but not decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)  # Locale with decimal comma\n    def test_continuous_filter_with_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        # but not decimal point\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5.2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"52\",))\n\n    @override_locale(QLocale.Slovenian)\n    def test_stores_settings_in_invariant_locale(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        # sl_SI locale should accept decimal comma\n        self.widget.remove_all_button.click()\n        self.enterFilter(iris.domain[2], \"is below\", \"5,2\")\n        self.assertEqual(self.widget.conditions[0][2], (\"5,2\",))\n\n        context = self.widget.current_context\n        self.send_signal(self.widget.Inputs.data, None)\n        saved_condition = context.values[\"conditions\"][0]\n        self.assertEqual(saved_condition[3][0], 5.2)\n\n    @override_locale(QLocale.C)\n    def test_restores_continuous_filter_in_c_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5.2\"))\n\n    @override_locale(QLocale.Slovenian)\n    def test_restores_continuous_filter_in_sl_SI_locale(self):\n        iris = Table(\"iris\")[:5]\n        # Settings with string value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n        # Settings with float value\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 102, 2, (5.2,)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        values = self.widget.conditions[0][2]\n        self.assertTrue(values[0].startswith(\"5,2\"))\n\n    @override_locale(QLocale.C)\n    def test_partial_matches(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n        self.widget = self.widget_with_context(\n            domain, [[domain[0].name, 2, (\"5.2\",)]])\n        iris2 = iris.transform(Domain(domain.attributes[:2], None))\n        self.send_signal(self.widget.Inputs.data, iris2)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_load_settings(self):\n        iris = Table(\"iris\")[:5]\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        sepal_length, sepal_width = iris.domain[:2]\n\n        self.widget.remove_all_button.click()\n        self.enterFilter(sepal_width, \"is below\", \"5.2\")\n        self.enterFilter(sepal_length, \"is at most\", \"4\")\n        data = self.widget.settingsHandler.pack_data(self.widget)\n\n        w2 = self.create_widget(OWSelectRows, data)\n        self.send_signal(self.widget.Inputs.data, iris, widget=w2)\n\n        var_combo = w2.cond_list.cellWidget(0, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal width\")\n        oper_combo = w2.cond_list.cellWidget(0, 1)\n        self.assertEqual(oper_combo.currentText(), \"is below\")\n\n        var_combo = w2.cond_list.cellWidget(1, 0)\n        self.assertEqual(var_combo.currentText(), \"sepal length\")\n        oper_combo = w2.cond_list.cellWidget(1, 1)\n        self.assertEqual(oper_combo.currentText(), \"is at most\")\n\n    def test_is_defined_on_continuous_variable(self):\n        # gh-2054 regression\n\n        data = Table(datasets.path(\"testing_dataset_cls\"))\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[\"c2\"], \"is defined\")\n        self.assertFalse(self.widget.Error.parsing_error.is_shown())\n        self.assertEqual(len(self.get_output(\"Matching Data\")), 3)\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), 1)\n        self.assertEqual(len(self.get_output(\"Data\")), len(data))\n\n        # Test saving of settings\n        self.widget.settingsHandler.pack_data(self.widget)\n\n    def test_output_filter(self):\n        \"\"\"\n        None on output when there is no data.\n        GH-2726\n        \"\"\"\n        data = Table(\"iris\")[:10]\n        len_data = len(data)\n        self.send_signal(self.widget.Inputs.data, data)\n\n        self.enterFilter(data.domain[0], \"is below\", \"-1\")\n        self.assertIsNone(self.get_output(\"Matching Data\"))\n        self.assertEqual(len(self.get_output(\"Unmatched Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n        self.widget.remove_all_button.click()\n        self.enterFilter(data.domain[0], \"is below\", \"10\")\n        self.assertIsNone(self.get_output(\"Unmatched Data\"))\n        self.assertEqual(len(self.get_output(\"Matching Data\")), len_data)\n        self.assertEqual(len(self.get_output(\"Data\")), len_data)\n\n    def test_annotated_data(self):\n        iris = Table(\"iris\")\n        self.send_signal(self.widget.Inputs.data, iris)\n\n        self.enterFilter(iris.domain[\"iris\"], \"is\", \"Iris-setosa\")\n\n        annotated = self.get_output(self.widget.Outputs.annotated_data)\n        self.assertEqual(len(annotated), 150)\n        annotations = annotated.get_column_view(ANNOTATED_DATA_FEATURE_NAME)[0]\n        np.testing.assert_equal(annotations[:50], True)\n        np.testing.assert_equal(annotations[50:], False)\n\n    def test_change_var_type(self):\n        iris = Table(\"iris\")\n        domain = iris.domain\n\n        self.send_signal(self.widget.Inputs.data, iris)\n        self.widget.remove_all_button.click()\n        self.enterFilter(domain[0], \"is below\", \"5.2\")\n\n        var0vals = list({str(x) for x in iris.X[:, 0]})\n        new_domain = Domain(\n            (DiscreteVariable(domain[0].name, values=var0vals), )\n            + domain.attributes[1:],\n            domain.class_var)\n        new_iris = iris.transform(new_domain)\n        self.send_signal(self.widget.Inputs.data, new_iris)\n\n    # Uncomment this on 2022/2/2\n    #\n    # def test_migration_to_version_1(self):\n    #     iris = Table(\"iris\")\n    #\n    #     ch = SelectRowsContextHandler()\n    #     context = ch.new_context(iris.domain, *ch.encode_domain(iris.domain))\n    #     context.values = dict(conditions=[[\"petal length\", 2, (5.2,)]])\n    #     settings = dict(context_settings=[context])\n    #     widget = self.create_widget(OWSelectRows, settings)\n    #     self.assertEqual(widget.conditions, [])\n\n    @override_locale(QLocale.C)\n    def test_support_old_settings(self):\n        iris = Table(\"iris\")\n        self.widget = self.widget_with_context(\n            iris.domain, [[\"sepal length\", 2, (\"5.2\",)]])\n        self.send_signal(self.widget.Inputs.data, iris)\n        condition = self.widget.conditions[0]\n        self.assertEqual(condition[0], \"sepal length\")\n        self.assertEqual(condition[1], 2)\n        self.assertTrue(condition[2][0].startswith(\"5.2\"))\n\n    def test_end_support_for_version_1(self):\n        if time.gmtime() >= (2022, 2, 2):\n            self.fail(\"\"\"\nHappy 22/2/2!\n\nNow remove support for version==None settings in\nSelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nand uncomment OWSelectRows.migrate.\n\nIn tests, uncomment test_migration_to_version_1,\nand remove test_support_old_settings and this test.\n\nBasically, revert this commit.\n\"\"\")\n\n    def test_purge_discretized(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        widget = self.widget_with_context(domain, [[\"MEDV\", 2, (2, 3)]])\n        widget.purge_classes = True\n        self.send_signal(widget.Inputs.data, data)\n        out = self.get_output(widget.Outputs.matching_data)\n        expected = data.Y[(data.Y == 1) + (data.Y == 2)]\n        expected = (expected == 2).astype(float)\n        np.testing.assert_equal(out.Y, expected)\n\n    def widget_with_context(self, domain, conditions):\n        ch = SelectRowsContextHandler()\n        context = ch.new_context(domain, *ch.encode_domain(domain))\n        context.values = {\"conditions\": conditions,\n                          VERSION_KEY: OWSelectRows.settings_version}\n        settings = dict(context_settings=[context])\n\n        return self.create_widget(OWSelectRows, settings)\n\n    def enterFilter(self, variable, filter, value1=None, value2=None):\n        # pylint: disable=redefined-builtin\n        row = self.widget.cond_list.model().rowCount()\n        self.widget.add_button.click()\n\n        var_combo = self.widget.cond_list.cellWidget(row, 0)\n        simulate.combobox_activate_item(var_combo, variable.name, delay=0)\n\n        oper_combo = self.widget.cond_list.cellWidget(row, 1)\n        simulate.combobox_activate_item(oper_combo, filter, delay=0)\n\n        value_inputs = self.__get_value_widgets(row)\n        for i, value in enumerate([value1, value2]):\n            if value is None:\n                continue\n            self.__set_value(value_inputs[i], value)\n\n    def __get_value_widgets(self, row):\n        value_inputs = self.widget.cond_list.cellWidget(row, 2)\n        if value_inputs:\n            if isinstance(value_inputs, QComboBox):\n                value_inputs = [value_inputs]\n            else:\n                value_inputs = [\n                    w for w in value_inputs.children()\n                    if isinstance(w, QLineEdit)]\n        return value_inputs\n\n    @staticmethod\n    def __set_value(widget, value):\n        if isinstance(widget, QLineEdit):\n            QTest.mouseClick(widget, Qt.LeftButton)\n            QTest.keyClicks(widget, value, delay=0)\n            QTest.keyClick(widget, Qt.Key_Enter)\n        elif isinstance(widget, QComboBox):\n            simulate.combobox_activate_item(widget, value)\n        else:\n            raise ValueError(\"Unsupported widget {}\".format(widget))\n"
    ],
    "test_file_names": [
        "test_1.py",
        "test_2.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\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/tmp1q48zcya/tmp\ncreating /tmp/tmp1q48zcya/tmp/tmp1q48zcya\ncompile options: '-MMD -MF /tmp/tmp1q48zcya/file.c.d -c'\ncc: /tmp/tmp1q48zcya/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/tmpsbw_16fu/tmp\ncreating /tmp/tmpsbw_16fu/tmp/tmpsbw_16fu\ncompile options: '-MMD -MF /tmp/tmpsbw_16fu/file.c.d -c'\ncc: /tmp/tmpsbw_16fu/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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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/tmpoz34j2wc/tmp\ncreating /tmp/tmpoz34j2wc/tmp/tmpoz34j2wc\ncompile options: '-MMD -MF /tmp/tmpoz34j2wc/file.c.d -c'\ncc: /tmp/tmpoz34j2wc/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/tmpzopm1yu1/tmp\ncreating /tmp/tmpzopm1yu1/tmp/tmpzopm1yu1\ncompile options: '-MMD -MF /tmp/tmpzopm1yu1/file.c.d -c'\ncc: /tmp/tmpzopm1yu1/file.c\ncustomize UnixCCompiler using build_ext\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.25.0.dev0+fd0c090 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7\nProcessing dependencies for Orange3==3.25.0.dev0+fd0c090\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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.10.0\nBest match: pyqtgraph 0.10.0\nAdding pyqtgraph 0.10.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.25.0.dev0+fd0c090\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 104ms\nPrepared 18 packages in 29ms\nInstalled 18 packages in 266ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 48 packages in 267ms\nInstalled 42 packages in 927ms\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 34 packages in 59ms\nInstalled 13 packages in 35ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + platformdirs==4.0.0\n + pyqtgraph==0.10.0\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 3ms\nInstalled 2 packages in 29ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nAudited 1 package in 1ms\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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7/.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_fd0c090a76bd2e4baba87e2df253a480b85660c7\ncollected 34 items\n\nr2e_tests/test_1.py E.........                                           [ 29%]\nr2e_tests/test_2.py sssE....F...............                             [100%]\n\n==================================== ERRORS ====================================\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py, line 65\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py:65\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py, line 65\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py:65\n=================================== FAILURES ===================================\n_______________ TestOWSelectRows.test_end_support_for_version_1 ________________\n\nself = <r2e_tests.test_2.TestOWSelectRows testMethod=test_end_support_for_version_1>\n\n        def test_end_support_for_version_1(self):\n            if time.gmtime() >= (2022, 2, 2):\n                self.fail(\"\"\"\n    Happy 22/2/2!\n    \n    Now remove support for version==None settings in\n    SelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\n    and uncomment OWSelectRows.migrate.\n    \n    In tests, uncomment test_migration_to_version_1,\n    and remove test_support_old_settings and this test.\n    \n    Basically, revert this commit.\n>   \"\"\")\nE   AssertionError: \nE   Happy 22/2/2!\nE   \nE   Now remove support for version==None settings in\nE   SelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nE   and uncomment OWSelectRows.migrate.\nE   \nE   In tests, uncomment test_migration_to_version_1,\nE   and remove test_support_old_settings and this test.\nE   \nE   Basically, revert this commit.\n\nr2e_tests/test_2.py:314: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestRemover::test_remove\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_constant_attr\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_constant_class\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_mapping\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_mapping_after_compute_value\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_attr\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_attr_sparse\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_class\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_metas\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_annotated_data\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_change_var_type\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_continuous_filter_with_c_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_continuous_filter_with_sl_SI_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_filter_cont\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_filter_disc\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_filter_str\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_image_export\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_is_defined_on_continuous_variable\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_load_settings\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_minimum_size\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_output_filter\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_partial_matches\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_purge_discretized\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_restores_continuous_filter_in_c_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_restores_continuous_filter_in_sl_SI_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_stores_settings_in_invariant_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_support_old_settings\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\nERROR r2e_tests/test_1.py::test_filename\nERROR r2e_tests/test_2.py::test_filename\nFAILED r2e_tests/test_2.py::TestOWSelectRows::test_end_support_for_version_1\n============== 1 failed, 28 passed, 3 skipped, 2 errors in 3.87s ===============\nWidgets left: 0    Max widgets: 2308 \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_fd0c090a76bd2e4baba87e2df253a480b85660c7\ncollected 34 items\n\nr2e_tests/test_1.py E....F....                                           [ 29%]\nr2e_tests/test_2.py sssE....F..........F....                             [100%]\n\n==================================== ERRORS ====================================\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py, line 65\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py:65\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py, line 65\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_fd0c090a76bd2e4baba87e2df253a480b85660c7/Orange/tests/__init__.py:65\n=================================== FAILURES ===================================\n_____________ TestRemover.test_remove_mapping_after_compute_value ______________\n\nself = <r2e_tests.test_1.TestRemover testMethod=test_remove_mapping_after_compute_value>\n\n    def test_remove_mapping_after_compute_value(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        val12 = np.nonzero(data.Y > 0)[0]\n        data = data[val12]\n        remover = Remove(class_flags=Remove.RemoveUnusedValues)\n        cleaned = remover(data)\n>       np.testing.assert_equal(cleaned.Y, data.Y - 1)\n\nr2e_tests/test_1.py:175: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nx = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n       nan, nan, nan, nan, nan, nan, nan, nan,..., nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan])\ny = array([1., 0., 1., 1., 1., 1., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n       0., 0., 0., 1., 1., 1., 1., 1., 1., ...0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 1., 1., 0.,\n       0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 1., 0.])\nfunc = <ufunc 'isnan'>, hasval = 'nan'\n\n    def func_assert_same_pos(x, y, func=isnan, hasval='nan'):\n        \"\"\"Handling nan/inf.\n    \n        Combine results of running func on x and y, checking that they are True\n        at the same locations.\n    \n        \"\"\"\n        x_id = func(x)\n        y_id = func(y)\n        # We include work-arounds here to handle three types of slightly\n        # pathological ndarray subclasses:\n        # (1) all() on `masked` array scalars can return masked arrays, so we\n        #     use != True\n        # (2) __eq__ on some ndarray subclasses returns Python booleans\n        #     instead of element-wise comparisons, so we cast to bool_() and\n        #     use isinstance(..., bool) checks\n        # (3) subclasses with bare-bones __array_function__ implementations may\n        #     not implement np.all(), so favor using the .all() method\n        # We are not committed to supporting such subclasses, but it's nice to\n        # support them if possible.\n        if bool_(x_id == y_id).all() != True:\n            msg = build_err_msg([x, y],\n                                err_msg + '\\nx and y %s location mismatch:'\n                                % (hasval), verbose=verbose, header=header,\n                                names=('x', 'y'), precision=precision)\n>           raise AssertionError(msg)\nE           AssertionError: \nE           Arrays are not equal\nE           \nE           x and y nan location mismatch:\nE            x: array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\nE                  nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\nE                  nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,...\nE            y: array([1., 0., 1., 1., 1., 1., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\nE                  0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 1., 0.,\nE                  0., 1., 1., 1., 0., 0., 0., 1., 1., 0., 0., 0., 0., 1., 0., 0., 0.,...\n\n.venv/lib/python3.7/site-packages/numpy/testing/_private/utils.py:761: AssertionError\n_______________ TestOWSelectRows.test_end_support_for_version_1 ________________\n\nself = <r2e_tests.test_2.TestOWSelectRows testMethod=test_end_support_for_version_1>\n\n        def test_end_support_for_version_1(self):\n            if time.gmtime() >= (2022, 2, 2):\n                self.fail(\"\"\"\n    Happy 22/2/2!\n    \n    Now remove support for version==None settings in\n    SelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\n    and uncomment OWSelectRows.migrate.\n    \n    In tests, uncomment test_migration_to_version_1,\n    and remove test_support_old_settings and this test.\n    \n    Basically, revert this commit.\n>   \"\"\")\nE   AssertionError: \nE   Happy 22/2/2!\nE   \nE   Now remove support for version==None settings in\nE   SelectRowsContextHandler.decode_setting and SelectRowsContextHandler.match,\nE   and uncomment OWSelectRows.migrate.\nE   \nE   In tests, uncomment test_migration_to_version_1,\nE   and remove test_support_old_settings and this test.\nE   \nE   Basically, revert this commit.\n\nr2e_tests/test_2.py:314: AssertionError\n___________________ TestOWSelectRows.test_purge_discretized ____________________\n\nself = <r2e_tests.test_2.TestOWSelectRows testMethod=test_purge_discretized>\n\n    def test_purge_discretized(self):\n        housing = Table(\"housing\")\n        method = discretize.EqualFreq(n=3)\n        discretizer = discretize.DomainDiscretizer(\n            discretize_class=True, method=method)\n        domain = discretizer(housing)\n        data = housing.transform(domain)\n        widget = self.widget_with_context(domain, [[\"MEDV\", 2, (2, 3)]])\n        widget.purge_classes = True\n        self.send_signal(widget.Inputs.data, data)\n        out = self.get_output(widget.Outputs.matching_data)\n        expected = data.Y[(data.Y == 1) + (data.Y == 2)]\n        expected = (expected == 2).astype(float)\n>       np.testing.assert_equal(out.Y, expected)\n\nr2e_tests/test_2.py:329: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nx = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n       nan, nan, nan, nan, nan, nan, nan, nan,..., nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan])\ny = array([1., 0., 1., 1., 1., 1., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n       0., 0., 0., 1., 1., 1., 1., 1., 1., ...0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 1., 1., 0.,\n       0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 1., 0.])\nfunc = <ufunc 'isnan'>, hasval = 'nan'\n\n    def func_assert_same_pos(x, y, func=isnan, hasval='nan'):\n        \"\"\"Handling nan/inf.\n    \n        Combine results of running func on x and y, checking that they are True\n        at the same locations.\n    \n        \"\"\"\n        x_id = func(x)\n        y_id = func(y)\n        # We include work-arounds here to handle three types of slightly\n        # pathological ndarray subclasses:\n        # (1) all() on `masked` array scalars can return masked arrays, so we\n        #     use != True\n        # (2) __eq__ on some ndarray subclasses returns Python booleans\n        #     instead of element-wise comparisons, so we cast to bool_() and\n        #     use isinstance(..., bool) checks\n        # (3) subclasses with bare-bones __array_function__ implementations may\n        #     not implement np.all(), so favor using the .all() method\n        # We are not committed to supporting such subclasses, but it's nice to\n        # support them if possible.\n        if bool_(x_id == y_id).all() != True:\n            msg = build_err_msg([x, y],\n                                err_msg + '\\nx and y %s location mismatch:'\n                                % (hasval), verbose=verbose, header=header,\n                                names=('x', 'y'), precision=precision)\n>           raise AssertionError(msg)\nE           AssertionError: \nE           Arrays are not equal\nE           \nE           x and y nan location mismatch:\nE            x: array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\nE                  nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\nE                  nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,...\nE            y: array([1., 0., 1., 1., 1., 1., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\nE                  0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 1., 0.,\nE                  0., 1., 1., 1., 0., 0., 0., 1., 1., 0., 0., 0., 0., 1., 0., 0., 0.,...\n\n.venv/lib/python3.7/site-packages/numpy/testing/_private/utils.py:761: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestRemover::test_remove\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_constant_attr\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_constant_class\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_mapping\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_attr\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_attr_sparse\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_class\nPASSED r2e_tests/test_1.py::TestRemover::test_remove_unused_values_metas\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_annotated_data\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_change_var_type\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_continuous_filter_with_c_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_continuous_filter_with_sl_SI_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_filter_cont\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_filter_disc\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_filter_str\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_image_export\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_is_defined_on_continuous_variable\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_load_settings\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_minimum_size\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_output_filter\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_partial_matches\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_restores_continuous_filter_in_c_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_restores_continuous_filter_in_sl_SI_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_stores_settings_in_invariant_locale\nPASSED r2e_tests/test_2.py::TestOWSelectRows::test_support_old_settings\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\nERROR r2e_tests/test_1.py::test_filename\nERROR r2e_tests/test_2.py::test_filename\nFAILED r2e_tests/test_1.py::TestRemover::test_remove_mapping_after_compute_value\nFAILED r2e_tests/test_2.py::TestOWSelectRows::test_end_support_for_version_1\nFAILED r2e_tests/test_2.py::TestOWSelectRows::test_purge_discretized - Assert...\n============== 3 failed, 26 passed, 3 skipped, 2 errors in 3.11s ===============\nWidgets left: 0    Max widgets: 2308 \n\n",
    "old_commit_res_stderr": ""
}
Orange/preprocess/remove.py Orange/tests/test_remove.py Orange/widgets/data/tests/test_owselectrows.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Removing Unused Values Results in NaN Mapping for Target Variable

**Description:**
When attempting to remove unused values from a categorical variable in the dataset, the target variable `Y` unexpectedly contains `NaN` values instead of properly mapped integers.

**Example:**
```python
housing = Table("housing")
remover = Remove(class_flags=Remove.RemoveUnusedValues)
cleaned = remover(housing)
print(cleaned.Y)  # Outputs array with NaN values instead of expected integers
```

**Expected Behavior:**
After removing unused values, the target variable `Y` should correctly map to integer values without any `NaN` entries.

**Actual Behavior:**
The target variable `Y` contains `NaN` values post-removal, indicating a failure in the mapping process.
[/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/preprocess/remove.py
from collections import namedtuple

import numpy as np

from Orange.data import Domain, DiscreteVariable, Table
from Orange.preprocess.transformation import Lookup
from Orange.statistics.util import nanunique
from .preprocess import Preprocess

__all__ = ["Remove"]


class Remove(Preprocess):
    """
    Construct a preprocessor for removing constant features/classes
    and unused values.
    Given a data table, preprocessor returns a new table and a list of
    results. In the new table, the constant features/classes and unused
    values are removed. The list of results consists of two dictionaries.
    The first one contains numbers of 'removed', 'reduced' and 'sorted'
    features. The second one contains numbers of 'removed', 'reduced'
    and 'sorted' features.

    Parameters
    ----------
    attr_flags : int (default: 0)
        If SortValues, values of discrete attributes are sorted.
        If RemoveConstant, unused attributes are removed.
        If RemoveUnusedValues, unused values are removed from discrete
        attributes.
        It is possible to merge operations in one by summing several types.

    class_flags: int (default: 0)
        If SortValues, values of discrete class attributes are sorted.
        If RemoveConstant, unused class attributes are removed.
        If RemoveUnusedValues, unused values are removed from discrete
        class attributes.
        It is possible to merge operations in one by summing several types.

    Examples
    --------
    >>> from Orange.data import Table
    >>> from Orange.preprocess import Remove
    >>> data = Table("zoo")[:10]
    >>> flags = sum([Remove.SortValues, Remove.RemoveConstant, Remove.RemoveUnusedValues])
    >>> remover = Remove(attr_flags=flags, class_flags=flags)
    >>> new_data = remover(data)
    >>> attr_results, class_results = remover.attr_results, remover.class_results
    """

    SortValues, RemoveConstant, RemoveUnusedValues = 1, 2, 4

    def __init__(self, attr_flags=0, class_flags=0, meta_flags=0):
        self.attr_flags = attr_flags
        self.class_flags = class_flags
        self.meta_flags = meta_flags
        self.attr_results = None
        self.class_results = None
        self.meta_results = None

    def __call__(self, data):
        """
        Removes unused features or classes from the given data. Returns a new
        data table.

        Parameters
        ----------
        data : Orange.data.Table
            A data table to remove features or classes from.

        Returns
        -------
        data : Orange.data.Table
            New data table.
        """
        if data is None:
            return None

        domain = data.domain
        attrs_state = [purge_var_M(var, data, self.attr_flags)
                       for var in domain.attributes]
        class_state = [purge_var_M(var, data, self.class_flags)
                       for var in domain.class_vars]
        metas_state = [purge_var_M(var, data, self.meta_flags)
                       for var in domain.metas]

        att_vars, self.attr_results = self.get_vars_and_results(attrs_state)
        cls_vars, self.class_results = self.get_vars_and_results(class_state)
        meta_vars, self.meta_results = self.get_vars_and_results(metas_state)

        domain = Domain(att_vars, cls_vars, meta_vars)
        return data.transform(domain)

    def get_vars_and_results(self, state):
        removed, reduced, sorted = 0, 0, 0
        vars = []
        for st in state:
            removed += is_removed(st)
            reduced += not is_removed(st) and is_reduced(st)
            sorted += not is_removed(st) and is_sorted(st)
            if not is_removed(st):
                vars.append(merge_transforms(st).var)
        res = {'removed': removed, 'reduced': reduced, 'sorted': sorted}
        return vars, res


# Define a simple Purge expression 'language'.
#: A input variable (leaf expression).
Var = namedtuple("Var", ["var"])
#: Removed variable (can only ever be present as a root node).
Removed = namedtuple("Removed", ["sub", "var"])
#: A reduced variable
Reduced = namedtuple("Reduced", ["sub", "var"])
#: A sorted variable
Sorted = namedtuple("Sorted", ["sub", "var"])
#: A general (lookup) transformed variable.
#: (this node is returned as a result of `merge` which joins consecutive
#: Removed/Reduced nodes into a single Transformed node)
Transformed = namedtuple("Transformed", ["sub", "var"])


def is_var(exp):
    """Is `exp` a `Var` node."""
    return isinstance(exp, Var)


def is_removed(exp):
    """Is `exp` a `Removed` node."""
    return isinstance(exp, Removed)


def _contains(exp, cls):
    """Does `node` contain a sub node of type `cls`"""
    if isinstance(exp, cls):
        return True
    elif isinstance(exp, Var):
        return False
    else:
        return _contains(exp.sub, cls)


def is_reduced(exp):
    """Does `exp` contain a `Reduced` node."""
    return _contains(exp, Reduced)


def is_sorted(exp):
    """Does `exp` contain a `Reduced` node."""
    return _contains(exp, Sorted)


def merge_transforms(exp):
    """
    Merge consecutive Removed, Reduced or Transformed nodes.

    .. note:: Removed nodes are returned unchanged.

    """
    if isinstance(exp, (Var, Removed)):
        return exp
    elif isinstance(exp, (Reduced, Sorted, Transformed)):
        prev = merge_transforms(exp.sub)
        if isinstance(prev, (Reduced, Sorted, Transformed)):
            B = exp.var.compute_value
            assert isinstance(B, Lookup)
            A = B.variable.compute_value
            assert isinstance(A, Lookup)

            new_var = DiscreteVariable(
                exp.var.name,
                values=exp.var.values,
                ordered=exp.var.ordered,
                compute_value=merge_lookup(A, B),
                sparse=exp.var.sparse,
            )
            assert isinstance(prev.sub, Var)
            return Transformed(prev.sub, new_var)
        else:
            assert prev is exp.sub
            return exp
    else:
        raise TypeError


def purge_var_M(var, data, flags):
    state = Var(var)
    if flags & Remove.RemoveConstant:
        var = remove_constant(state.var, data)
        if var is None:
            return Removed(state, state.var)

    if state.var.is_discrete:
        if flags & Remove.RemoveUnusedValues:
            newattr = remove_unused_values(state.var, data)

            if newattr is not state.var:
                state = Reduced(state, newattr)

            if flags & Remove.RemoveConstant and len(state.var.values) < 2:
                return Removed(state, state.var)

        if flags & Remove.SortValues:
            newattr = sort_var_values(state.var)
            if newattr is not state.var:
                state = Sorted(state, newattr)

    return state


def has_at_least_two_values(data, var):
    ((dist, unknowns),) = data._compute_distributions([var])
    # TODO this check is suboptimal for sparse since get_column_view
    # densifies the data. Should be irrelevant after Pandas.
    _, sparse = data.get_column_view(var)
    if var.is_continuous:
        dist = dist[1, :]
    min_size = 0 if sparse and unknowns else 1
    return np.sum(dist > 0.0) > min_size


def remove_constant(var, data):
    if var.is_continuous:
        if not has_at_least_two_values(data, var):
            return None
        else:
            return var
    elif var.is_discrete:
        if len(var.values) < 2:
            return None
        else:
            return var
    else:
        return var


def remove_unused_values(var, data):
    unique = nanunique(data.get_column_view(var)[0].astype(float)).astype(int)
    if len(unique) == len(var.values):
        return var
    used_values = [var.values[i] for i in unique]
    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse)


def sort_var_values(var):
    newvalues = list(sorted(var.values))

    if newvalues == list(var.values):
        return var

    translation_table = np.array(
        [float(newvalues.index(value)) for value in var.values]
    )

    return DiscreteVariable(var.name, values=newvalues,
                            compute_value=Lookup(var, translation_table),
                            sparse=var.sparse)


def merge_lookup(A, B):
    """
    Merge two consecutive Lookup transforms into one.
    """
    lookup_table = np.array(A.lookup_table)
    mask = np.isfinite(lookup_table)
    indices = np.array(lookup_table[mask], dtype=int)
    lookup_table[mask] = B.lookup_table[indices]
    return Lookup(A.variable, lookup_table)

```
--- 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:** Removing Unused Values Results in NaN Mapping for Target Variable

**Description:**
When attempting to remove unused values from a categorical variable in the dataset, the target variable `Y` unexpectedly contains `NaN` values instead of properly mapped integers.

**Example:**
```python
housing = Table("housing")
remover = Remove(class_flags=Remove.RemoveUnusedValues)
cleaned = remover(housing)
print(cleaned.Y)  # Outputs array with NaN values instead of expected integers
```

**Expected Behavior:**
After removing unused values, the target variable `Y` should correctly map to integer values without any `NaN` entries.

**Actual Behavior:**
The target variable `Y` contains `NaN` values post-removal, indicating a failure in the mapping process.
[/ISSUE]
{
    "TestRemover.test_remove": "PASSED",
    "TestRemover.test_remove_constant_attr": "PASSED",
    "TestRemover.test_remove_constant_class": "PASSED",
    "TestRemover.test_remove_mapping": "PASSED",
    "TestRemover.test_remove_mapping_after_compute_value": "PASSED",
    "TestRemover.test_remove_unused_values_attr": "PASSED",
    "TestRemover.test_remove_unused_values_attr_sparse": "PASSED",
    "TestRemover.test_remove_unused_values_class": "PASSED",
    "TestRemover.test_remove_unused_values_metas": "PASSED",
    "TestOWSelectRows.test_annotated_data": "PASSED",
    "TestOWSelectRows.test_change_var_type": "PASSED",
    "TestOWSelectRows.test_continuous_filter_with_c_locale": "PASSED",
    "TestOWSelectRows.test_continuous_filter_with_sl_SI_locale": "PASSED",
    "TestOWSelectRows.test_filter_cont": "PASSED",
    "TestOWSelectRows.test_filter_disc": "PASSED",
    "TestOWSelectRows.test_filter_str": "PASSED",
    "TestOWSelectRows.test_image_export": "PASSED",
    "TestOWSelectRows.test_is_defined_on_continuous_variable": "PASSED",
    "TestOWSelectRows.test_load_settings": "PASSED",
    "TestOWSelectRows.test_minimum_size": "PASSED",
    "TestOWSelectRows.test_msg_base_class": "PASSED",
    "TestOWSelectRows.test_output_filter": "PASSED",
    "TestOWSelectRows.test_partial_matches": "PASSED",
    "TestOWSelectRows.test_purge_discretized": "PASSED",
    "TestOWSelectRows.test_restores_continuous_filter_in_c_locale": "PASSED",
    "TestOWSelectRows.test_restores_continuous_filter_in_sl_SI_locale": "PASSED",
    "TestOWSelectRows.test_stores_settings_in_invariant_locale": "PASSED",
    "TestOWSelectRows.test_support_old_settings": "PASSED",
    "test_filename": "ERROR",
    "TestOWSelectRows.test_end_support_for_version_1": "FAILED"
}
diff --git a/Orange/preprocess/remove.py b/Orange/preprocess/remove.py
index 7ae17376a..52a9bd5ef 100644
--- a/Orange/preprocess/remove.py
+++ b/Orange/preprocess/remove.py
@@ -2,7 +2,7 @@ from collections import namedtuple
 
 import numpy as np
 
-from Orange.data import Domain, DiscreteVariable, Table
+from Orange.data import Domain, DiscreteVariable
 from Orange.preprocess.transformation import Lookup
 from Orange.statistics.util import nanunique
 from .preprocess import Preprocess
@@ -238,7 +238,10 @@ def remove_unused_values(var, data):
     if len(unique) == len(var.values):
         return var
     used_values = [var.values[i] for i in unique]
-    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse)
+    translation_table = np.array([np.NaN] * len(var.values))
+    translation_table[unique] = range(len(used_values))
+    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse,
+                            compute_value=Lookup(var, translation_table))
 
 
 def sort_var_values(var):

{"Orange/preprocess/remove.py": "from collections import namedtuple\n\nimport numpy as np\n\nfrom Orange.data import Domain, DiscreteVariable, Table\nfrom Orange.preprocess.transformation import Lookup\nfrom Orange.statistics.util import nanunique\nfrom .preprocess import Preprocess\n\n__all__ = [\"Remove\"]\n\n\nclass Remove(Preprocess):\n    \"\"\"\n    Construct a preprocessor for removing constant features/classes\n    and unused values.\n    Given a data table, preprocessor returns a new table and a list of\n    results. In the new table, the constant features/classes and unused\n    values are removed. The list of results consists of two dictionaries.\n    The first one contains numbers of 'removed', 'reduced' and 'sorted'\n    features. The second one contains numbers of 'removed', 'reduced'\n    and 'sorted' features.\n\n    Parameters\n    ----------\n    attr_flags : int (default: 0)\n        If SortValues, values of discrete attributes are sorted.\n        If RemoveConstant, unused attributes are removed.\n        If RemoveUnusedValues, unused values are removed from discrete\n        attributes.\n        It is possible to merge operations in one by summing several types.\n\n    class_flags: int (default: 0)\n        If SortValues, values of discrete class attributes are sorted.\n        If RemoveConstant, unused class attributes are removed.\n        If RemoveUnusedValues, unused values are removed from discrete\n        class attributes.\n        It is possible to merge operations in one by summing several types.\n\n    Examples\n    --------\n    >>> from Orange.data import Table\n    >>> from Orange.preprocess import Remove\n    >>> data = Table(\"zoo\")[:10]\n    >>> flags = sum([Remove.SortValues, Remove.RemoveConstant, Remove.RemoveUnusedValues])\n    >>> remover = Remove(attr_flags=flags, class_flags=flags)\n    >>> new_data = remover(data)\n    >>> attr_results, class_results = remover.attr_results, remover.class_results\n    \"\"\"\n\n    SortValues, RemoveConstant, RemoveUnusedValues = 1, 2, 4\n\n    def __init__(self, attr_flags=0, class_flags=0, meta_flags=0):\n        self.attr_flags = attr_flags\n        self.class_flags = class_flags\n        self.meta_flags = meta_flags\n        self.attr_results = None\n        self.class_results = None\n        self.meta_results = None\n\n    def __call__(self, data):\n        \"\"\"\n        Removes unused features or classes from the given data. Returns a new\n        data table.\n\n        Parameters\n        ----------\n        data : Orange.data.Table\n            A data table to remove features or classes from.\n\n        Returns\n        -------\n        data : Orange.data.Table\n            New data table.\n        \"\"\"\n        if data is None:\n            return None\n\n        domain = data.domain\n        attrs_state = [purge_var_M(var, data, self.attr_flags)\n                       for var in domain.attributes]\n        class_state = [purge_var_M(var, data, self.class_flags)\n                       for var in domain.class_vars]\n        metas_state = [purge_var_M(var, data, self.meta_flags)\n                       for var in domain.metas]\n\n        att_vars, self.attr_results = self.get_vars_and_results(attrs_state)\n        cls_vars, self.class_results = self.get_vars_and_results(class_state)\n        meta_vars, self.meta_results = self.get_vars_and_results(metas_state)\n\n        domain = Domain(att_vars, cls_vars, meta_vars)\n        return data.transform(domain)\n\n    def get_vars_and_results(self, state):\n        removed, reduced, sorted = 0, 0, 0\n        vars = []\n        for st in state:\n            removed += is_removed(st)\n            reduced += not is_removed(st) and is_reduced(st)\n            sorted += not is_removed(st) and is_sorted(st)\n            if not is_removed(st):\n                vars.append(merge_transforms(st).var)\n        res = {'removed': removed, 'reduced': reduced, 'sorted': sorted}\n        return vars, res\n\n\n# Define a simple Purge expression 'language'.\n#: A input variable (leaf expression).\nVar = namedtuple(\"Var\", [\"var\"])\n#: Removed variable (can only ever be present as a root node).\nRemoved = namedtuple(\"Removed\", [\"sub\", \"var\"])\n#: A reduced variable\nReduced = namedtuple(\"Reduced\", [\"sub\", \"var\"])\n#: A sorted variable\nSorted = namedtuple(\"Sorted\", [\"sub\", \"var\"])\n#: A general (lookup) transformed variable.\n#: (this node is returned as a result of `merge` which joins consecutive\n#: Removed/Reduced nodes into a single Transformed node)\nTransformed = namedtuple(\"Transformed\", [\"sub\", \"var\"])\n\n\ndef is_var(exp):\n    \"\"\"Is `exp` a `Var` node.\"\"\"\n    return isinstance(exp, Var)\n\n\ndef is_removed(exp):\n    \"\"\"Is `exp` a `Removed` node.\"\"\"\n    return isinstance(exp, Removed)\n\n\ndef _contains(exp, cls):\n    \"\"\"Does `node` contain a sub node of type `cls`\"\"\"\n    if isinstance(exp, cls):\n        return True\n    elif isinstance(exp, Var):\n        return False\n    else:\n        return _contains(exp.sub, cls)\n\n\ndef is_reduced(exp):\n    \"\"\"Does `exp` contain a `Reduced` node.\"\"\"\n    return _contains(exp, Reduced)\n\n\ndef is_sorted(exp):\n    \"\"\"Does `exp` contain a `Reduced` node.\"\"\"\n    return _contains(exp, Sorted)\n\n\ndef merge_transforms(exp):\n    \"\"\"\n    Merge consecutive Removed, Reduced or Transformed nodes.\n\n    .. note:: Removed nodes are returned unchanged.\n\n    \"\"\"\n    if isinstance(exp, (Var, Removed)):\n        return exp\n    elif isinstance(exp, (Reduced, Sorted, Transformed)):\n        prev = merge_transforms(exp.sub)\n        if isinstance(prev, (Reduced, Sorted, Transformed)):\n            B = exp.var.compute_value\n            assert isinstance(B, Lookup)\n            A = B.variable.compute_value\n            assert isinstance(A, Lookup)\n\n            new_var = DiscreteVariable(\n                exp.var.name,\n                values=exp.var.values,\n                ordered=exp.var.ordered,\n                compute_value=merge_lookup(A, B),\n                sparse=exp.var.sparse,\n            )\n            assert isinstance(prev.sub, Var)\n            return Transformed(prev.sub, new_var)\n        else:\n            assert prev is exp.sub\n            return exp\n    else:\n        raise TypeError\n\n\ndef purge_var_M(var, data, flags):\n    state = Var(var)\n    if flags & Remove.RemoveConstant:\n        var = remove_constant(state.var, data)\n        if var is None:\n            return Removed(state, state.var)\n\n    if state.var.is_discrete:\n        if flags & Remove.RemoveUnusedValues:\n            newattr = remove_unused_values(state.var, data)\n\n            if newattr is not state.var:\n                state = Reduced(state, newattr)\n\n            if flags & Remove.RemoveConstant and len(state.var.values) < 2:\n                return Removed(state, state.var)\n\n        if flags & Remove.SortValues:\n            newattr = sort_var_values(state.var)\n            if newattr is not state.var:\n                state = Sorted(state, newattr)\n\n    return state\n\n\ndef has_at_least_two_values(data, var):\n    ((dist, unknowns),) = data._compute_distributions([var])\n    # TODO this check is suboptimal for sparse since get_column_view\n    # densifies the data. Should be irrelevant after Pandas.\n    _, sparse = data.get_column_view(var)\n    if var.is_continuous:\n        dist = dist[1, :]\n    min_size = 0 if sparse and unknowns else 1\n    return np.sum(dist > 0.0) > min_size\n\n\ndef remove_constant(var, data):\n    if var.is_continuous:\n        if not has_at_least_two_values(data, var):\n            return None\n        else:\n            return var\n    elif var.is_discrete:\n        if len(var.values) < 2:\n            return None\n        else:\n            return var\n    else:\n        return var\n\n\ndef remove_unused_values(var, data):\n    unique = nanunique(data.get_column_view(var)[0].astype(float)).astype(int)\n    if len(unique) == len(var.values):\n        return var\n    used_values = [var.values[i] for i in unique]\n    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse)\n\n\ndef sort_var_values(var):\n    newvalues = list(sorted(var.values))\n\n    if newvalues == list(var.values):\n        return var\n\n    translation_table = np.array(\n        [float(newvalues.index(value)) for value in var.values]\n    )\n\n    return DiscreteVariable(var.name, values=newvalues,\n                            compute_value=Lookup(var, translation_table),\n                            sparse=var.sparse)\n\n\ndef merge_lookup(A, B):\n    \"\"\"\n    Merge two consecutive Lookup transforms into one.\n    \"\"\"\n    lookup_table = np.array(A.lookup_table)\n    mask = np.isfinite(lookup_table)\n    indices = np.array(lookup_table[mask], dtype=int)\n    lookup_table[mask] = B.lookup_table[indices]\n    return Lookup(A.variable, lookup_table)\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:** Removing Unused Values Results in NaN Mapping for Target Variable

**Description:**
When attempting to remove unused values from a categorical variable in the dataset, the target variable `Y` unexpectedly contains `NaN` values instead of properly mapped integers.

**Example:**
```python
housing = Table("housing")
remover = Remove(class_flags=Remove.RemoveUnusedValues)
cleaned = remover(housing)
print(cleaned.Y)  # Outputs array with NaN values instead of expected integers
```

**Expected Behavior:**
After removing unused values, the target variable `Y` should correctly map to integer values without any `NaN` entries.

**Actual Behavior:**
The target variable `Y` contains `NaN` values post-removal, indicating a failure in the mapping process.
[/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/preprocess/remove.py
from collections import namedtuple

import numpy as np

from Orange.data import Domain, DiscreteVariable, Table
from Orange.preprocess.transformation import Lookup
from Orange.statistics.util import nanunique
from .preprocess import Preprocess

__all__ = ["Remove"]


class Remove(Preprocess):
    """
    Construct a preprocessor for removing constant features/classes
    and unused values.
    Given a data table, preprocessor returns a new table and a list of
    results. In the new table, the constant features/classes and unused
    values are removed. The list of results consists of two dictionaries.
    The first one contains numbers of 'removed', 'reduced' and 'sorted'
    features. The second one contains numbers of 'removed', 'reduced'
    and 'sorted' features.

    Parameters
    ----------
    attr_flags : int (default: 0)
        If SortValues, values of discrete attributes are sorted.
        If RemoveConstant, unused attributes are removed.
        If RemoveUnusedValues, unused values are removed from discrete
        attributes.
        It is possible to merge operations in one by summing several types.

    class_flags: int (default: 0)
        If SortValues, values of discrete class attributes are sorted.
        If RemoveConstant, unused class attributes are removed.
        If RemoveUnusedValues, unused values are removed from discrete
        class attributes.
        It is possible to merge operations in one by summing several types.

    Examples
    --------
    >>> from Orange.data import Table
    >>> from Orange.preprocess import Remove
    >>> data = Table("zoo")[:10]
    >>> flags = sum([Remove.SortValues, Remove.RemoveConstant, Remove.RemoveUnusedValues])
    >>> remover = Remove(attr_flags=flags, class_flags=flags)
    >>> new_data = remover(data)
    >>> attr_results, class_results = remover.attr_results, remover.class_results
    """

    SortValues, RemoveConstant, RemoveUnusedValues = 1, 2, 4

    def __init__(self, attr_flags=0, class_flags=0, meta_flags=0):
        self.attr_flags = attr_flags
        self.class_flags = class_flags
        self.meta_flags = meta_flags
        self.attr_results = None
        self.class_results = None
        self.meta_results = None

    def __call__(self, data):
        """
        Removes unused features or classes from the given data. Returns a new
        data table.

        Parameters
        ----------
        data : Orange.data.Table
            A data table to remove features or classes from.

        Returns
        -------
        data : Orange.data.Table
            New data table.
        """
        if data is None:
            return None

        domain = data.domain
        attrs_state = [purge_var_M(var, data, self.attr_flags)
                       for var in domain.attributes]
        class_state = [purge_var_M(var, data, self.class_flags)
                       for var in domain.class_vars]
        metas_state = [purge_var_M(var, data, self.meta_flags)
                       for var in domain.metas]

        att_vars, self.attr_results = self.get_vars_and_results(attrs_state)
        cls_vars, self.class_results = self.get_vars_and_results(class_state)
        meta_vars, self.meta_results = self.get_vars_and_results(metas_state)

        domain = Domain(att_vars, cls_vars, meta_vars)
        return data.transform(domain)

    def get_vars_and_results(self, state):
        removed, reduced, sorted = 0, 0, 0
        vars = []
        for st in state:
            removed += is_removed(st)
            reduced += not is_removed(st) and is_reduced(st)
            sorted += not is_removed(st) and is_sorted(st)
            if not is_removed(st):
                vars.append(merge_transforms(st).var)
        res = {'removed': removed, 'reduced': reduced, 'sorted': sorted}
        return vars, res


# Define a simple Purge expression 'language'.
#: A input variable (leaf expression).
Var = namedtuple("Var", ["var"])
#: Removed variable (can only ever be present as a root node).
Removed = namedtuple("Removed", ["sub", "var"])
#: A reduced variable
Reduced = namedtuple("Reduced", ["sub", "var"])
#: A sorted variable
Sorted = namedtuple("Sorted", ["sub", "var"])
#: A general (lookup) transformed variable.
#: (this node is returned as a result of `merge` which joins consecutive
#: Removed/Reduced nodes into a single Transformed node)
Transformed = namedtuple("Transformed", ["sub", "var"])


def is_var(exp):
    """Is `exp` a `Var` node."""
    return isinstance(exp, Var)


def is_removed(exp):
    """Is `exp` a `Removed` node."""
    return isinstance(exp, Removed)


def _contains(exp, cls):
    """Does `node` contain a sub node of type `cls`"""
    if isinstance(exp, cls):
        return True
    elif isinstance(exp, Var):
        return False
    else:
        return _contains(exp.sub, cls)


def is_reduced(exp):
    """Does `exp` contain a `Reduced` node."""
    return _contains(exp, Reduced)


def is_sorted(exp):
    """Does `exp` contain a `Reduced` node."""
    return _contains(exp, Sorted)


def merge_transforms(exp):
    """
    Merge consecutive Removed, Reduced or Transformed nodes.

    .. note:: Removed nodes are returned unchanged.

    """
    if isinstance(exp, (Var, Removed)):
        return exp
    elif isinstance(exp, (Reduced, Sorted, Transformed)):
        prev = merge_transforms(exp.sub)
        if isinstance(prev, (Reduced, Sorted, Transformed)):
            B = exp.var.compute_value
            assert isinstance(B, Lookup)
            A = B.variable.compute_value
            assert isinstance(A, Lookup)

            new_var = DiscreteVariable(
                exp.var.name,
                values=exp.var.values,
                ordered=exp.var.ordered,
                compute_value=merge_lookup(A, B),
                sparse=exp.var.sparse,
            )
            assert isinstance(prev.sub, Var)
            return Transformed(prev.sub, new_var)
        else:
            assert prev is exp.sub
            return exp
    else:
        raise TypeError


def purge_var_M(var, data, flags):
    state = Var(var)
    if flags & Remove.RemoveConstant:
        var = remove_constant(state.var, data)
        if var is None:
            return Removed(state, state.var)

    if state.var.is_discrete:
        if flags & Remove.RemoveUnusedValues:
            newattr = remove_unused_values(state.var, data)

            if newattr is not state.var:
                state = Reduced(state, newattr)

            if flags & Remove.RemoveConstant and len(state.var.values) < 2:
                return Removed(state, state.var)

        if flags & Remove.SortValues:
            newattr = sort_var_values(state.var)
            if newattr is not state.var:
                state = Sorted(state, newattr)

    return state


def has_at_least_two_values(data, var):
    ((dist, unknowns),) = data._compute_distributions([var])
    # TODO this check is suboptimal for sparse since get_column_view
    # densifies the data. Should be irrelevant after Pandas.
    _, sparse = data.get_column_view(var)
    if var.is_continuous:
        dist = dist[1, :]
    min_size = 0 if sparse and unknowns else 1
    return np.sum(dist > 0.0) > min_size


def remove_constant(var, data):
    if var.is_continuous:
        if not has_at_least_two_values(data, var):
            return None
        else:
            return var
    elif var.is_discrete:
        if len(var.values) < 2:
            return None
        else:
            return var
    else:
        return var


def remove_unused_values(var, data):
    unique = nanunique(data.get_column_view(var)[0].astype(float)).astype(int)
    if len(unique) == len(var.values):
        return var
    used_values = [var.values[i] for i in unique]
    return DiscreteVariable(var.name, values=used_values, sparse=var.sparse)


def sort_var_values(var):
    newvalues = list(sorted(var.values))

    if newvalues == list(var.values):
        return var

    translation_table = np.array(
        [float(newvalues.index(value)) for value in var.values]
    )

    return DiscreteVariable(var.name, values=newvalues,
                            compute_value=Lookup(var, translation_table),
                            sparse=var.sparse)


def merge_lookup(A, B):
    """
    Merge two consecutive Lookup transforms into one.
    """
    lookup_table = np.array(A.lookup_table)
    mask = np.isfinite(lookup_table)
    indices = np.array(lookup_table[mask], dtype=int)
    lookup_table[mask] = B.lookup_table[indices]
    return Lookup(A.variable, lookup_table)

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