We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
js_minimizer is not callable
The following run function of JSMinimizer class is not callable as `js_minimizer` is an object and not a function, thus it should not be callable.

```
    js_tokenizer = AntlrTokenizer(JavaScriptLexer)

    js_minimizer = JSMinimizer(
        utils.test,
        max_threads=thread_count,
        tokenizer=js_tokenizer.tokenize,
        token_combiner=js_tokenizer.combine,
        file_extension=file_extension)

    result = line_minimizer.minimize(data)
    result = js_minimizer(result)
    result = js_minimizer(result)
    result = line_minimizer.minimize(result)
```

Location in codebase [here](https://github.com/google/clusterfuzz/blob/master/src/python/bot/minimizer/js_minimizer.py#L187).

Also, does js_minimizer should be called two times?
I guess `js_minimizer(result)` should be replaced with `js_minimizer.minimize(data)`, but I am not really sure. Can someone please confirm if it is a bug or not?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/python/bot/minimizer/js_minimizer.py`
Content:
```
1 # Copyright 2019 Google LLC
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """Minimizer used for additional reduction on javascript test cases."""
15 from __future__ import absolute_import
16 
17 from builtins import range
18 
19 from . import delta_minimizer
20 from . import errors
21 from . import minimizer
22 from . import utils
23 
24 from bot.tokenizer.antlr_tokenizer import AntlrTokenizer
25 from bot.tokenizer.grammars.JavaScriptLexer import JavaScriptLexer
26 
27 
28 def step_back_while(cur_index, condition):
29   """Helper function. Decreases index from cur while condition is satisfied."""
30   while cur_index >= 0 and condition(cur_index):
31     cur_index -= 1
32   return cur_index
33 
34 
35 class JSMinimizer(minimizer.Minimizer):
36   """Intended as a second-pass minimizer to remove unneeded tokens from JS."""
37 
38   def _execute(self, data):
39     testcase = minimizer.Testcase(data, self)
40     if not self.validate_tokenizer(data, testcase):
41       raise errors.TokenizationFailureError('JS Minimizer')
42 
43     brace_stack = []
44     paren_stack = []
45 
46     for index, token in enumerate(testcase.tokens):
47       if token == '{':
48         brace_stack.append(index)
49 
50       elif token == '}' and brace_stack:
51 
52         # Two hypotheses for tokens grouped by curly braces:
53         # 1) Remove from start of line to open brace and the closing brace.
54         #    e.g.: if (statement_that_evaluates_to_true) { crash() } -> crash()
55         open_brace_index = brace_stack.pop()
56 
57         # Find the first non-empty token prior to the starting brackets.
58         token_before_bracket = step_back_while(
59             open_brace_index - 1, (lambda x: not testcase.tokens[x].strip()))
60 
61         # If that token is a close paren, we need to grab everything else too.
62         # Do this to grab the whole paren so we don't create a syntax error by
63         # removing only part of a paren.
64         if testcase.tokens[token_before_bracket] == ')':
65           # Find everything in the paren.
66           token_before_bracket = step_back_while(
67               token_before_bracket, (lambda x: testcase.tokens[x] != '('))
68 
69           # Get the token before the paren.
70           token_before_bracket -= 1
71           token_before_bracket = step_back_while(
72               token_before_bracket, (lambda x: not testcase.tokens[x].strip()))
73 
74         # Walk back to the start of that line as well to get if/else and funcs.
75         # Do this after paren to manage situations where there are newlines in
76         # the parens.
77         token_before_bracket = step_back_while(
78             token_before_bracket, (lambda x: testcase.tokens[x] != '\n'))
79 
80         token_before_bracket += 1
81 
82         hypothesis = list(range(token_before_bracket,
83                                 open_brace_index + 1)) + [index]
84 
85         testcase.prepare_test(hypothesis)
86 
87         # 2) Remove previous tokens and from the closing brace to the next one.
88         #    e.g.: try { crash() } catch(e) {} -> crash().
89         future_index = len(testcase.tokens)
90         open_count = 0
91         for future_index in range(index + 1, len(testcase.tokens)):
92           if testcase.tokens[future_index] == '{':
93             open_count += 1
94           if testcase.tokens[future_index] == '}':
95             open_count -= 1
96             # Make sure to grab entire outer brace if there are inner braces.
97             if not open_count:
98               break
99         if future_index != len(testcase.tokens):
100           lookahead_hypothesis = hypothesis + list(
101               range(index + 1, future_index + 1))
102 
103           testcase.prepare_test(lookahead_hypothesis)
104 
105       elif token == '(':
106         paren_stack.append(index)
107 
108       elif token == ')' and paren_stack:
109         # Three hypotheses for tokens grouped by parentheses:
110         # 1) Remove the parentheses and the previous token.
111         #    e.g.: assertTrue(crash()); -> crash()
112         previous_end = paren_stack.pop()
113         if previous_end > 0:
114           hypothesis = [previous_end - 1, previous_end, index]
115           testcase.prepare_test(hypothesis)
116 
117         # 2) Remove everything between the parentheses.
118         #    e.g. crash(junk, more_junk) -> crash()
119         if index - previous_end > 1:
120           hypothesis = list(range(previous_end + 1, index))
121           testcase.prepare_test(hypothesis)
122 
123         # 3) Like 1, but to start of line instead of previous token.
124         #    e.g.: leftover_junk = (function() {
125         #          });
126 
127         # Find the beginning of the line
128         token_before_paren = previous_end
129         token_before_paren = step_back_while(
130             previous_end, (lambda x: testcase.tokens[x] != '\n'))
131         token_before_paren += 1
132 
133         hypothesis = list(range(token_before_paren, previous_end + 1)) + [index]
134         testcase.prepare_test(hypothesis)
135 
136         # 4) Like 3, but also from the closing brace to the next one.
137         #    e.g.: (function(global) { })(this);
138         future_index = len(testcase.tokens)
139         for future_index in range(index + 1, len(testcase.tokens)):
140           if testcase.tokens[future_index] == ')':
141             break
142         if future_index != len(testcase.tokens):
143           lookahead_hypothesis = list(
144               range(token_before_paren, future_index + 1))
145           testcase.prepare_test(lookahead_hypothesis)
146 
147       elif token == ',':
148         # Two hypotheses for commas:
149         # 1) Remove comma and left-hand-side.
150         #    e.g.: f(whatever, crash()) -> f(crash())
151         if index > 0:
152           hypothesis = [index - 1, index]
153           testcase.prepare_test(hypothesis)
154 
155         # 2) Remove comma and right-hand-side.
156         #    e.g.: f(crash(), whatever) -> f(crash())
157 
158         # Find the next non whitespace token after the comma.
159         hypothesis = [index]
160         for right_token_index in range(index + 1, len(testcase.tokens)):
161           hypothesis.append(right_token_index)
162           if testcase.tokens[right_token_index].strip():
163             testcase.prepare_test(hypothesis)
164             break
165 
166     testcase.process()
167     return testcase
168 
169   @staticmethod
170   def run(data,
171           thread_count=minimizer.DEFAULT_THREAD_COUNT,
172           file_extension='.js'):
173     """Attempt to minimize a javascript test case."""
174     line_minimizer = delta_minimizer.DeltaMinimizer(
175         utils.test, max_threads=thread_count, file_extension=file_extension)
176 
177     js_tokenizer = AntlrTokenizer(JavaScriptLexer)
178 
179     js_minimizer = JSMinimizer(
180         utils.test,
181         max_threads=thread_count,
182         tokenizer=js_tokenizer.tokenize,
183         token_combiner=js_tokenizer.combine,
184         file_extension=file_extension)
185 
186     result = line_minimizer.minimize(data)
187     result = js_minimizer(result)
188     result = js_minimizer(result)
189     result = line_minimizer.minimize(result)
190 
191     return result
192
```
--- 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/src/python/bot/minimizer/js_minimizer.py b/src/python/bot/minimizer/js_minimizer.py
--- a/src/python/bot/minimizer/js_minimizer.py
+++ b/src/python/bot/minimizer/js_minimizer.py
@@ -184,8 +184,8 @@
         file_extension=file_extension)
 
     result = line_minimizer.minimize(data)
-    result = js_minimizer(result)
-    result = js_minimizer(result)
+    result = js_minimizer.minimize(result)
+    result = js_minimizer.minimize(result)
     result = line_minimizer.minimize(result)
 
     return result

{"golden_diff": "diff --git a/src/python/bot/minimizer/js_minimizer.py b/src/python/bot/minimizer/js_minimizer.py\n--- a/src/python/bot/minimizer/js_minimizer.py\n+++ b/src/python/bot/minimizer/js_minimizer.py\n@@ -184,8 +184,8 @@\n         file_extension=file_extension)\n \n     result = line_minimizer.minimize(data)\n-    result = js_minimizer(result)\n-    result = js_minimizer(result)\n+    result = js_minimizer.minimize(result)\n+    result = js_minimizer.minimize(result)\n     result = line_minimizer.minimize(result)\n \n     return result\n", "issue": "js_minimizer is not callable\nThe following run function of JSMinimizer class is not callable as `js_minimizer` is an object and not a function, thus it should not be callable.\r\n\r\n```\r\n    js_tokenizer = AntlrTokenizer(JavaScriptLexer)\r\n\r\n    js_minimizer = JSMinimizer(\r\n        utils.test,\r\n        max_threads=thread_count,\r\n        tokenizer=js_tokenizer.tokenize,\r\n        token_combiner=js_tokenizer.combine,\r\n        file_extension=file_extension)\r\n\r\n    result = line_minimizer.minimize(data)\r\n    result = js_minimizer(result)\r\n    result = js_minimizer(result)\r\n    result = line_minimizer.minimize(result)\r\n```\r\n\r\nLocation in codebase [here](https://github.com/google/clusterfuzz/blob/master/src/python/bot/minimizer/js_minimizer.py#L187).\r\n\r\nAlso, does js_minimizer should be called two times?\r\nI guess `js_minimizer(result)` should be replaced with `js_minimizer.minimize(data)`, but I am not really sure. Can someone please confirm if it is a bug or not?\n", "before_files": [{"content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Minimizer used for additional reduction on javascript test cases.\"\"\"\nfrom __future__ import absolute_import\n\nfrom builtins import range\n\nfrom . import delta_minimizer\nfrom . import errors\nfrom . import minimizer\nfrom . import utils\n\nfrom bot.tokenizer.antlr_tokenizer import AntlrTokenizer\nfrom bot.tokenizer.grammars.JavaScriptLexer import JavaScriptLexer\n\n\ndef step_back_while(cur_index, condition):\n  \"\"\"Helper function. Decreases index from cur while condition is satisfied.\"\"\"\n  while cur_index >= 0 and condition(cur_index):\n    cur_index -= 1\n  return cur_index\n\n\nclass JSMinimizer(minimizer.Minimizer):\n  \"\"\"Intended as a second-pass minimizer to remove unneeded tokens from JS.\"\"\"\n\n  def _execute(self, data):\n    testcase = minimizer.Testcase(data, self)\n    if not self.validate_tokenizer(data, testcase):\n      raise errors.TokenizationFailureError('JS Minimizer')\n\n    brace_stack = []\n    paren_stack = []\n\n    for index, token in enumerate(testcase.tokens):\n      if token == '{':\n        brace_stack.append(index)\n\n      elif token == '}' and brace_stack:\n\n        # Two hypotheses for tokens grouped by curly braces:\n        # 1) Remove from start of line to open brace and the closing brace.\n        #    e.g.: if (statement_that_evaluates_to_true) { crash() } -> crash()\n        open_brace_index = brace_stack.pop()\n\n        # Find the first non-empty token prior to the starting brackets.\n        token_before_bracket = step_back_while(\n            open_brace_index - 1, (lambda x: not testcase.tokens[x].strip()))\n\n        # If that token is a close paren, we need to grab everything else too.\n        # Do this to grab the whole paren so we don't create a syntax error by\n        # removing only part of a paren.\n        if testcase.tokens[token_before_bracket] == ')':\n          # Find everything in the paren.\n          token_before_bracket = step_back_while(\n              token_before_bracket, (lambda x: testcase.tokens[x] != '('))\n\n          # Get the token before the paren.\n          token_before_bracket -= 1\n          token_before_bracket = step_back_while(\n              token_before_bracket, (lambda x: not testcase.tokens[x].strip()))\n\n        # Walk back to the start of that line as well to get if/else and funcs.\n        # Do this after paren to manage situations where there are newlines in\n        # the parens.\n        token_before_bracket = step_back_while(\n            token_before_bracket, (lambda x: testcase.tokens[x] != '\\n'))\n\n        token_before_bracket += 1\n\n        hypothesis = list(range(token_before_bracket,\n                                open_brace_index + 1)) + [index]\n\n        testcase.prepare_test(hypothesis)\n\n        # 2) Remove previous tokens and from the closing brace to the next one.\n        #    e.g.: try { crash() } catch(e) {} -> crash().\n        future_index = len(testcase.tokens)\n        open_count = 0\n        for future_index in range(index + 1, len(testcase.tokens)):\n          if testcase.tokens[future_index] == '{':\n            open_count += 1\n          if testcase.tokens[future_index] == '}':\n            open_count -= 1\n            # Make sure to grab entire outer brace if there are inner braces.\n            if not open_count:\n              break\n        if future_index != len(testcase.tokens):\n          lookahead_hypothesis = hypothesis + list(\n              range(index + 1, future_index + 1))\n\n          testcase.prepare_test(lookahead_hypothesis)\n\n      elif token == '(':\n        paren_stack.append(index)\n\n      elif token == ')' and paren_stack:\n        # Three hypotheses for tokens grouped by parentheses:\n        # 1) Remove the parentheses and the previous token.\n        #    e.g.: assertTrue(crash()); -> crash()\n        previous_end = paren_stack.pop()\n        if previous_end > 0:\n          hypothesis = [previous_end - 1, previous_end, index]\n          testcase.prepare_test(hypothesis)\n\n        # 2) Remove everything between the parentheses.\n        #    e.g. crash(junk, more_junk) -> crash()\n        if index - previous_end > 1:\n          hypothesis = list(range(previous_end + 1, index))\n          testcase.prepare_test(hypothesis)\n\n        # 3) Like 1, but to start of line instead of previous token.\n        #    e.g.: leftover_junk = (function() {\n        #          });\n\n        # Find the beginning of the line\n        token_before_paren = previous_end\n        token_before_paren = step_back_while(\n            previous_end, (lambda x: testcase.tokens[x] != '\\n'))\n        token_before_paren += 1\n\n        hypothesis = list(range(token_before_paren, previous_end + 1)) + [index]\n        testcase.prepare_test(hypothesis)\n\n        # 4) Like 3, but also from the closing brace to the next one.\n        #    e.g.: (function(global) { })(this);\n        future_index = len(testcase.tokens)\n        for future_index in range(index + 1, len(testcase.tokens)):\n          if testcase.tokens[future_index] == ')':\n            break\n        if future_index != len(testcase.tokens):\n          lookahead_hypothesis = list(\n              range(token_before_paren, future_index + 1))\n          testcase.prepare_test(lookahead_hypothesis)\n\n      elif token == ',':\n        # Two hypotheses for commas:\n        # 1) Remove comma and left-hand-side.\n        #    e.g.: f(whatever, crash()) -> f(crash())\n        if index > 0:\n          hypothesis = [index - 1, index]\n          testcase.prepare_test(hypothesis)\n\n        # 2) Remove comma and right-hand-side.\n        #    e.g.: f(crash(), whatever) -> f(crash())\n\n        # Find the next non whitespace token after the comma.\n        hypothesis = [index]\n        for right_token_index in range(index + 1, len(testcase.tokens)):\n          hypothesis.append(right_token_index)\n          if testcase.tokens[right_token_index].strip():\n            testcase.prepare_test(hypothesis)\n            break\n\n    testcase.process()\n    return testcase\n\n  @staticmethod\n  def run(data,\n          thread_count=minimizer.DEFAULT_THREAD_COUNT,\n          file_extension='.js'):\n    \"\"\"Attempt to minimize a javascript test case.\"\"\"\n    line_minimizer = delta_minimizer.DeltaMinimizer(\n        utils.test, max_threads=thread_count, file_extension=file_extension)\n\n    js_tokenizer = AntlrTokenizer(JavaScriptLexer)\n\n    js_minimizer = JSMinimizer(\n        utils.test,\n        max_threads=thread_count,\n        tokenizer=js_tokenizer.tokenize,\n        token_combiner=js_tokenizer.combine,\n        file_extension=file_extension)\n\n    result = line_minimizer.minimize(data)\n    result = js_minimizer(result)\n    result = js_minimizer(result)\n    result = line_minimizer.minimize(result)\n\n    return result\n", "path": "src/python/bot/minimizer/js_minimizer.py"}], "after_files": [{"content": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Minimizer used for additional reduction on javascript test cases.\"\"\"\nfrom __future__ import absolute_import\n\nfrom builtins import range\n\nfrom . import delta_minimizer\nfrom . import errors\nfrom . import minimizer\nfrom . import utils\n\nfrom bot.tokenizer.antlr_tokenizer import AntlrTokenizer\nfrom bot.tokenizer.grammars.JavaScriptLexer import JavaScriptLexer\n\n\ndef step_back_while(cur_index, condition):\n  \"\"\"Helper function. Decreases index from cur while condition is satisfied.\"\"\"\n  while cur_index >= 0 and condition(cur_index):\n    cur_index -= 1\n  return cur_index\n\n\nclass JSMinimizer(minimizer.Minimizer):\n  \"\"\"Intended as a second-pass minimizer to remove unneeded tokens from JS.\"\"\"\n\n  def _execute(self, data):\n    testcase = minimizer.Testcase(data, self)\n    if not self.validate_tokenizer(data, testcase):\n      raise errors.TokenizationFailureError('JS Minimizer')\n\n    brace_stack = []\n    paren_stack = []\n\n    for index, token in enumerate(testcase.tokens):\n      if token == '{':\n        brace_stack.append(index)\n\n      elif token == '}' and brace_stack:\n\n        # Two hypotheses for tokens grouped by curly braces:\n        # 1) Remove from start of line to open brace and the closing brace.\n        #    e.g.: if (statement_that_evaluates_to_true) { crash() } -> crash()\n        open_brace_index = brace_stack.pop()\n\n        # Find the first non-empty token prior to the starting brackets.\n        token_before_bracket = step_back_while(\n            open_brace_index - 1, (lambda x: not testcase.tokens[x].strip()))\n\n        # If that token is a close paren, we need to grab everything else too.\n        # Do this to grab the whole paren so we don't create a syntax error by\n        # removing only part of a paren.\n        if testcase.tokens[token_before_bracket] == ')':\n          # Find everything in the paren.\n          token_before_bracket = step_back_while(\n              token_before_bracket, (lambda x: testcase.tokens[x] != '('))\n\n          # Get the token before the paren.\n          token_before_bracket -= 1\n          token_before_bracket = step_back_while(\n              token_before_bracket, (lambda x: not testcase.tokens[x].strip()))\n\n        # Walk back to the start of that line as well to get if/else and funcs.\n        # Do this after paren to manage situations where there are newlines in\n        # the parens.\n        token_before_bracket = step_back_while(\n            token_before_bracket, (lambda x: testcase.tokens[x] != '\\n'))\n\n        token_before_bracket += 1\n\n        hypothesis = list(range(token_before_bracket,\n                                open_brace_index + 1)) + [index]\n\n        testcase.prepare_test(hypothesis)\n\n        # 2) Remove previous tokens and from the closing brace to the next one.\n        #    e.g.: try { crash() } catch(e) {} -> crash().\n        future_index = len(testcase.tokens)\n        open_count = 0\n        for future_index in range(index + 1, len(testcase.tokens)):\n          if testcase.tokens[future_index] == '{':\n            open_count += 1\n          if testcase.tokens[future_index] == '}':\n            open_count -= 1\n            # Make sure to grab entire outer brace if there are inner braces.\n            if not open_count:\n              break\n        if future_index != len(testcase.tokens):\n          lookahead_hypothesis = hypothesis + list(\n              range(index + 1, future_index + 1))\n\n          testcase.prepare_test(lookahead_hypothesis)\n\n      elif token == '(':\n        paren_stack.append(index)\n\n      elif token == ')' and paren_stack:\n        # Three hypotheses for tokens grouped by parentheses:\n        # 1) Remove the parentheses and the previous token.\n        #    e.g.: assertTrue(crash()); -> crash()\n        previous_end = paren_stack.pop()\n        if previous_end > 0:\n          hypothesis = [previous_end - 1, previous_end, index]\n          testcase.prepare_test(hypothesis)\n\n        # 2) Remove everything between the parentheses.\n        #    e.g. crash(junk, more_junk) -> crash()\n        if index - previous_end > 1:\n          hypothesis = list(range(previous_end + 1, index))\n          testcase.prepare_test(hypothesis)\n\n        # 3) Like 1, but to start of line instead of previous token.\n        #    e.g.: leftover_junk = (function() {\n        #          });\n\n        # Find the beginning of the line\n        token_before_paren = previous_end\n        token_before_paren = step_back_while(\n            previous_end, (lambda x: testcase.tokens[x] != '\\n'))\n        token_before_paren += 1\n\n        hypothesis = list(range(token_before_paren, previous_end + 1)) + [index]\n        testcase.prepare_test(hypothesis)\n\n        # 4) Like 3, but also from the closing brace to the next one.\n        #    e.g.: (function(global) { })(this);\n        future_index = len(testcase.tokens)\n        for future_index in range(index + 1, len(testcase.tokens)):\n          if testcase.tokens[future_index] == ')':\n            break\n        if future_index != len(testcase.tokens):\n          lookahead_hypothesis = list(\n              range(token_before_paren, future_index + 1))\n          testcase.prepare_test(lookahead_hypothesis)\n\n      elif token == ',':\n        # Two hypotheses for commas:\n        # 1) Remove comma and left-hand-side.\n        #    e.g.: f(whatever, crash()) -> f(crash())\n        if index > 0:\n          hypothesis = [index - 1, index]\n          testcase.prepare_test(hypothesis)\n\n        # 2) Remove comma and right-hand-side.\n        #    e.g.: f(crash(), whatever) -> f(crash())\n\n        # Find the next non whitespace token after the comma.\n        hypothesis = [index]\n        for right_token_index in range(index + 1, len(testcase.tokens)):\n          hypothesis.append(right_token_index)\n          if testcase.tokens[right_token_index].strip():\n            testcase.prepare_test(hypothesis)\n            break\n\n    testcase.process()\n    return testcase\n\n  @staticmethod\n  def run(data,\n          thread_count=minimizer.DEFAULT_THREAD_COUNT,\n          file_extension='.js'):\n    \"\"\"Attempt to minimize a javascript test case.\"\"\"\n    line_minimizer = delta_minimizer.DeltaMinimizer(\n        utils.test, max_threads=thread_count, file_extension=file_extension)\n\n    js_tokenizer = AntlrTokenizer(JavaScriptLexer)\n\n    js_minimizer = JSMinimizer(\n        utils.test,\n        max_threads=thread_count,\n        tokenizer=js_tokenizer.tokenize,\n        token_combiner=js_tokenizer.combine,\n        file_extension=file_extension)\n\n    result = line_minimizer.minimize(data)\n    result = js_minimizer.minimize(result)\n    result = js_minimizer.minimize(result)\n    result = line_minimizer.minimize(result)\n\n    return result\n", "path": "src/python/bot/minimizer/js_minimizer.py"}]}