We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
GitCommitBear: Check for "wip" at staart of commit message


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bears/vcs/git/GitCommitBear.py`
Content:
```
1 import nltk
2 import re
3 import shutil
4 import os
5 
6 from coalib.bears.GlobalBear import GlobalBear
7 from coalib.misc.ContextManagers import change_directory
8 from coalib.misc.Shell import run_shell_command
9 from coalib.results.Result import Result
10 
11 
12 class GitCommitBear(GlobalBear):
13 
14     @classmethod
15     def check_prerequisites(cls):
16         if shutil.which("git") is None:
17             return "git is not installed."
18         else:
19             return True
20 
21     def run(self,
22             shortlog_length: int=50,
23             body_line_length: int=72,
24             force_body: bool=False,
25             allow_empty_commit_message: bool=False,
26             shortlog_regex: str="",
27             shortlog_trailing_period: bool=None,
28             shortlog_imperative_check: bool=True):
29         """
30         Check the current git commit message at HEAD.
31 
32         This bear ensures that the shortlog and body do not exceed a given
33         line-length and that a newline lies between them.
34 
35         :param shortlog_length:            The maximum length of the shortlog.
36                                            The shortlog is the first line of
37                                            the commit message. The newline
38                                            character at end does not count to
39                                            the length.
40         :param body_line_length:           The maximum line-length of the body.
41                                            The newline character at each line
42                                            end does not count to the length.
43         :param force_body:                 Whether a body shall exist or not.
44         :param allow_empty_commit_message: Whether empty commit messages are
45                                            allowed or not.
46         :param shortlog_regex:             A regex to check the shortlog with.
47                                            A full match of this regex is then
48                                            required. Passing an empty string
49                                            disable the regex-check.
50         :param shortlog_trailing_period:   Whether a dot shall be enforced at
51                                            the end of the shortlog line.
52                                            Providing ``None`` means
53                                            "doesn't care".
54         :param shortlog_imperative_check:
55             Whether an imperative check shall be applied to shortlog and
56             providing ``False`` would prohibit the check.
57         """
58         with change_directory(self.get_config_dir() or os.getcwd()):
59             stdout, stderr = run_shell_command("git log -1 --pretty=%B")
60 
61         if stderr:
62             self.err("git:", repr(stderr))
63             return
64 
65         stdout = stdout.rstrip("\n").splitlines()
66 
67         if len(stdout) == 0:
68             if not allow_empty_commit_message:
69                 yield Result(self, "HEAD commit has no message.")
70             return
71 
72         yield from self.check_shortlog(shortlog_length,
73                                        shortlog_regex,
74                                        shortlog_trailing_period,
75                                        shortlog_imperative_check,
76                                        stdout[0])
77         yield from self.check_body(body_line_length, force_body, stdout[1:])
78 
79     def check_shortlog(self,
80                        shortlog_length,
81                        regex,
82                        shortlog_trailing_period,
83                        shortlog_imperative_check,
84                        shortlog):
85         """
86         Checks the given shortlog.
87 
88         :param shortlog_length:          The maximum length of the shortlog.
89                                          The newline character at end does not
90                                          count to the length.
91         :param regex:                    A regex to check the shortlog with.
92         :param shortlog_trailing_period: Whether a dot shall be enforced at end
93                                          end or not (or ``None`` for "don't
94                                          care").
95         :param shortlog:                 The shortlog message string.
96         """
97         diff = len(shortlog) - shortlog_length
98         if diff > 0:
99             yield Result(self,
100                          "Shortlog of HEAD commit is {} character(s) longer "
101                          "than the limit ({} > {}).".format(
102                              diff, len(shortlog), shortlog_length))
103 
104         if (shortlog[-1] != ".") == shortlog_trailing_period:
105             yield Result(self,
106                          "Shortlog of HEAD commit contains no period at end."
107                          if shortlog_trailing_period else
108                          "Shortlog of HEAD commit contains a period at end.")
109 
110         if regex != "":
111             match = re.match(regex, shortlog)
112             # fullmatch() inside re-module exists sadly since 3.4, but we
113             # support 3.3 so we need to check that the regex matched completely
114             # ourselves.
115             if not match or match.end() != len(shortlog):
116                 yield Result(
117                     self,
118                     "Shortlog of HEAD commit does not match given regex.")
119 
120         if shortlog_imperative_check:
121             colon_pos = shortlog.find(':')
122             shortlog = shortlog[colon_pos + 1:] if colon_pos != -1 else shortlog
123             has_flaws = self.check_imperative(shortlog)
124             if has_flaws:
125                 bad_word = has_flaws[0]
126                 yield Result(self,
127                              "Shortlog of HEAD commit isn't imperative mood, "
128                              "bad words are '{}'".format(bad_word))
129 
130     def check_imperative(self, paragraph):
131         """
132         Check the given sentence/s for Imperatives.
133 
134         :param paragraph:
135             The input paragraph to be tested.
136         :returns:
137             A list of tuples having 2 elements (invalid word, parts of speech)
138             or an empty list if no invalid words are found.
139         """
140         try:
141             words = nltk.word_tokenize(nltk.sent_tokenize(paragraph)[0])
142             # VBZ : Verb, 3rd person singular present, like 'adds', 'writes' etc
143             # VBD : Verb, Past tense , like 'added', 'wrote' etc
144             # VBG : Verb, Present participle, like 'adding', 'writing'
145             word, tag = nltk.pos_tag(['I'] + words)[1:2][0]
146             if(tag.startswith('VBZ') or
147                tag.startswith('VBD') or
148                tag.startswith('VBG') or
149                word.endswith('ing')):  # Handle special case for VBG
150                 return (word, tag)
151             else:
152                 return None
153         except LookupError as error:  # pragma: no cover
154             self.err("NLTK data missing, install by running following commands "
155                      "`python -m nltk.downloader punkt"
156                      " maxent_treebank_pos_tagger averaged_perceptron_tagger`")
157             return
158 
159     def check_body(self, body_line_length, force_body, body):
160         """
161         Checks the given commit body.
162 
163         :param body_line_length: The maximum line-length of the body. The
164                                  newline character at each line end does not
165                                  count to the length.
166         :param force_body:       Whether a body shall exist or not.
167         :param body:             The commit body splitted by lines.
168         """
169         if len(body) == 0:
170             if force_body:
171                 yield Result(self, "No commit message body at HEAD.")
172             return
173 
174         if body[0] != "":
175             yield Result(self, "No newline between shortlog and body at HEAD.")
176             return
177 
178         if any(len(line) > body_line_length for line in body[1:]):
179             yield Result(self, "Body of HEAD commit contains too long lines.")
180
```
--- 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/bears/vcs/git/GitCommitBear.py b/bears/vcs/git/GitCommitBear.py
--- a/bears/vcs/git/GitCommitBear.py
+++ b/bears/vcs/git/GitCommitBear.py
@@ -7,6 +7,7 @@
 from coalib.misc.ContextManagers import change_directory
 from coalib.misc.Shell import run_shell_command
 from coalib.results.Result import Result
+from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
 
 
 class GitCommitBear(GlobalBear):
@@ -25,7 +26,8 @@
             allow_empty_commit_message: bool=False,
             shortlog_regex: str="",
             shortlog_trailing_period: bool=None,
-            shortlog_imperative_check: bool=True):
+            shortlog_imperative_check: bool=True,
+            shortlog_wip_check: bool=False):
         """
         Check the current git commit message at HEAD.
 
@@ -54,6 +56,9 @@
         :param shortlog_imperative_check:
             Whether an imperative check shall be applied to shortlog and
             providing ``False`` would prohibit the check.
+        :param shortlog_wip_check:
+            Whether a wip in the shortlog should yield a major result
+            or not.
         """
         with change_directory(self.get_config_dir() or os.getcwd()):
             stdout, stderr = run_shell_command("git log -1 --pretty=%B")
@@ -73,6 +78,7 @@
                                        shortlog_regex,
                                        shortlog_trailing_period,
                                        shortlog_imperative_check,
+                                       shortlog_wip_check,
                                        stdout[0])
         yield from self.check_body(body_line_length, force_body, stdout[1:])
 
@@ -81,6 +87,7 @@
                        regex,
                        shortlog_trailing_period,
                        shortlog_imperative_check,
+                       shortlog_wip_check,
                        shortlog):
         """
         Checks the given shortlog.
@@ -92,6 +99,8 @@
         :param shortlog_trailing_period: Whether a dot shall be enforced at end
                                          end or not (or ``None`` for "don't
                                          care").
+        :param shortlog_wip_check:       Whether a wip in the shortlog should
+                                         yield a major result or not.
         :param shortlog:                 The shortlog message string.
         """
         diff = len(shortlog) - shortlog_length
@@ -126,6 +135,12 @@
                 yield Result(self,
                              "Shortlog of HEAD commit isn't imperative mood, "
                              "bad words are '{}'".format(bad_word))
+        if shortlog_wip_check:
+            if "wip" in shortlog.lower()[:4]:
+                yield Result(self,
+                             "This commit seems to be marked as work in "
+                             "progress and should not be used in production. "
+                             "Tread carefully.", severity=RESULT_SEVERITY.MAJOR)
 
     def check_imperative(self, paragraph):
         """

{"golden_diff": "diff --git a/bears/vcs/git/GitCommitBear.py b/bears/vcs/git/GitCommitBear.py\n--- a/bears/vcs/git/GitCommitBear.py\n+++ b/bears/vcs/git/GitCommitBear.py\n@@ -7,6 +7,7 @@\n from coalib.misc.ContextManagers import change_directory\n from coalib.misc.Shell import run_shell_command\n from coalib.results.Result import Result\n+from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY\n \n \n class GitCommitBear(GlobalBear):\n@@ -25,7 +26,8 @@\n             allow_empty_commit_message: bool=False,\n             shortlog_regex: str=\"\",\n             shortlog_trailing_period: bool=None,\n-            shortlog_imperative_check: bool=True):\n+            shortlog_imperative_check: bool=True,\n+            shortlog_wip_check: bool=False):\n         \"\"\"\n         Check the current git commit message at HEAD.\n \n@@ -54,6 +56,9 @@\n         :param shortlog_imperative_check:\n             Whether an imperative check shall be applied to shortlog and\n             providing ``False`` would prohibit the check.\n+        :param shortlog_wip_check:\n+            Whether a wip in the shortlog should yield a major result\n+            or not.\n         \"\"\"\n         with change_directory(self.get_config_dir() or os.getcwd()):\n             stdout, stderr = run_shell_command(\"git log -1 --pretty=%B\")\n@@ -73,6 +78,7 @@\n                                        shortlog_regex,\n                                        shortlog_trailing_period,\n                                        shortlog_imperative_check,\n+                                       shortlog_wip_check,\n                                        stdout[0])\n         yield from self.check_body(body_line_length, force_body, stdout[1:])\n \n@@ -81,6 +87,7 @@\n                        regex,\n                        shortlog_trailing_period,\n                        shortlog_imperative_check,\n+                       shortlog_wip_check,\n                        shortlog):\n         \"\"\"\n         Checks the given shortlog.\n@@ -92,6 +99,8 @@\n         :param shortlog_trailing_period: Whether a dot shall be enforced at end\n                                          end or not (or ``None`` for \"don't\n                                          care\").\n+        :param shortlog_wip_check:       Whether a wip in the shortlog should\n+                                         yield a major result or not.\n         :param shortlog:                 The shortlog message string.\n         \"\"\"\n         diff = len(shortlog) - shortlog_length\n@@ -126,6 +135,12 @@\n                 yield Result(self,\n                              \"Shortlog of HEAD commit isn't imperative mood, \"\n                              \"bad words are '{}'\".format(bad_word))\n+        if shortlog_wip_check:\n+            if \"wip\" in shortlog.lower()[:4]:\n+                yield Result(self,\n+                             \"This commit seems to be marked as work in \"\n+                             \"progress and should not be used in production. \"\n+                             \"Tread carefully.\", severity=RESULT_SEVERITY.MAJOR)\n \n     def check_imperative(self, paragraph):\n         \"\"\"\n", "issue": "GitCommitBear: Check for \"wip\" at staart of commit message\n\n", "before_files": [{"content": "import nltk\nimport re\nimport shutil\nimport os\n\nfrom coalib.bears.GlobalBear import GlobalBear\nfrom coalib.misc.ContextManagers import change_directory\nfrom coalib.misc.Shell import run_shell_command\nfrom coalib.results.Result import Result\n\n\nclass GitCommitBear(GlobalBear):\n\n    @classmethod\n    def check_prerequisites(cls):\n        if shutil.which(\"git\") is None:\n            return \"git is not installed.\"\n        else:\n            return True\n\n    def run(self,\n            shortlog_length: int=50,\n            body_line_length: int=72,\n            force_body: bool=False,\n            allow_empty_commit_message: bool=False,\n            shortlog_regex: str=\"\",\n            shortlog_trailing_period: bool=None,\n            shortlog_imperative_check: bool=True):\n        \"\"\"\n        Check the current git commit message at HEAD.\n\n        This bear ensures that the shortlog and body do not exceed a given\n        line-length and that a newline lies between them.\n\n        :param shortlog_length:            The maximum length of the shortlog.\n                                           The shortlog is the first line of\n                                           the commit message. The newline\n                                           character at end does not count to\n                                           the length.\n        :param body_line_length:           The maximum line-length of the body.\n                                           The newline character at each line\n                                           end does not count to the length.\n        :param force_body:                 Whether a body shall exist or not.\n        :param allow_empty_commit_message: Whether empty commit messages are\n                                           allowed or not.\n        :param shortlog_regex:             A regex to check the shortlog with.\n                                           A full match of this regex is then\n                                           required. Passing an empty string\n                                           disable the regex-check.\n        :param shortlog_trailing_period:   Whether a dot shall be enforced at\n                                           the end of the shortlog line.\n                                           Providing ``None`` means\n                                           \"doesn't care\".\n        :param shortlog_imperative_check:\n            Whether an imperative check shall be applied to shortlog and\n            providing ``False`` would prohibit the check.\n        \"\"\"\n        with change_directory(self.get_config_dir() or os.getcwd()):\n            stdout, stderr = run_shell_command(\"git log -1 --pretty=%B\")\n\n        if stderr:\n            self.err(\"git:\", repr(stderr))\n            return\n\n        stdout = stdout.rstrip(\"\\n\").splitlines()\n\n        if len(stdout) == 0:\n            if not allow_empty_commit_message:\n                yield Result(self, \"HEAD commit has no message.\")\n            return\n\n        yield from self.check_shortlog(shortlog_length,\n                                       shortlog_regex,\n                                       shortlog_trailing_period,\n                                       shortlog_imperative_check,\n                                       stdout[0])\n        yield from self.check_body(body_line_length, force_body, stdout[1:])\n\n    def check_shortlog(self,\n                       shortlog_length,\n                       regex,\n                       shortlog_trailing_period,\n                       shortlog_imperative_check,\n                       shortlog):\n        \"\"\"\n        Checks the given shortlog.\n\n        :param shortlog_length:          The maximum length of the shortlog.\n                                         The newline character at end does not\n                                         count to the length.\n        :param regex:                    A regex to check the shortlog with.\n        :param shortlog_trailing_period: Whether a dot shall be enforced at end\n                                         end or not (or ``None`` for \"don't\n                                         care\").\n        :param shortlog:                 The shortlog message string.\n        \"\"\"\n        diff = len(shortlog) - shortlog_length\n        if diff > 0:\n            yield Result(self,\n                         \"Shortlog of HEAD commit is {} character(s) longer \"\n                         \"than the limit ({} > {}).\".format(\n                             diff, len(shortlog), shortlog_length))\n\n        if (shortlog[-1] != \".\") == shortlog_trailing_period:\n            yield Result(self,\n                         \"Shortlog of HEAD commit contains no period at end.\"\n                         if shortlog_trailing_period else\n                         \"Shortlog of HEAD commit contains a period at end.\")\n\n        if regex != \"\":\n            match = re.match(regex, shortlog)\n            # fullmatch() inside re-module exists sadly since 3.4, but we\n            # support 3.3 so we need to check that the regex matched completely\n            # ourselves.\n            if not match or match.end() != len(shortlog):\n                yield Result(\n                    self,\n                    \"Shortlog of HEAD commit does not match given regex.\")\n\n        if shortlog_imperative_check:\n            colon_pos = shortlog.find(':')\n            shortlog = shortlog[colon_pos + 1:] if colon_pos != -1 else shortlog\n            has_flaws = self.check_imperative(shortlog)\n            if has_flaws:\n                bad_word = has_flaws[0]\n                yield Result(self,\n                             \"Shortlog of HEAD commit isn't imperative mood, \"\n                             \"bad words are '{}'\".format(bad_word))\n\n    def check_imperative(self, paragraph):\n        \"\"\"\n        Check the given sentence/s for Imperatives.\n\n        :param paragraph:\n            The input paragraph to be tested.\n        :returns:\n            A list of tuples having 2 elements (invalid word, parts of speech)\n            or an empty list if no invalid words are found.\n        \"\"\"\n        try:\n            words = nltk.word_tokenize(nltk.sent_tokenize(paragraph)[0])\n            # VBZ : Verb, 3rd person singular present, like 'adds', 'writes' etc\n            # VBD : Verb, Past tense , like 'added', 'wrote' etc\n            # VBG : Verb, Present participle, like 'adding', 'writing'\n            word, tag = nltk.pos_tag(['I'] + words)[1:2][0]\n            if(tag.startswith('VBZ') or\n               tag.startswith('VBD') or\n               tag.startswith('VBG') or\n               word.endswith('ing')):  # Handle special case for VBG\n                return (word, tag)\n            else:\n                return None\n        except LookupError as error:  # pragma: no cover\n            self.err(\"NLTK data missing, install by running following commands \"\n                     \"`python -m nltk.downloader punkt\"\n                     \" maxent_treebank_pos_tagger averaged_perceptron_tagger`\")\n            return\n\n    def check_body(self, body_line_length, force_body, body):\n        \"\"\"\n        Checks the given commit body.\n\n        :param body_line_length: The maximum line-length of the body. The\n                                 newline character at each line end does not\n                                 count to the length.\n        :param force_body:       Whether a body shall exist or not.\n        :param body:             The commit body splitted by lines.\n        \"\"\"\n        if len(body) == 0:\n            if force_body:\n                yield Result(self, \"No commit message body at HEAD.\")\n            return\n\n        if body[0] != \"\":\n            yield Result(self, \"No newline between shortlog and body at HEAD.\")\n            return\n\n        if any(len(line) > body_line_length for line in body[1:]):\n            yield Result(self, \"Body of HEAD commit contains too long lines.\")\n", "path": "bears/vcs/git/GitCommitBear.py"}], "after_files": [{"content": "import nltk\nimport re\nimport shutil\nimport os\n\nfrom coalib.bears.GlobalBear import GlobalBear\nfrom coalib.misc.ContextManagers import change_directory\nfrom coalib.misc.Shell import run_shell_command\nfrom coalib.results.Result import Result\nfrom coalib.results.RESULT_SEVERITY import RESULT_SEVERITY\n\n\nclass GitCommitBear(GlobalBear):\n\n    @classmethod\n    def check_prerequisites(cls):\n        if shutil.which(\"git\") is None:\n            return \"git is not installed.\"\n        else:\n            return True\n\n    def run(self,\n            shortlog_length: int=50,\n            body_line_length: int=72,\n            force_body: bool=False,\n            allow_empty_commit_message: bool=False,\n            shortlog_regex: str=\"\",\n            shortlog_trailing_period: bool=None,\n            shortlog_imperative_check: bool=True,\n            shortlog_wip_check: bool=False):\n        \"\"\"\n        Check the current git commit message at HEAD.\n\n        This bear ensures that the shortlog and body do not exceed a given\n        line-length and that a newline lies between them.\n\n        :param shortlog_length:            The maximum length of the shortlog.\n                                           The shortlog is the first line of\n                                           the commit message. The newline\n                                           character at end does not count to\n                                           the length.\n        :param body_line_length:           The maximum line-length of the body.\n                                           The newline character at each line\n                                           end does not count to the length.\n        :param force_body:                 Whether a body shall exist or not.\n        :param allow_empty_commit_message: Whether empty commit messages are\n                                           allowed or not.\n        :param shortlog_regex:             A regex to check the shortlog with.\n                                           A full match of this regex is then\n                                           required. Passing an empty string\n                                           disable the regex-check.\n        :param shortlog_trailing_period:   Whether a dot shall be enforced at\n                                           the end of the shortlog line.\n                                           Providing ``None`` means\n                                           \"doesn't care\".\n        :param shortlog_imperative_check:\n            Whether an imperative check shall be applied to shortlog and\n            providing ``False`` would prohibit the check.\n        :param shortlog_wip_check:\n            Whether a wip in the shortlog should yield a major result\n            or not.\n        \"\"\"\n        with change_directory(self.get_config_dir() or os.getcwd()):\n            stdout, stderr = run_shell_command(\"git log -1 --pretty=%B\")\n\n        if stderr:\n            self.err(\"git:\", repr(stderr))\n            return\n\n        stdout = stdout.rstrip(\"\\n\").splitlines()\n\n        if len(stdout) == 0:\n            if not allow_empty_commit_message:\n                yield Result(self, \"HEAD commit has no message.\")\n            return\n\n        yield from self.check_shortlog(shortlog_length,\n                                       shortlog_regex,\n                                       shortlog_trailing_period,\n                                       shortlog_imperative_check,\n                                       shortlog_wip_check,\n                                       stdout[0])\n        yield from self.check_body(body_line_length, force_body, stdout[1:])\n\n    def check_shortlog(self,\n                       shortlog_length,\n                       regex,\n                       shortlog_trailing_period,\n                       shortlog_imperative_check,\n                       shortlog_wip_check,\n                       shortlog):\n        \"\"\"\n        Checks the given shortlog.\n\n        :param shortlog_length:          The maximum length of the shortlog.\n                                         The newline character at end does not\n                                         count to the length.\n        :param regex:                    A regex to check the shortlog with.\n        :param shortlog_trailing_period: Whether a dot shall be enforced at end\n                                         end or not (or ``None`` for \"don't\n                                         care\").\n        :param shortlog_wip_check:       Whether a wip in the shortlog should\n                                         yield a major result or not.\n        :param shortlog:                 The shortlog message string.\n        \"\"\"\n        diff = len(shortlog) - shortlog_length\n        if diff > 0:\n            yield Result(self,\n                         \"Shortlog of HEAD commit is {} character(s) longer \"\n                         \"than the limit ({} > {}).\".format(\n                             diff, len(shortlog), shortlog_length))\n\n        if (shortlog[-1] != \".\") == shortlog_trailing_period:\n            yield Result(self,\n                         \"Shortlog of HEAD commit contains no period at end.\"\n                         if shortlog_trailing_period else\n                         \"Shortlog of HEAD commit contains a period at end.\")\n\n        if regex != \"\":\n            match = re.match(regex, shortlog)\n            # fullmatch() inside re-module exists sadly since 3.4, but we\n            # support 3.3 so we need to check that the regex matched completely\n            # ourselves.\n            if not match or match.end() != len(shortlog):\n                yield Result(\n                    self,\n                    \"Shortlog of HEAD commit does not match given regex.\")\n\n        if shortlog_imperative_check:\n            colon_pos = shortlog.find(':')\n            shortlog = shortlog[colon_pos + 1:] if colon_pos != -1 else shortlog\n            has_flaws = self.check_imperative(shortlog)\n            if has_flaws:\n                bad_word = has_flaws[0]\n                yield Result(self,\n                             \"Shortlog of HEAD commit isn't imperative mood, \"\n                             \"bad words are '{}'\".format(bad_word))\n        if shortlog_wip_check:\n            if \"wip\" in shortlog.lower()[:4]:\n                yield Result(self,\n                             \"This commit seems to be marked as work in \"\n                             \"progress and should not be used in production. \"\n                             \"Tread carefully.\", severity=RESULT_SEVERITY.MAJOR)\n\n    def check_imperative(self, paragraph):\n        \"\"\"\n        Check the given sentence/s for Imperatives.\n\n        :param paragraph:\n            The input paragraph to be tested.\n        :returns:\n            A list of tuples having 2 elements (invalid word, parts of speech)\n            or an empty list if no invalid words are found.\n        \"\"\"\n        try:\n            words = nltk.word_tokenize(nltk.sent_tokenize(paragraph)[0])\n            # VBZ : Verb, 3rd person singular present, like 'adds', 'writes' etc\n            # VBD : Verb, Past tense , like 'added', 'wrote' etc\n            # VBG : Verb, Present participle, like 'adding', 'writing'\n            word, tag = nltk.pos_tag(['I'] + words)[1:2][0]\n            if(tag.startswith('VBZ') or\n               tag.startswith('VBD') or\n               tag.startswith('VBG') or\n               word.endswith('ing')):  # Handle special case for VBG\n                return (word, tag)\n            else:\n                return None\n        except LookupError as error:  # pragma: no cover\n            self.err(\"NLTK data missing, install by running following commands \"\n                     \"`python -m nltk.downloader punkt\"\n                     \" maxent_treebank_pos_tagger averaged_perceptron_tagger`\")\n            return\n\n    def check_body(self, body_line_length, force_body, body):\n        \"\"\"\n        Checks the given commit body.\n\n        :param body_line_length: The maximum line-length of the body. The\n                                 newline character at each line end does not\n                                 count to the length.\n        :param force_body:       Whether a body shall exist or not.\n        :param body:             The commit body splitted by lines.\n        \"\"\"\n        if len(body) == 0:\n            if force_body:\n                yield Result(self, \"No commit message body at HEAD.\")\n            return\n\n        if body[0] != \"\":\n            yield Result(self, \"No newline between shortlog and body at HEAD.\")\n            return\n\n        if any(len(line) > body_line_length for line in body[1:]):\n            yield Result(self, \"Body of HEAD commit contains too long lines.\")\n", "path": "bears/vcs/git/GitCommitBear.py"}]}