We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Create a classifier to detect bugs that need QA
Needed for https://github.com/mozilla/relman-auto-nag/issues/227.

To do this, we'll need to collect some labels.
We can automatically create some positive labels by getting bugs that have the `qawanted` keyword or that have `qe-verify` flag.
We can't automatically create negative labels because we can't be sure that QA was not needed when the keyword/flag was not set.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bugbug/models/qaneeded.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 # You can obtain one at http://mozilla.org/MPL/2.0/.
5 
6 import xgboost
7 from sklearn.feature_extraction import DictVectorizer
8 from sklearn.pipeline import FeatureUnion
9 from sklearn.pipeline import Pipeline
10 
11 from bugbug import bug_features
12 from bugbug import labels
13 from bugbug.model import Model
14 from bugbug.utils import DictSelector
15 
16 
17 class QANeededModel(Model):
18     def __init__(self, lemmatization=False):
19         Model.__init__(self, lemmatization)
20 
21         self.classes = labels.get_qa_needed_labels()
22 
23         feature_extractors = [
24             bug_features.has_str(),
25             bug_features.has_regression_range(),
26             bug_features.severity(),
27             bug_features.keywords(),
28             bug_features.is_coverity_issue(),
29             bug_features.has_crash_signature(),
30             bug_features.has_url(),
31             bug_features.has_w3c_url(),
32             bug_features.has_github_url(),
33             bug_features.whiteboard(),
34             bug_features.patches(),
35             bug_features.landings(),
36             bug_features.title(),
37             bug_features.comments(),
38         ]
39 
40         self.extraction_pipeline = Pipeline([
41             ('bug_extractor', bug_features.BugExtractor(feature_extractors)),
42             ('union', FeatureUnion(
43                 transformer_list=[
44                     ('data', Pipeline([
45                         ('selector', DictSelector(key='data')),
46                         ('vect', DictVectorizer()),
47                     ])),
48 
49                     ('title', Pipeline([
50                         ('selector', DictSelector(key='title')),
51                         ('tfidf', self.text_vectorizer(stop_words='english')),
52                     ])),
53 
54                     ('comments', Pipeline([
55                         ('selector', DictSelector(key='comments')),
56                         ('tfidf', self.text_vectorizer(stop_words='english')),
57                     ])),
58                 ],
59             )),
60         ])
61 
62         self.clf = xgboost.XGBClassifier(n_jobs=16)
63
```
--- 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/bugbug/models/qaneeded.py b/bugbug/models/qaneeded.py
--- a/bugbug/models/qaneeded.py
+++ b/bugbug/models/qaneeded.py
@@ -24,7 +24,7 @@
             bug_features.has_str(),
             bug_features.has_regression_range(),
             bug_features.severity(),
-            bug_features.keywords(),
+            bug_features.keywords(set(['qawanted'])),
             bug_features.is_coverity_issue(),
             bug_features.has_crash_signature(),
             bug_features.has_url(),

{"golden_diff": "diff --git a/bugbug/models/qaneeded.py b/bugbug/models/qaneeded.py\n--- a/bugbug/models/qaneeded.py\n+++ b/bugbug/models/qaneeded.py\n@@ -24,7 +24,7 @@\n             bug_features.has_str(),\n             bug_features.has_regression_range(),\n             bug_features.severity(),\n-            bug_features.keywords(),\n+            bug_features.keywords(set(['qawanted'])),\n             bug_features.is_coverity_issue(),\n             bug_features.has_crash_signature(),\n             bug_features.has_url(),\n", "issue": "Create a classifier to detect bugs that need QA\nNeeded for https://github.com/mozilla/relman-auto-nag/issues/227.\r\n\r\nTo do this, we'll need to collect some labels.\r\nWe can automatically create some positive labels by getting bugs that have the `qawanted` keyword or that have `qe-verify` flag.\r\nWe can't automatically create negative labels because we can't be sure that QA was not needed when the keyword/flag was not set.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at http://mozilla.org/MPL/2.0/.\n\nimport xgboost\nfrom sklearn.feature_extraction import DictVectorizer\nfrom sklearn.pipeline import FeatureUnion\nfrom sklearn.pipeline import Pipeline\n\nfrom bugbug import bug_features\nfrom bugbug import labels\nfrom bugbug.model import Model\nfrom bugbug.utils import DictSelector\n\n\nclass QANeededModel(Model):\n    def __init__(self, lemmatization=False):\n        Model.__init__(self, lemmatization)\n\n        self.classes = labels.get_qa_needed_labels()\n\n        feature_extractors = [\n            bug_features.has_str(),\n            bug_features.has_regression_range(),\n            bug_features.severity(),\n            bug_features.keywords(),\n            bug_features.is_coverity_issue(),\n            bug_features.has_crash_signature(),\n            bug_features.has_url(),\n            bug_features.has_w3c_url(),\n            bug_features.has_github_url(),\n            bug_features.whiteboard(),\n            bug_features.patches(),\n            bug_features.landings(),\n            bug_features.title(),\n            bug_features.comments(),\n        ]\n\n        self.extraction_pipeline = Pipeline([\n            ('bug_extractor', bug_features.BugExtractor(feature_extractors)),\n            ('union', FeatureUnion(\n                transformer_list=[\n                    ('data', Pipeline([\n                        ('selector', DictSelector(key='data')),\n                        ('vect', DictVectorizer()),\n                    ])),\n\n                    ('title', Pipeline([\n                        ('selector', DictSelector(key='title')),\n                        ('tfidf', self.text_vectorizer(stop_words='english')),\n                    ])),\n\n                    ('comments', Pipeline([\n                        ('selector', DictSelector(key='comments')),\n                        ('tfidf', self.text_vectorizer(stop_words='english')),\n                    ])),\n                ],\n            )),\n        ])\n\n        self.clf = xgboost.XGBClassifier(n_jobs=16)\n", "path": "bugbug/models/qaneeded.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at http://mozilla.org/MPL/2.0/.\n\nimport xgboost\nfrom sklearn.feature_extraction import DictVectorizer\nfrom sklearn.pipeline import FeatureUnion\nfrom sklearn.pipeline import Pipeline\n\nfrom bugbug import bug_features\nfrom bugbug import labels\nfrom bugbug.model import Model\nfrom bugbug.utils import DictSelector\n\n\nclass QANeededModel(Model):\n    def __init__(self, lemmatization=False):\n        Model.__init__(self, lemmatization)\n\n        self.classes = labels.get_qa_needed_labels()\n\n        feature_extractors = [\n            bug_features.has_str(),\n            bug_features.has_regression_range(),\n            bug_features.severity(),\n            bug_features.keywords(set(['qawanted'])),\n            bug_features.is_coverity_issue(),\n            bug_features.has_crash_signature(),\n            bug_features.has_url(),\n            bug_features.has_w3c_url(),\n            bug_features.has_github_url(),\n            bug_features.whiteboard(),\n            bug_features.patches(),\n            bug_features.landings(),\n            bug_features.title(),\n            bug_features.comments(),\n        ]\n\n        self.extraction_pipeline = Pipeline([\n            ('bug_extractor', bug_features.BugExtractor(feature_extractors)),\n            ('union', FeatureUnion(\n                transformer_list=[\n                    ('data', Pipeline([\n                        ('selector', DictSelector(key='data')),\n                        ('vect', DictVectorizer()),\n                    ])),\n\n                    ('title', Pipeline([\n                        ('selector', DictSelector(key='title')),\n                        ('tfidf', self.text_vectorizer(stop_words='english')),\n                    ])),\n\n                    ('comments', Pipeline([\n                        ('selector', DictSelector(key='comments')),\n                        ('tfidf', self.text_vectorizer(stop_words='english')),\n                    ])),\n                ],\n            )),\n        ])\n\n        self.clf = xgboost.XGBClassifier(n_jobs=16)\n", "path": "bugbug/models/qaneeded.py"}]}