We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Feature: allow magic numbers in async functions constructors
We check that some magic numbers can be used in function constructors like so:

```python
def some_function(price, delta=0.1):
      return price * delta
```

But, we only allow regular functions, not `async` ones: https://github.com/wemake-services/wemake-python-styleguide/blob/master/wemake_python_styleguide/visitors/ast/numbers.py#L19-L21

What we need to do is:
1. Add `ast.AsyncFunctionDef` to the allowed list
2. Write a unit test for it: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_visitors/test_ast/test_general/test_magic_numbers.py

--- 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/visitors/ast/numbers.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 import ast
4 from typing import Optional
5 
6 from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST
7 from wemake_python_styleguide.violations.best_practices import (
8     MagicNumberViolation,
9 )
10 from wemake_python_styleguide.visitors.base import BaseNodeVisitor
11 
12 
13 class MagicNumberVisitor(BaseNodeVisitor):
14     """Checks magic numbers used in the code."""
15 
16     _ALLOWED_PARENTS = (
17         ast.Assign,
18 
19         # Constructor usages:
20         ast.FunctionDef,
21         ast.arguments,
22 
23         # Primitives:
24         ast.List,
25         ast.Dict,
26         ast.Set,
27         ast.Tuple,
28     )
29 
30     # TODO: make consistent naming rules for class attributes:
31     _PROXY_PARENTS = (
32         ast.UnaryOp,
33     )
34 
35     def _get_real_parent(self, node: Optional[ast.AST]) -> Optional[ast.AST]:
36         """
37         Returns real number's parent.
38 
39         What can go wrong?
40 
41         1. Number can be negative: ``x = -1``,
42           so ``1`` has ``UnaryOp`` as parent, but should return ``Assign``
43 
44         """
45         parent = getattr(node, 'parent', None)
46         if isinstance(parent, self._PROXY_PARENTS):
47             return self._get_real_parent(parent)
48         return parent
49 
50     def _check_is_magic(self, node: ast.Num) -> None:
51         parent = self._get_real_parent(node)
52         if isinstance(parent, self._ALLOWED_PARENTS):
53             return
54 
55         if node.n in MAGIC_NUMBERS_WHITELIST:
56             return
57 
58         if isinstance(node.n, int) and node.n <= 10:
59             return
60 
61         self.add_violation(MagicNumberViolation(node, text=str(node.n)))
62 
63     def visit_Num(self, node: ast.Num) -> None:
64         """
65         Checks numbers not to be magic constants inside the code.
66 
67         Raises:
68             MagicNumberViolation
69 
70         """
71         self._check_is_magic(node)
72         self.generic_visit(node)
73
```
--- 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/wemake_python_styleguide/visitors/ast/numbers.py b/wemake_python_styleguide/visitors/ast/numbers.py
--- a/wemake_python_styleguide/visitors/ast/numbers.py
+++ b/wemake_python_styleguide/visitors/ast/numbers.py
@@ -18,6 +18,7 @@
 
         # Constructor usages:
         ast.FunctionDef,
+        ast.AsyncFunctionDef,
         ast.arguments,
 
         # Primitives:

{"golden_diff": "diff --git a/wemake_python_styleguide/visitors/ast/numbers.py b/wemake_python_styleguide/visitors/ast/numbers.py\n--- a/wemake_python_styleguide/visitors/ast/numbers.py\n+++ b/wemake_python_styleguide/visitors/ast/numbers.py\n@@ -18,6 +18,7 @@\n \n         # Constructor usages:\n         ast.FunctionDef,\n+        ast.AsyncFunctionDef,\n         ast.arguments,\n \n         # Primitives:\n", "issue": "Feature: allow magic numbers in async functions constructors\nWe check that some magic numbers can be used in function constructors like so:\r\n\r\n```python\r\ndef some_function(price, delta=0.1):\r\n      return price * delta\r\n```\r\n\r\nBut, we only allow regular functions, not `async` ones: https://github.com/wemake-services/wemake-python-styleguide/blob/master/wemake_python_styleguide/visitors/ast/numbers.py#L19-L21\r\n\r\nWhat we need to do is:\r\n1. Add `ast.AsyncFunctionDef` to the allowed list\r\n2. Write a unit test for it: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_visitors/test_ast/test_general/test_magic_numbers.py\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport ast\nfrom typing import Optional\n\nfrom wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST\nfrom wemake_python_styleguide.violations.best_practices import (\n    MagicNumberViolation,\n)\nfrom wemake_python_styleguide.visitors.base import BaseNodeVisitor\n\n\nclass MagicNumberVisitor(BaseNodeVisitor):\n    \"\"\"Checks magic numbers used in the code.\"\"\"\n\n    _ALLOWED_PARENTS = (\n        ast.Assign,\n\n        # Constructor usages:\n        ast.FunctionDef,\n        ast.arguments,\n\n        # Primitives:\n        ast.List,\n        ast.Dict,\n        ast.Set,\n        ast.Tuple,\n    )\n\n    # TODO: make consistent naming rules for class attributes:\n    _PROXY_PARENTS = (\n        ast.UnaryOp,\n    )\n\n    def _get_real_parent(self, node: Optional[ast.AST]) -> Optional[ast.AST]:\n        \"\"\"\n        Returns real number's parent.\n\n        What can go wrong?\n\n        1. Number can be negative: ``x = -1``,\n          so ``1`` has ``UnaryOp`` as parent, but should return ``Assign``\n\n        \"\"\"\n        parent = getattr(node, 'parent', None)\n        if isinstance(parent, self._PROXY_PARENTS):\n            return self._get_real_parent(parent)\n        return parent\n\n    def _check_is_magic(self, node: ast.Num) -> None:\n        parent = self._get_real_parent(node)\n        if isinstance(parent, self._ALLOWED_PARENTS):\n            return\n\n        if node.n in MAGIC_NUMBERS_WHITELIST:\n            return\n\n        if isinstance(node.n, int) and node.n <= 10:\n            return\n\n        self.add_violation(MagicNumberViolation(node, text=str(node.n)))\n\n    def visit_Num(self, node: ast.Num) -> None:\n        \"\"\"\n        Checks numbers not to be magic constants inside the code.\n\n        Raises:\n            MagicNumberViolation\n\n        \"\"\"\n        self._check_is_magic(node)\n        self.generic_visit(node)\n", "path": "wemake_python_styleguide/visitors/ast/numbers.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport ast\nfrom typing import Optional\n\nfrom wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST\nfrom wemake_python_styleguide.violations.best_practices import (\n    MagicNumberViolation,\n)\nfrom wemake_python_styleguide.visitors.base import BaseNodeVisitor\n\n\nclass MagicNumberVisitor(BaseNodeVisitor):\n    \"\"\"Checks magic numbers used in the code.\"\"\"\n\n    _ALLOWED_PARENTS = (\n        ast.Assign,\n\n        # Constructor usages:\n        ast.FunctionDef,\n        ast.AsyncFunctionDef,\n        ast.arguments,\n\n        # Primitives:\n        ast.List,\n        ast.Dict,\n        ast.Set,\n        ast.Tuple,\n    )\n\n    _PROXY_PARENTS = (\n        ast.UnaryOp,\n    )\n\n    def _get_real_parent(self, node: Optional[ast.AST]) -> Optional[ast.AST]:\n        \"\"\"\n        Returns real number's parent.\n\n        What can go wrong?\n\n        1. Number can be negative: ``x = -1``,\n          so ``1`` has ``UnaryOp`` as parent, but should return ``Assign``\n\n        \"\"\"\n        parent = getattr(node, 'parent', None)\n        if isinstance(parent, self._PROXY_PARENTS):\n            return self._get_real_parent(parent)\n        return parent\n\n    def _check_is_magic(self, node: ast.Num) -> None:\n        parent = self._get_real_parent(node)\n        if isinstance(parent, self._ALLOWED_PARENTS):\n            return\n\n        if node.n in MAGIC_NUMBERS_WHITELIST:\n            return\n\n        if isinstance(node.n, int) and node.n <= 10:\n            return\n\n        self.add_violation(MagicNumberViolation(node, text=str(node.n)))\n\n    def visit_Num(self, node: ast.Num) -> None:\n        \"\"\"\n        Checks numbers not to be magic constants inside the code.\n\n        Raises:\n            MagicNumberViolation\n\n        \"\"\"\n        self._check_is_magic(node)\n        self.generic_visit(node)\n", "path": "wemake_python_styleguide/visitors/ast/numbers.py"}]}