We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
YapfBear: Make asciinema 
@Mariatta  are you interested? 


--- 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/python/YapfBear.py`
Content:
```
1 import sys
2 
3 from yapf.yapflib.yapf_api import FormatFile
4 
5 from coalib.bearlib import deprecate_settings
6 from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
7 from coalib.bears.LocalBear import LocalBear
8 from coalib.bears.requirements.PipRequirement import PipRequirement
9 from coalib.misc.ContextManagers import prepare_file
10 from coalib.results.Result import Result
11 from coalib.results.Diff import Diff
12 
13 
14 class YapfBear(LocalBear):
15     """
16     Check and correct formatting of Python code using ``yapf`` utility.
17 
18     See <https://github.com/google/yapf> for more information.
19     """
20     LANGUAGES = {"Python", "Python 2", "Python 3"}
21     AUTHORS = {'The coala developers'}
22     REQUIREMENTS = {PipRequirement('yapf', '0.11')}
23     AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
24     LICENSE = 'AGPL-3.0'
25     CAN_FIX = {'Formatting'}
26 
27     @deprecate_settings(indent_size='tab_width')
28     def run(self, filename, file,
29             max_line_length: int=79,
30             indent_size: int=SpacingHelper.DEFAULT_TAB_WIDTH,
31             allow_multiline_lambdas: bool=False,
32             blank_line_before_nested_class_or_def: bool=False,
33             continuation_tab_width: int=SpacingHelper.DEFAULT_TAB_WIDTH,
34             dedent_closing_brackets: bool=False,
35             indent_dictionary_value: bool=False,
36             coalesce_brackets: bool=False,
37             join_multiple_lines: bool=True,
38             spaces_around_power_operator: bool=True,
39             spaces_before_comment: int=2,
40             space_between_ending_comma_and_closing_bracket: bool=False,
41             split_arguments_when_comma_terminated: bool=False,
42             split_before_bitwise_operator: bool=False,
43             split_before_first_argument: bool=False,
44             split_before_logical_operator: bool=False,
45             split_before_named_assigns: bool=True,
46             use_spaces: bool=True,
47             based_on_style: str='pep8',
48             prefer_line_break_after_opening_bracket: bool=True):
49         """
50         :param max_line_length:
51             Maximum number of characters for a line.
52         :param indent_size:
53             Number of spaces per indentation level.
54         :param allow_multiline_lambdas:
55             Allows lambdas to be formatted on more than one line.
56         :param blank_line_before_nested_class_or_def:
57             Inserts a blank line before a ``def`` or ``class`` immediately
58             nested within another ``def`` or ``class``.
59         :param continuation_tab_width:
60             Indent width used for line continuations.
61         :param dedent_closing_brackets:
62             Puts closing brackets on a separate line, dedented, if the
63             bracketed expression can't fit in a single line. Applies to all
64             kinds of brackets, including function definitions and calls.
65         :param indent_dictionary_value:
66             Indents the dictionary value if it cannot fit on the same line as
67             the dictionary key.
68         :param coalesce_brackets:
69             Prevents splitting consecutive brackets. Only relevant when
70             ``dedent_closing_brackets`` is set.
71             Example:
72             If ``True``,
73 
74             ```
75             call_func_that_takes_a_dict(
76                 {
77                     'key1': 'value1',
78                     'key2': 'value2',
79                 }
80             )
81             ```
82             would reformat to:
83             ```
84             call_func_that_takes_a_dict({
85                 'key1': 'value1',
86                 'key2': 'value2',
87             })
88             ```
89         :param join_multiple_lines:
90             Joins short lines into one line.
91         :param spaces_around_power_operator:
92             Set to ``True`` to prefer using spaces around ``**``.
93         :param spaces_before_comment:
94             The number of spaces required before a trailing comment.
95         :param space_between_ending_comma_and_closing_bracket:
96             Inserts a space between the ending comma and closing bracket of a
97             list, etc.
98         :param split_arguments_when_comma_terminated:
99             Splits before arguments if the argument list is terminated by a
100             comma.
101         :param split_before_bitwise_operator:
102             Set to ``True`` to prefer splitting before ``&``, ``|`` or ``^``
103             rather than after.
104         :param split_before_first_argument:
105             If an argument / parameter list is going to be split, then split
106             before the first argument.
107         :param split_before_logical_operator:
108             Set to ``True`` to prefer splitting before ``and`` or ``or`` rather
109             than after.
110         :param split_before_named_assigns:
111             Splits named assignments into individual lines.
112         :param use_spaces:
113             Uses spaces for indentation.
114         :param based_on_style:
115             The formatting style to be used as reference.
116         :param prefer_line_break_after_opening_bracket:
117             If True, splitting right after a open bracket will not be
118             preferred.
119         """
120         if not file:
121             # Yapf cannot handle zero-byte files well, and adds a redundent
122             # newline into the file. To avoid this, we don't parse zero-byte
123             # files as they cannot have anything to format either.
124             return
125 
126         options = """
127 [style]
128 indent_width = {indent_size}
129 column_limit = {max_line_length}
130 allow_multiline_lambdas = {allow_multiline_lambdas}
131 continuation_indent_width = {continuation_tab_width}
132 dedent_closing_brackets = {dedent_closing_brackets}
133 indent_dictionary_value = {indent_dictionary_value}
134 join_multiple_lines = {join_multiple_lines}
135 spaces_around_power_operator = {spaces_around_power_operator}
136 spaces_before_comment = {spaces_before_comment}
137 coalesce_brackets = {coalesce_brackets}
138 split_before_bitwise_operator = {split_before_bitwise_operator}
139 split_before_first_argument = {split_before_first_argument}
140 split_before_logical_operator = {split_before_logical_operator}
141 split_before_named_assigns = {split_before_named_assigns}
142 based_on_style = {based_on_style}
143 blank_line_before_nested_class_or_def = {blank_line_before_nested_class_or_def}
144 split_arguments_when_comma_terminated = {split_arguments_when_comma_terminated}
145 space_between_ending_comma_and_closing_bracket= \
146 {space_between_ending_comma_and_closing_bracket}
147 """
148         options += 'use_tabs = ' + str(not use_spaces) + "\n"
149         options += ('split_penalty_after_opening_bracket = ' +
150                     ('30' if prefer_line_break_after_opening_bracket
151                      else '0') + "\n")
152         options = options.format(**locals())
153 
154         try:
155             with prepare_file(options.splitlines(keepends=True),
156                               None) as (file_, fname):
157                 corrected = FormatFile(filename,
158                                        style_config=fname,
159                                        verify=False)[0].splitlines(True)
160         except SyntaxError as err:
161             if isinstance(err, IndentationError):
162                 error_type = "indentation errors (" + err.args[0] + ')'
163             else:
164                 error_type = "syntax errors"
165             yield Result.from_values(
166                 self,
167                 "The code cannot be parsed due to {0}.".format(error_type),
168                 filename, line=err.lineno, column=err.offset)
169             return
170         diffs = Diff.from_string_arrays(file, corrected).split_diff()
171         for diff in diffs:
172             yield Result(self,
173                          "The code does not comply with the settings "
174                          "provided.",
175                          affected_code=(diff.range(filename),),
176                          diffs={filename: diff})
177 
178     @classmethod
179     def check_prerequisites(cls):  # pragma: no cover
180         if not sys.version_info >= (3, 4):
181             return 'Yapf only supports Python 2.7 and Python 3.4+'
182         else:
183             return True
184
```
--- 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/python/YapfBear.py b/bears/python/YapfBear.py
--- a/bears/python/YapfBear.py
+++ b/bears/python/YapfBear.py
@@ -23,6 +23,7 @@
     AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
     LICENSE = 'AGPL-3.0'
     CAN_FIX = {'Formatting'}
+    ASCIINEMA_URL = 'https://asciinema.org/a/89021'
 
     @deprecate_settings(indent_size='tab_width')
     def run(self, filename, file,

{"golden_diff": "diff --git a/bears/python/YapfBear.py b/bears/python/YapfBear.py\n--- a/bears/python/YapfBear.py\n+++ b/bears/python/YapfBear.py\n@@ -23,6 +23,7 @@\n     AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}\n     LICENSE = 'AGPL-3.0'\n     CAN_FIX = {'Formatting'}\n+    ASCIINEMA_URL = 'https://asciinema.org/a/89021'\n \n     @deprecate_settings(indent_size='tab_width')\n     def run(self, filename, file,\n", "issue": "YapfBear: Make asciinema \n@Mariatta  are you interested? \n\n", "before_files": [{"content": "import sys\n\nfrom yapf.yapflib.yapf_api import FormatFile\n\nfrom coalib.bearlib import deprecate_settings\nfrom coalib.bearlib.spacing.SpacingHelper import SpacingHelper\nfrom coalib.bears.LocalBear import LocalBear\nfrom coalib.bears.requirements.PipRequirement import PipRequirement\nfrom coalib.misc.ContextManagers import prepare_file\nfrom coalib.results.Result import Result\nfrom coalib.results.Diff import Diff\n\n\nclass YapfBear(LocalBear):\n    \"\"\"\n    Check and correct formatting of Python code using ``yapf`` utility.\n\n    See <https://github.com/google/yapf> for more information.\n    \"\"\"\n    LANGUAGES = {\"Python\", \"Python 2\", \"Python 3\"}\n    AUTHORS = {'The coala developers'}\n    REQUIREMENTS = {PipRequirement('yapf', '0.11')}\n    AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}\n    LICENSE = 'AGPL-3.0'\n    CAN_FIX = {'Formatting'}\n\n    @deprecate_settings(indent_size='tab_width')\n    def run(self, filename, file,\n            max_line_length: int=79,\n            indent_size: int=SpacingHelper.DEFAULT_TAB_WIDTH,\n            allow_multiline_lambdas: bool=False,\n            blank_line_before_nested_class_or_def: bool=False,\n            continuation_tab_width: int=SpacingHelper.DEFAULT_TAB_WIDTH,\n            dedent_closing_brackets: bool=False,\n            indent_dictionary_value: bool=False,\n            coalesce_brackets: bool=False,\n            join_multiple_lines: bool=True,\n            spaces_around_power_operator: bool=True,\n            spaces_before_comment: int=2,\n            space_between_ending_comma_and_closing_bracket: bool=False,\n            split_arguments_when_comma_terminated: bool=False,\n            split_before_bitwise_operator: bool=False,\n            split_before_first_argument: bool=False,\n            split_before_logical_operator: bool=False,\n            split_before_named_assigns: bool=True,\n            use_spaces: bool=True,\n            based_on_style: str='pep8',\n            prefer_line_break_after_opening_bracket: bool=True):\n        \"\"\"\n        :param max_line_length:\n            Maximum number of characters for a line.\n        :param indent_size:\n            Number of spaces per indentation level.\n        :param allow_multiline_lambdas:\n            Allows lambdas to be formatted on more than one line.\n        :param blank_line_before_nested_class_or_def:\n            Inserts a blank line before a ``def`` or ``class`` immediately\n            nested within another ``def`` or ``class``.\n        :param continuation_tab_width:\n            Indent width used for line continuations.\n        :param dedent_closing_brackets:\n            Puts closing brackets on a separate line, dedented, if the\n            bracketed expression can't fit in a single line. Applies to all\n            kinds of brackets, including function definitions and calls.\n        :param indent_dictionary_value:\n            Indents the dictionary value if it cannot fit on the same line as\n            the dictionary key.\n        :param coalesce_brackets:\n            Prevents splitting consecutive brackets. Only relevant when\n            ``dedent_closing_brackets`` is set.\n            Example:\n            If ``True``,\n\n            ```\n            call_func_that_takes_a_dict(\n                {\n                    'key1': 'value1',\n                    'key2': 'value2',\n                }\n            )\n            ```\n            would reformat to:\n            ```\n            call_func_that_takes_a_dict({\n                'key1': 'value1',\n                'key2': 'value2',\n            })\n            ```\n        :param join_multiple_lines:\n            Joins short lines into one line.\n        :param spaces_around_power_operator:\n            Set to ``True`` to prefer using spaces around ``**``.\n        :param spaces_before_comment:\n            The number of spaces required before a trailing comment.\n        :param space_between_ending_comma_and_closing_bracket:\n            Inserts a space between the ending comma and closing bracket of a\n            list, etc.\n        :param split_arguments_when_comma_terminated:\n            Splits before arguments if the argument list is terminated by a\n            comma.\n        :param split_before_bitwise_operator:\n            Set to ``True`` to prefer splitting before ``&``, ``|`` or ``^``\n            rather than after.\n        :param split_before_first_argument:\n            If an argument / parameter list is going to be split, then split\n            before the first argument.\n        :param split_before_logical_operator:\n            Set to ``True`` to prefer splitting before ``and`` or ``or`` rather\n            than after.\n        :param split_before_named_assigns:\n            Splits named assignments into individual lines.\n        :param use_spaces:\n            Uses spaces for indentation.\n        :param based_on_style:\n            The formatting style to be used as reference.\n        :param prefer_line_break_after_opening_bracket:\n            If True, splitting right after a open bracket will not be\n            preferred.\n        \"\"\"\n        if not file:\n            # Yapf cannot handle zero-byte files well, and adds a redundent\n            # newline into the file. To avoid this, we don't parse zero-byte\n            # files as they cannot have anything to format either.\n            return\n\n        options = \"\"\"\n[style]\nindent_width = {indent_size}\ncolumn_limit = {max_line_length}\nallow_multiline_lambdas = {allow_multiline_lambdas}\ncontinuation_indent_width = {continuation_tab_width}\ndedent_closing_brackets = {dedent_closing_brackets}\nindent_dictionary_value = {indent_dictionary_value}\njoin_multiple_lines = {join_multiple_lines}\nspaces_around_power_operator = {spaces_around_power_operator}\nspaces_before_comment = {spaces_before_comment}\ncoalesce_brackets = {coalesce_brackets}\nsplit_before_bitwise_operator = {split_before_bitwise_operator}\nsplit_before_first_argument = {split_before_first_argument}\nsplit_before_logical_operator = {split_before_logical_operator}\nsplit_before_named_assigns = {split_before_named_assigns}\nbased_on_style = {based_on_style}\nblank_line_before_nested_class_or_def = {blank_line_before_nested_class_or_def}\nsplit_arguments_when_comma_terminated = {split_arguments_when_comma_terminated}\nspace_between_ending_comma_and_closing_bracket= \\\n{space_between_ending_comma_and_closing_bracket}\n\"\"\"\n        options += 'use_tabs = ' + str(not use_spaces) + \"\\n\"\n        options += ('split_penalty_after_opening_bracket = ' +\n                    ('30' if prefer_line_break_after_opening_bracket\n                     else '0') + \"\\n\")\n        options = options.format(**locals())\n\n        try:\n            with prepare_file(options.splitlines(keepends=True),\n                              None) as (file_, fname):\n                corrected = FormatFile(filename,\n                                       style_config=fname,\n                                       verify=False)[0].splitlines(True)\n        except SyntaxError as err:\n            if isinstance(err, IndentationError):\n                error_type = \"indentation errors (\" + err.args[0] + ')'\n            else:\n                error_type = \"syntax errors\"\n            yield Result.from_values(\n                self,\n                \"The code cannot be parsed due to {0}.\".format(error_type),\n                filename, line=err.lineno, column=err.offset)\n            return\n        diffs = Diff.from_string_arrays(file, corrected).split_diff()\n        for diff in diffs:\n            yield Result(self,\n                         \"The code does not comply with the settings \"\n                         \"provided.\",\n                         affected_code=(diff.range(filename),),\n                         diffs={filename: diff})\n\n    @classmethod\n    def check_prerequisites(cls):  # pragma: no cover\n        if not sys.version_info >= (3, 4):\n            return 'Yapf only supports Python 2.7 and Python 3.4+'\n        else:\n            return True\n", "path": "bears/python/YapfBear.py"}], "after_files": [{"content": "import sys\n\nfrom yapf.yapflib.yapf_api import FormatFile\n\nfrom coalib.bearlib import deprecate_settings\nfrom coalib.bearlib.spacing.SpacingHelper import SpacingHelper\nfrom coalib.bears.LocalBear import LocalBear\nfrom coalib.bears.requirements.PipRequirement import PipRequirement\nfrom coalib.misc.ContextManagers import prepare_file\nfrom coalib.results.Result import Result\nfrom coalib.results.Diff import Diff\n\n\nclass YapfBear(LocalBear):\n    \"\"\"\n    Check and correct formatting of Python code using ``yapf`` utility.\n\n    See <https://github.com/google/yapf> for more information.\n    \"\"\"\n    LANGUAGES = {\"Python\", \"Python 2\", \"Python 3\"}\n    AUTHORS = {'The coala developers'}\n    REQUIREMENTS = {PipRequirement('yapf', '0.11')}\n    AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}\n    LICENSE = 'AGPL-3.0'\n    CAN_FIX = {'Formatting'}\n    ASCIINEMA_URL = 'https://asciinema.org/a/89021'\n\n    @deprecate_settings(indent_size='tab_width')\n    def run(self, filename, file,\n            max_line_length: int=79,\n            indent_size: int=SpacingHelper.DEFAULT_TAB_WIDTH,\n            allow_multiline_lambdas: bool=False,\n            blank_line_before_nested_class_or_def: bool=False,\n            continuation_tab_width: int=SpacingHelper.DEFAULT_TAB_WIDTH,\n            dedent_closing_brackets: bool=False,\n            indent_dictionary_value: bool=False,\n            coalesce_brackets: bool=False,\n            join_multiple_lines: bool=True,\n            spaces_around_power_operator: bool=True,\n            spaces_before_comment: int=2,\n            space_between_ending_comma_and_closing_bracket: bool=False,\n            split_arguments_when_comma_terminated: bool=False,\n            split_before_bitwise_operator: bool=False,\n            split_before_first_argument: bool=False,\n            split_before_logical_operator: bool=False,\n            split_before_named_assigns: bool=True,\n            use_spaces: bool=True,\n            based_on_style: str='pep8',\n            prefer_line_break_after_opening_bracket: bool=True):\n        \"\"\"\n        :param max_line_length:\n            Maximum number of characters for a line.\n        :param indent_size:\n            Number of spaces per indentation level.\n        :param allow_multiline_lambdas:\n            Allows lambdas to be formatted on more than one line.\n        :param blank_line_before_nested_class_or_def:\n            Inserts a blank line before a ``def`` or ``class`` immediately\n            nested within another ``def`` or ``class``.\n        :param continuation_tab_width:\n            Indent width used for line continuations.\n        :param dedent_closing_brackets:\n            Puts closing brackets on a separate line, dedented, if the\n            bracketed expression can't fit in a single line. Applies to all\n            kinds of brackets, including function definitions and calls.\n        :param indent_dictionary_value:\n            Indents the dictionary value if it cannot fit on the same line as\n            the dictionary key.\n        :param coalesce_brackets:\n            Prevents splitting consecutive brackets. Only relevant when\n            ``dedent_closing_brackets`` is set.\n            Example:\n            If ``True``,\n\n            ```\n            call_func_that_takes_a_dict(\n                {\n                    'key1': 'value1',\n                    'key2': 'value2',\n                }\n            )\n            ```\n            would reformat to:\n            ```\n            call_func_that_takes_a_dict({\n                'key1': 'value1',\n                'key2': 'value2',\n            })\n            ```\n        :param join_multiple_lines:\n            Joins short lines into one line.\n        :param spaces_around_power_operator:\n            Set to ``True`` to prefer using spaces around ``**``.\n        :param spaces_before_comment:\n            The number of spaces required before a trailing comment.\n        :param space_between_ending_comma_and_closing_bracket:\n            Inserts a space between the ending comma and closing bracket of a\n            list, etc.\n        :param split_arguments_when_comma_terminated:\n            Splits before arguments if the argument list is terminated by a\n            comma.\n        :param split_before_bitwise_operator:\n            Set to ``True`` to prefer splitting before ``&``, ``|`` or ``^``\n            rather than after.\n        :param split_before_first_argument:\n            If an argument / parameter list is going to be split, then split\n            before the first argument.\n        :param split_before_logical_operator:\n            Set to ``True`` to prefer splitting before ``and`` or ``or`` rather\n            than after.\n        :param split_before_named_assigns:\n            Splits named assignments into individual lines.\n        :param use_spaces:\n            Uses spaces for indentation.\n        :param based_on_style:\n            The formatting style to be used as reference.\n        :param prefer_line_break_after_opening_bracket:\n            If True, splitting right after a open bracket will not be\n            preferred.\n        \"\"\"\n        if not file:\n            # Yapf cannot handle zero-byte files well, and adds a redundent\n            # newline into the file. To avoid this, we don't parse zero-byte\n            # files as they cannot have anything to format either.\n            return\n\n        options = \"\"\"\n[style]\nindent_width = {indent_size}\ncolumn_limit = {max_line_length}\nallow_multiline_lambdas = {allow_multiline_lambdas}\ncontinuation_indent_width = {continuation_tab_width}\ndedent_closing_brackets = {dedent_closing_brackets}\nindent_dictionary_value = {indent_dictionary_value}\njoin_multiple_lines = {join_multiple_lines}\nspaces_around_power_operator = {spaces_around_power_operator}\nspaces_before_comment = {spaces_before_comment}\ncoalesce_brackets = {coalesce_brackets}\nsplit_before_bitwise_operator = {split_before_bitwise_operator}\nsplit_before_first_argument = {split_before_first_argument}\nsplit_before_logical_operator = {split_before_logical_operator}\nsplit_before_named_assigns = {split_before_named_assigns}\nbased_on_style = {based_on_style}\nblank_line_before_nested_class_or_def = {blank_line_before_nested_class_or_def}\nsplit_arguments_when_comma_terminated = {split_arguments_when_comma_terminated}\nspace_between_ending_comma_and_closing_bracket= \\\n{space_between_ending_comma_and_closing_bracket}\n\"\"\"\n        options += 'use_tabs = ' + str(not use_spaces) + \"\\n\"\n        options += ('split_penalty_after_opening_bracket = ' +\n                    ('30' if prefer_line_break_after_opening_bracket\n                     else '0') + \"\\n\")\n        options = options.format(**locals())\n\n        try:\n            with prepare_file(options.splitlines(keepends=True),\n                              None) as (file_, fname):\n                corrected = FormatFile(filename,\n                                       style_config=fname,\n                                       verify=False)[0].splitlines(True)\n        except SyntaxError as err:\n            if isinstance(err, IndentationError):\n                error_type = \"indentation errors (\" + err.args[0] + ')'\n            else:\n                error_type = \"syntax errors\"\n            yield Result.from_values(\n                self,\n                \"The code cannot be parsed due to {0}.\".format(error_type),\n                filename, line=err.lineno, column=err.offset)\n            return\n        diffs = Diff.from_string_arrays(file, corrected).split_diff()\n        for diff in diffs:\n            yield Result(self,\n                         \"The code does not comply with the settings \"\n                         \"provided.\",\n                         affected_code=(diff.range(filename),),\n                         diffs={filename: diff})\n\n    @classmethod\n    def check_prerequisites(cls):  # pragma: no cover\n        if not sys.version_info >= (3, 4):\n            return 'Yapf only supports Python 2.7 and Python 3.4+'\n        else:\n            return True\n", "path": "bears/python/YapfBear.py"}]}