prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  `python3.7` raises `flake8` warning
  It is a bug in `flake8`:
  - https://github.com/PyCQA/pycodestyle/issues/728
  
  We currently allow `python3.7` build to fail.
  
  ```
  =============================== warnings summary ===============================
  tests/test_visitors/test_wrong_class/test_base_class.py::FLAKE8
    /home/travis/virtualenv/python3.7.0/lib/python3.7/site-packages/pycodestyle.py:113: FutureWarning: Possible nested set at position 1
      EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
  -- Docs: https://docs.pytest.org/en/latest/warnings.html
  =================== 1514 passed, 1 warnings in 27.96 seconds ===================
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `wemake_python_styleguide/compat.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 
  3 """
  4 This module contains ugly hacks and fixes for version compat issues.
  5 
  6 Do not be over-exited to add anything here.
  7 """
  8 
  9 import ast
  10 
  11 
  12 def maybe_set_parent(tree: ast.AST) -> ast.AST:
  13     """Sets parents for all nodes that do not have this prop."""
  14     for statement in ast.walk(tree):
  15         for child in ast.iter_child_nodes(statement):
  16             if not hasattr(child, 'parent'):  # noqa: Z113
  17                 setattr(child, 'parent', statement)
  18 
  19     return tree
  20
  ```
  
  Path: `wemake_python_styleguide/checker.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 
  3 from ast import Module
  4 from typing import Generator
  5 
  6 from flake8.options.manager import OptionManager
  7 
  8 from wemake_python_styleguide import constants
  9 from wemake_python_styleguide.compat import maybe_set_parent
  10 from wemake_python_styleguide.options.config import Configuration
  11 from wemake_python_styleguide.types import (
  12     CheckerSequence,
  13     CheckResult,
  14     ConfigurationOptions,
  15 )
  16 from wemake_python_styleguide.version import version
  17 from wemake_python_styleguide.visitors.ast.complexity.counts import (
  18     MethodMembersVisitor,
  19     ModuleMembersVisitor,
  20 )
  21 from wemake_python_styleguide.visitors.ast.complexity.function import (
  22     FunctionComplexityVisitor,
  23 )
  24 from wemake_python_styleguide.visitors.ast.complexity.nested import (
  25     NestedComplexityVisitor,
  26 )
  27 from wemake_python_styleguide.visitors.ast.complexity.offset import (
  28     OffsetVisitor,
  29 )
  30 from wemake_python_styleguide.visitors.ast.wrong_class import WrongClassVisitor
  31 from wemake_python_styleguide.visitors.ast.wrong_contents import (
  32     WrongContentsVisitor,
  33 )
  34 from wemake_python_styleguide.visitors.ast.wrong_function_call import (
  35     WrongFunctionCallVisitor,
  36 )
  37 from wemake_python_styleguide.visitors.ast.wrong_import import (
  38     WrongImportVisitor,
  39 )
  40 from wemake_python_styleguide.visitors.ast.wrong_keyword import (
  41     WrongKeywordVisitor,
  42     WrongRaiseVisitor,
  43 )
  44 from wemake_python_styleguide.visitors.ast.wrong_name import (
  45     WrongModuleMetadataVisitor,
  46     WrongNameVisitor,
  47 )
  48 from wemake_python_styleguide.visitors.ast.wrong_string import (
  49     WrongStringVisitor,
  50 )
  51 from wemake_python_styleguide.visitors.filenames.wrong_module_name import (
  52     WrongModuleNameVisitor,
  53 )
  54 
  55 #: Visitors that should be working by default:
  56 ENABLED_VISITORS: CheckerSequence = [
  57     # Styling and correctness:
  58     WrongRaiseVisitor,
  59     WrongFunctionCallVisitor,
  60     WrongImportVisitor,
  61     WrongKeywordVisitor,
  62     WrongNameVisitor,
  63     WrongModuleMetadataVisitor,
  64     WrongClassVisitor,
  65     WrongStringVisitor,
  66     WrongContentsVisitor,
  67 
  68     # Complexity:
  69     FunctionComplexityVisitor,
  70     NestedComplexityVisitor,
  71     OffsetVisitor,
  72     ModuleMembersVisitor,
  73     MethodMembersVisitor,
  74 
  75     # Modules:
  76     WrongModuleNameVisitor,
  77 ]
  78 
  79 
  80 class Checker(object):
  81     """
  82     Main checker class.
  83 
  84     Runs all checks that are bundled with this package.
  85     If you want to add new checks they should be added to ``ENABLED_VISITORS``.
  86     """
  87 
  88     name = 'wemake-python-styleguide'
  89     version = version
  90 
  91     config = Configuration()
  92     options: ConfigurationOptions
  93 
  94     def __init__(self, tree: Module, filename: str = constants.STDIN) -> None:
  95         """Creates new checker instance."""
  96         self.tree = maybe_set_parent(tree)
  97         self.filename = filename
  98 
  99     @classmethod
  100     def add_options(cls, parser: OptionManager) -> None:
  101         """Calls Configuration instance method for registering options."""
  102         cls.config.register_options(parser)
  103 
  104     @classmethod
  105     def parse_options(cls, options: ConfigurationOptions) -> None:
  106         """Parses registered options for providing to the visitor."""
  107         cls.options = options
  108 
  109     def run(self) -> Generator[CheckResult, None, None]:
  110         """
  111         Runs the checker.
  112 
  113         This method is used by `flake8` API.
  114         After all configuration is parsed and passed.
  115         """
  116         for visitor_class in ENABLED_VISITORS:
  117             visitor = visitor_class(
  118                 self.options,
  119                 tree=self.tree,
  120                 filename=self.filename,
  121             )
  122             visitor.run()
  123 
  124             for error in visitor.errors:
  125                 yield (*error.node_items(), type(self))
  126
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/wemake_python_styleguide/checker.py b/wemake_python_styleguide/checker.py
  --- a/wemake_python_styleguide/checker.py
  +++ b/wemake_python_styleguide/checker.py
  @@ -6,7 +6,6 @@
   from flake8.options.manager import OptionManager
   
   from wemake_python_styleguide import constants
  -from wemake_python_styleguide.compat import maybe_set_parent
   from wemake_python_styleguide.options.config import Configuration
   from wemake_python_styleguide.types import (
       CheckerSequence,
  @@ -93,7 +92,7 @@
   
       def __init__(self, tree: Module, filename: str = constants.STDIN) -> None:
           """Creates new checker instance."""
  -        self.tree = maybe_set_parent(tree)
  +        self.tree = tree
           self.filename = filename
   
       @classmethod
  diff --git a/wemake_python_styleguide/compat.py b/wemake_python_styleguide/compat.py
  deleted file mode 100644
  --- a/wemake_python_styleguide/compat.py
  +++ /dev/null
  @@ -1,19 +0,0 @@
  -# -*- coding: utf-8 -*-
  -
  -"""
  -This module contains ugly hacks and fixes for version compat issues.
  -
  -Do not be over-exited to add anything here.
  -"""
  -
  -import ast
  -
  -
  -def maybe_set_parent(tree: ast.AST) -> ast.AST:
  -    """Sets parents for all nodes that do not have this prop."""
  -    for statement in ast.walk(tree):
  -        for child in ast.iter_child_nodes(statement):
  -            if not hasattr(child, 'parent'):  # noqa: Z113
  -                setattr(child, 'parent', statement)
  -
  -    return tree
  
verification_info: {"golden_diff": "diff --git a/wemake_python_styleguide/checker.py b/wemake_python_styleguide/checker.py\n--- a/wemake_python_styleguide/checker.py\n+++ b/wemake_python_styleguide/checker.py\n@@ -6,7 +6,6 @@\n from flake8.options.manager import OptionManager\n \n from wemake_python_styleguide import constants\n-from wemake_python_styleguide.compat import maybe_set_parent\n from wemake_python_styleguide.options.config import Configuration\n from wemake_python_styleguide.types import (\n     CheckerSequence,\n@@ -93,7 +92,7 @@\n \n     def __init__(self, tree: Module, filename: str = constants.STDIN) -> None:\n         \"\"\"Creates new checker instance.\"\"\"\n-        self.tree = maybe_set_parent(tree)\n+        self.tree = tree\n         self.filename = filename\n \n     @classmethod\ndiff --git a/wemake_python_styleguide/compat.py b/wemake_python_styleguide/compat.py\ndeleted file mode 100644\n--- a/wemake_python_styleguide/compat.py\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-# -*- coding: utf-8 -*-\n-\n-\"\"\"\n-This module contains ugly hacks and fixes for version compat issues.\n-\n-Do not be over-exited to add anything here.\n-\"\"\"\n-\n-import ast\n-\n-\n-def maybe_set_parent(tree: ast.AST) -> ast.AST:\n-    \"\"\"Sets parents for all nodes that do not have this prop.\"\"\"\n-    for statement in ast.walk(tree):\n-        for child in ast.iter_child_nodes(statement):\n-            if not hasattr(child, 'parent'):  # noqa: Z113\n-                setattr(child, 'parent', statement)\n-\n-    return tree\n", "issue": "`python3.7` raises `flake8` warning\nIt is a bug in `flake8`:\r\n- https://github.com/PyCQA/pycodestyle/issues/728\r\n\r\nWe currently allow `python3.7` build to fail.\r\n\r\n```\r\n=============================== warnings summary ===============================\r\ntests/test_visitors/test_wrong_class/test_base_class.py::FLAKE8\r\n  /home/travis/virtualenv/python3.7.0/lib/python3.7/site-packages/pycodestyle.py:113: FutureWarning: Possible nested set at position 1\r\n    EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')\r\n-- Docs: https://docs.pytest.org/en/latest/warnings.html\r\n=================== 1514 passed, 1 warnings in 27.96 seconds ===================\r\n```\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\"\nThis module contains ugly hacks and fixes for version compat issues.\n\nDo not be over-exited to add anything here.\n\"\"\"\n\nimport ast\n\n\ndef maybe_set_parent(tree: ast.AST) -> ast.AST:\n    \"\"\"Sets parents for all nodes that do not have this prop.\"\"\"\n    for statement in ast.walk(tree):\n        for child in ast.iter_child_nodes(statement):\n            if not hasattr(child, 'parent'):  # noqa: Z113\n                setattr(child, 'parent', statement)\n\n    return tree\n", "path": "wemake_python_styleguide/compat.py"}, {"content": "# -*- coding: utf-8 -*-\n\nfrom ast import Module\nfrom typing import Generator\n\nfrom flake8.options.manager import OptionManager\n\nfrom wemake_python_styleguide import constants\nfrom wemake_python_styleguide.compat import maybe_set_parent\nfrom wemake_python_styleguide.options.config import Configuration\nfrom wemake_python_styleguide.types import (\n    CheckerSequence,\n    CheckResult,\n    ConfigurationOptions,\n)\nfrom wemake_python_styleguide.version import version\nfrom wemake_python_styleguide.visitors.ast.complexity.counts import (\n    MethodMembersVisitor,\n    ModuleMembersVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.complexity.function import (\n    FunctionComplexityVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.complexity.nested import (\n    NestedComplexityVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.complexity.offset import (\n    OffsetVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_class import WrongClassVisitor\nfrom wemake_python_styleguide.visitors.ast.wrong_contents import (\n    WrongContentsVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_function_call import (\n    WrongFunctionCallVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_import import (\n    WrongImportVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_keyword import (\n    WrongKeywordVisitor,\n    WrongRaiseVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_name import (\n    WrongModuleMetadataVisitor,\n    WrongNameVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_string import (\n    WrongStringVisitor,\n)\nfrom wemake_python_styleguide.visitors.filenames.wrong_module_name import (\n    WrongModuleNameVisitor,\n)\n\n#: Visitors that should be working by default:\nENABLED_VISITORS: CheckerSequence = [\n    # Styling and correctness:\n    WrongRaiseVisitor,\n    WrongFunctionCallVisitor,\n    WrongImportVisitor,\n    WrongKeywordVisitor,\n    WrongNameVisitor,\n    WrongModuleMetadataVisitor,\n    WrongClassVisitor,\n    WrongStringVisitor,\n    WrongContentsVisitor,\n\n    # Complexity:\n    FunctionComplexityVisitor,\n    NestedComplexityVisitor,\n    OffsetVisitor,\n    ModuleMembersVisitor,\n    MethodMembersVisitor,\n\n    # Modules:\n    WrongModuleNameVisitor,\n]\n\n\nclass Checker(object):\n    \"\"\"\n    Main checker class.\n\n    Runs all checks that are bundled with this package.\n    If you want to add new checks they should be added to ``ENABLED_VISITORS``.\n    \"\"\"\n\n    name = 'wemake-python-styleguide'\n    version = version\n\n    config = Configuration()\n    options: ConfigurationOptions\n\n    def __init__(self, tree: Module, filename: str = constants.STDIN) -> None:\n        \"\"\"Creates new checker instance.\"\"\"\n        self.tree = maybe_set_parent(tree)\n        self.filename = filename\n\n    @classmethod\n    def add_options(cls, parser: OptionManager) -> None:\n        \"\"\"Calls Configuration instance method for registering options.\"\"\"\n        cls.config.register_options(parser)\n\n    @classmethod\n    def parse_options(cls, options: ConfigurationOptions) -> None:\n        \"\"\"Parses registered options for providing to the visitor.\"\"\"\n        cls.options = options\n\n    def run(self) -> Generator[CheckResult, None, None]:\n        \"\"\"\n        Runs the checker.\n\n        This method is used by `flake8` API.\n        After all configuration is parsed and passed.\n        \"\"\"\n        for visitor_class in ENABLED_VISITORS:\n            visitor = visitor_class(\n                self.options,\n                tree=self.tree,\n                filename=self.filename,\n            )\n            visitor.run()\n\n            for error in visitor.errors:\n                yield (*error.node_items(), type(self))\n", "path": "wemake_python_styleguide/checker.py"}], "after_files": [{"content": null, "path": "wemake_python_styleguide/compat.py"}, {"content": "# -*- coding: utf-8 -*-\n\nfrom ast import Module\nfrom typing import Generator\n\nfrom flake8.options.manager import OptionManager\n\nfrom wemake_python_styleguide import constants\nfrom wemake_python_styleguide.options.config import Configuration\nfrom wemake_python_styleguide.types import (\n    CheckerSequence,\n    CheckResult,\n    ConfigurationOptions,\n)\nfrom wemake_python_styleguide.version import version\nfrom wemake_python_styleguide.visitors.ast.complexity.counts import (\n    MethodMembersVisitor,\n    ModuleMembersVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.complexity.function import (\n    FunctionComplexityVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.complexity.nested import (\n    NestedComplexityVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.complexity.offset import (\n    OffsetVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_class import WrongClassVisitor\nfrom wemake_python_styleguide.visitors.ast.wrong_contents import (\n    WrongContentsVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_function_call import (\n    WrongFunctionCallVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_import import (\n    WrongImportVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_keyword import (\n    WrongKeywordVisitor,\n    WrongRaiseVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_name import (\n    WrongModuleMetadataVisitor,\n    WrongNameVisitor,\n)\nfrom wemake_python_styleguide.visitors.ast.wrong_string import (\n    WrongStringVisitor,\n)\nfrom wemake_python_styleguide.visitors.filenames.wrong_module_name import (\n    WrongModuleNameVisitor,\n)\n\n#: Visitors that should be working by default:\nENABLED_VISITORS: CheckerSequence = [\n    # Styling and correctness:\n    WrongRaiseVisitor,\n    WrongFunctionCallVisitor,\n    WrongImportVisitor,\n    WrongKeywordVisitor,\n    WrongNameVisitor,\n    WrongModuleMetadataVisitor,\n    WrongClassVisitor,\n    WrongStringVisitor,\n    WrongContentsVisitor,\n\n    # Complexity:\n    FunctionComplexityVisitor,\n    NestedComplexityVisitor,\n    OffsetVisitor,\n    ModuleMembersVisitor,\n    MethodMembersVisitor,\n\n    # Modules:\n    WrongModuleNameVisitor,\n]\n\n\nclass Checker(object):\n    \"\"\"\n    Main checker class.\n\n    Runs all checks that are bundled with this package.\n    If you want to add new checks they should be added to ``ENABLED_VISITORS``.\n    \"\"\"\n\n    name = 'wemake-python-styleguide'\n    version = version\n\n    config = Configuration()\n    options: ConfigurationOptions\n\n    def __init__(self, tree: Module, filename: str = constants.STDIN) -> None:\n        \"\"\"Creates new checker instance.\"\"\"\n        self.tree = tree\n        self.filename = filename\n\n    @classmethod\n    def add_options(cls, parser: OptionManager) -> None:\n        \"\"\"Calls Configuration instance method for registering options.\"\"\"\n        cls.config.register_options(parser)\n\n    @classmethod\n    def parse_options(cls, options: ConfigurationOptions) -> None:\n        \"\"\"Parses registered options for providing to the visitor.\"\"\"\n        cls.options = options\n\n    def run(self) -> Generator[CheckResult, None, None]:\n        \"\"\"\n        Runs the checker.\n\n        This method is used by `flake8` API.\n        After all configuration is parsed and passed.\n        \"\"\"\n        for visitor_class in ENABLED_VISITORS:\n            visitor = visitor_class(\n                self.options,\n                tree=self.tree,\n                filename=self.filename,\n            )\n            visitor.run()\n\n            for error in visitor.errors:\n                yield (*error.node_items(), type(self))\n", "path": "wemake_python_styleguide/checker.py"}]}