We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bag of Words: add option to disable hiding attributes
Sometimes, one would want to inspect words in Box Plot, MDS, Geo Map, Networks. These widgets don't show hidden attributes, which BoW features are by default. Add a checkbox to 'unhide' these attributes.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `orangecontrib/text/widgets/utils/owbasevectorizer.py`
Content:
```
1 from AnyQt.QtWidgets import QGroupBox, QHBoxLayout, QVBoxLayout
2 
3 from Orange.widgets import gui
4 from Orange.widgets import settings
5 from Orange.widgets.widget import OWWidget, Input, Output
6 from orangecontrib.text.corpus import Corpus
7 
8 
9 class OWBaseVectorizer(OWWidget):
10     """ A base class for feature extraction methods.
11 
12     Notes:
13         Ensure that `create_configuration_layout` and `update_method` are overwritten.
14     """
15     # Input/output
16     class Inputs:
17         corpus = Input("Corpus", Corpus)
18 
19     class Outputs:
20         corpus = Output("Corpus", Corpus)
21 
22     want_main_area = False
23     resizing_enabled = False
24 
25     # Settings
26     autocommit = settings.Setting(True)
27 
28     Method = NotImplemented
29 
30     def __init__(self):
31         super().__init__()
32         self.corpus = None
33         self.method = None
34 
35         box = QGroupBox(title='Options')
36         box.setLayout(self.create_configuration_layout())
37         self.controlArea.layout().addWidget(box)
38 
39         buttons_layout = QHBoxLayout()
40         buttons_layout.addSpacing(15)
41         buttons_layout.addWidget(
42             gui.auto_commit(None, self, 'autocommit', 'Commit', box=False)
43         )
44         self.controlArea.layout().addLayout(buttons_layout)
45         self.update_method()
46 
47     @Inputs.corpus
48     def set_data(self, data):
49         self.corpus = data
50         self.commit()
51 
52     def commit(self):
53         self.apply()
54 
55     def apply(self):
56         if self.corpus is not None:
57             new_corpus = self.method.transform(self.corpus)
58             self.Outputs.corpus.send(new_corpus)
59 
60     def update_method(self):
61         self.method = self.Method()
62 
63     def on_change(self):
64         self.update_method()
65         self.commit()
66 
67     def send_report(self):
68         self.report_items(self.method.report())
69 
70     def create_configuration_layout(self):
71         return QVBoxLayout()
72
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/orangecontrib/text/widgets/utils/owbasevectorizer.py b/orangecontrib/text/widgets/utils/owbasevectorizer.py
--- a/orangecontrib/text/widgets/utils/owbasevectorizer.py
+++ b/orangecontrib/text/widgets/utils/owbasevectorizer.py
@@ -1,4 +1,5 @@
-from AnyQt.QtWidgets import QGroupBox, QHBoxLayout, QVBoxLayout
+
+from AnyQt.QtWidgets import QGroupBox, QVBoxLayout
 
 from Orange.widgets import gui
 from Orange.widgets import settings
@@ -24,6 +25,7 @@
 
     # Settings
     autocommit = settings.Setting(True)
+    hidden_cb = settings.Setting(True)
 
     Method = NotImplemented
 
@@ -31,38 +33,55 @@
         super().__init__()
         self.corpus = None
         self.method = None
+        self.new_corpus = None
+        self.new_attrs = None
 
         box = QGroupBox(title='Options')
         box.setLayout(self.create_configuration_layout())
         self.controlArea.layout().addWidget(box)
 
-        buttons_layout = QHBoxLayout()
-        buttons_layout.addSpacing(15)
-        buttons_layout.addWidget(
-            gui.auto_commit(None, self, 'autocommit', 'Commit', box=False)
-        )
-        self.controlArea.layout().addLayout(buttons_layout)
+        output_layout = gui.hBox(self.controlArea)
+        gui.checkBox(output_layout, self, "hidden_cb", "Hide bow attributes",
+                     callback=self.hide_attrs)
+
+        buttons_layout = gui.hBox(self.controlArea)
+        gui.auto_commit(buttons_layout, self, 'autocommit', 'Commit', box=False)
         self.update_method()
 
     @Inputs.corpus
     def set_data(self, data):
         self.corpus = data
-        self.commit()
+        self.invalidate()
+
+    def hide_attrs(self):
+        if self.new_corpus:
+            new_domain = self.new_corpus.domain
+            for f in new_domain.attributes:
+                if f.name in self.new_attrs:
+                    f.attributes['hidden'] = self.hidden_cb
+            self.new_corpus = self.new_corpus.transform(new_domain)
+            self.commit()
 
     def commit(self):
-        self.apply()
+        self.Outputs.corpus.send(self.new_corpus)
 
     def apply(self):
         if self.corpus is not None:
-            new_corpus = self.method.transform(self.corpus)
-            self.Outputs.corpus.send(new_corpus)
+            self.new_corpus = self.method.transform(self.corpus)
+            self.new_attrs = {f.name for f in self.new_corpus.domain.attributes} \
+                - {f.name for f in self.corpus.domain.attributes}
+
+    def invalidate(self):
+        self.apply()
+        self.hide_attrs()
+        self.commit()
 
     def update_method(self):
         self.method = self.Method()
 
     def on_change(self):
         self.update_method()
-        self.commit()
+        self.invalidate()
 
     def send_report(self):
         self.report_items(self.method.report())

{"golden_diff": "diff --git a/orangecontrib/text/widgets/utils/owbasevectorizer.py b/orangecontrib/text/widgets/utils/owbasevectorizer.py\n--- a/orangecontrib/text/widgets/utils/owbasevectorizer.py\n+++ b/orangecontrib/text/widgets/utils/owbasevectorizer.py\n@@ -1,4 +1,5 @@\n-from AnyQt.QtWidgets import QGroupBox, QHBoxLayout, QVBoxLayout\n+\n+from AnyQt.QtWidgets import QGroupBox, QVBoxLayout\n \n from Orange.widgets import gui\n from Orange.widgets import settings\n@@ -24,6 +25,7 @@\n \n     # Settings\n     autocommit = settings.Setting(True)\n+    hidden_cb = settings.Setting(True)\n \n     Method = NotImplemented\n \n@@ -31,38 +33,55 @@\n         super().__init__()\n         self.corpus = None\n         self.method = None\n+        self.new_corpus = None\n+        self.new_attrs = None\n \n         box = QGroupBox(title='Options')\n         box.setLayout(self.create_configuration_layout())\n         self.controlArea.layout().addWidget(box)\n \n-        buttons_layout = QHBoxLayout()\n-        buttons_layout.addSpacing(15)\n-        buttons_layout.addWidget(\n-            gui.auto_commit(None, self, 'autocommit', 'Commit', box=False)\n-        )\n-        self.controlArea.layout().addLayout(buttons_layout)\n+        output_layout = gui.hBox(self.controlArea)\n+        gui.checkBox(output_layout, self, \"hidden_cb\", \"Hide bow attributes\",\n+                     callback=self.hide_attrs)\n+\n+        buttons_layout = gui.hBox(self.controlArea)\n+        gui.auto_commit(buttons_layout, self, 'autocommit', 'Commit', box=False)\n         self.update_method()\n \n     @Inputs.corpus\n     def set_data(self, data):\n         self.corpus = data\n-        self.commit()\n+        self.invalidate()\n+\n+    def hide_attrs(self):\n+        if self.new_corpus:\n+            new_domain = self.new_corpus.domain\n+            for f in new_domain.attributes:\n+                if f.name in self.new_attrs:\n+                    f.attributes['hidden'] = self.hidden_cb\n+            self.new_corpus = self.new_corpus.transform(new_domain)\n+            self.commit()\n \n     def commit(self):\n-        self.apply()\n+        self.Outputs.corpus.send(self.new_corpus)\n \n     def apply(self):\n         if self.corpus is not None:\n-            new_corpus = self.method.transform(self.corpus)\n-            self.Outputs.corpus.send(new_corpus)\n+            self.new_corpus = self.method.transform(self.corpus)\n+            self.new_attrs = {f.name for f in self.new_corpus.domain.attributes} \\\n+                - {f.name for f in self.corpus.domain.attributes}\n+\n+    def invalidate(self):\n+        self.apply()\n+        self.hide_attrs()\n+        self.commit()\n \n     def update_method(self):\n         self.method = self.Method()\n \n     def on_change(self):\n         self.update_method()\n-        self.commit()\n+        self.invalidate()\n \n     def send_report(self):\n         self.report_items(self.method.report())\n", "issue": "Bag of Words: add option to disable hiding attributes\nSometimes, one would want to inspect words in Box Plot, MDS, Geo Map, Networks. These widgets don't show hidden attributes, which BoW features are by default. Add a checkbox to 'unhide' these attributes.\n", "before_files": [{"content": "from AnyQt.QtWidgets import QGroupBox, QHBoxLayout, QVBoxLayout\n\nfrom Orange.widgets import gui\nfrom Orange.widgets import settings\nfrom Orange.widgets.widget import OWWidget, Input, Output\nfrom orangecontrib.text.corpus import Corpus\n\n\nclass OWBaseVectorizer(OWWidget):\n    \"\"\" A base class for feature extraction methods.\n\n    Notes:\n        Ensure that `create_configuration_layout` and `update_method` are overwritten.\n    \"\"\"\n    # Input/output\n    class Inputs:\n        corpus = Input(\"Corpus\", Corpus)\n\n    class Outputs:\n        corpus = Output(\"Corpus\", Corpus)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    # Settings\n    autocommit = settings.Setting(True)\n\n    Method = NotImplemented\n\n    def __init__(self):\n        super().__init__()\n        self.corpus = None\n        self.method = None\n\n        box = QGroupBox(title='Options')\n        box.setLayout(self.create_configuration_layout())\n        self.controlArea.layout().addWidget(box)\n\n        buttons_layout = QHBoxLayout()\n        buttons_layout.addSpacing(15)\n        buttons_layout.addWidget(\n            gui.auto_commit(None, self, 'autocommit', 'Commit', box=False)\n        )\n        self.controlArea.layout().addLayout(buttons_layout)\n        self.update_method()\n\n    @Inputs.corpus\n    def set_data(self, data):\n        self.corpus = data\n        self.commit()\n\n    def commit(self):\n        self.apply()\n\n    def apply(self):\n        if self.corpus is not None:\n            new_corpus = self.method.transform(self.corpus)\n            self.Outputs.corpus.send(new_corpus)\n\n    def update_method(self):\n        self.method = self.Method()\n\n    def on_change(self):\n        self.update_method()\n        self.commit()\n\n    def send_report(self):\n        self.report_items(self.method.report())\n\n    def create_configuration_layout(self):\n        return QVBoxLayout()\n", "path": "orangecontrib/text/widgets/utils/owbasevectorizer.py"}], "after_files": [{"content": "\nfrom AnyQt.QtWidgets import QGroupBox, QVBoxLayout\n\nfrom Orange.widgets import gui\nfrom Orange.widgets import settings\nfrom Orange.widgets.widget import OWWidget, Input, Output\nfrom orangecontrib.text.corpus import Corpus\n\n\nclass OWBaseVectorizer(OWWidget):\n    \"\"\" A base class for feature extraction methods.\n\n    Notes:\n        Ensure that `create_configuration_layout` and `update_method` are overwritten.\n    \"\"\"\n    # Input/output\n    class Inputs:\n        corpus = Input(\"Corpus\", Corpus)\n\n    class Outputs:\n        corpus = Output(\"Corpus\", Corpus)\n\n    want_main_area = False\n    resizing_enabled = False\n\n    # Settings\n    autocommit = settings.Setting(True)\n    hidden_cb = settings.Setting(True)\n\n    Method = NotImplemented\n\n    def __init__(self):\n        super().__init__()\n        self.corpus = None\n        self.method = None\n        self.new_corpus = None\n        self.new_attrs = None\n\n        box = QGroupBox(title='Options')\n        box.setLayout(self.create_configuration_layout())\n        self.controlArea.layout().addWidget(box)\n\n        output_layout = gui.hBox(self.controlArea)\n        gui.checkBox(output_layout, self, \"hidden_cb\", \"Hide bow attributes\",\n                     callback=self.hide_attrs)\n\n        buttons_layout = gui.hBox(self.controlArea)\n        gui.auto_commit(buttons_layout, self, 'autocommit', 'Commit', box=False)\n        self.update_method()\n\n    @Inputs.corpus\n    def set_data(self, data):\n        self.corpus = data\n        self.invalidate()\n\n    def hide_attrs(self):\n        if self.new_corpus:\n            new_domain = self.new_corpus.domain\n            for f in new_domain.attributes:\n                if f.name in self.new_attrs:\n                    f.attributes['hidden'] = self.hidden_cb\n            self.new_corpus = self.new_corpus.transform(new_domain)\n            self.commit()\n\n    def commit(self):\n        self.Outputs.corpus.send(self.new_corpus)\n\n    def apply(self):\n        if self.corpus is not None:\n            self.new_corpus = self.method.transform(self.corpus)\n            self.new_attrs = {f.name for f in self.new_corpus.domain.attributes} \\\n                - {f.name for f in self.corpus.domain.attributes}\n\n    def invalidate(self):\n        self.apply()\n        self.hide_attrs()\n        self.commit()\n\n    def update_method(self):\n        self.method = self.Method()\n\n    def on_change(self):\n        self.update_method()\n        self.invalidate()\n\n    def send_report(self):\n        self.report_items(self.method.report())\n\n    def create_configuration_layout(self):\n        return QVBoxLayout()\n", "path": "orangecontrib/text/widgets/utils/owbasevectorizer.py"}]}