We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add "wrapper" to NESTED_FUNCTIONS_WHITELIST?
# Rule request

## Thesis and reasoning

Decorators are often created inside functions. These decorators are then supposed to be used on top of other functions, which means they must accept one, and also that they will often create and return a new function by wrapping the original one. It's a level-3 nesting of functions. Maybe WPS430 should be relaxed, or `NESTED_FUNCTIONS_WHITELIST` could include another name like `wrapper`?

Code example:

```python
from functools import wraps


def python(versions):
    """Run through multiple Python versions."""

    def decorator(func):
        @wraps(func)
        def wrapper(context, *args, **kwargs):
            for version in versions:
                # do things with version and context
                func(context, *args, **kwargs)

        return wrapper

    return decorator


@python(["3.6", "3.7", "3.8"])
def task(context):
    ...
```

What do you think 🙂 ?


--- 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/constants.py`
Content:
```
1 """
2 This module contains list of white- and black-listed ``python`` members.
3 
4 We add values here when we want to make them public.
5 Or when a value is reused in several places.
6 Then, we automatically have to add it here and document it.
7 
8 Other constants that are not used across modules
9 and does not require to be documented can be defined where they are used.
10 
11 All values here must be documented with ``#:`` comments.
12 """
13 
14 import math
15 import re
16 
17 from typing_extensions import Final
18 
19 #: List of functions we forbid to use.
20 FUNCTIONS_BLACKLIST: Final = frozenset((
21     # Code generation:
22     'eval',
23     'exec',
24     'compile',
25 
26     # Termination:
27     'exit',
28     'quit',
29 
30     # Magic:
31     'globals',
32     'locals',
33     'vars',
34     'dir',
35 
36     # IO:
37     'print',
38     'pprint',
39     'input',
40     'breakpoint',
41 
42     # Attribute access:
43     'hasattr',
44     'delattr',
45 
46     # Gratis:
47     'copyright',
48     'help',
49     'credits',
50 
51     # Dynamic imports:
52     '__import__',
53 
54     # OOP:
55     'staticmethod',
56 
57     # Mypy:
58     'reveal_type',
59 ))
60 
61 #: List of module metadata we forbid to use.
62 MODULE_METADATA_VARIABLES_BLACKLIST: Final = frozenset((
63     '__author__',
64     '__all__',
65     '__version__',
66     '__about__',
67 ))
68 
69 #: List of variable names we forbid to use.
70 VARIABLE_NAMES_BLACKLIST: Final = frozenset((
71     # Meaningless words:
72     'data',
73     'result',
74     'results',
75     'item',
76     'items',
77     'value',
78     'values',
79     'val',
80     'vals',
81     'var',
82     'vars',
83     'variable',
84     'content',
85     'contents',
86     'info',
87     'handle',
88     'handler',
89     'file',
90     'obj',
91     'objects',
92     'objs',
93     'some',
94     'do',
95     'param',
96     'params',
97     'parameters',
98 
99     # Confuseables:
100     'no',
101     'true',
102     'false',
103 
104     # Names from examples:
105     'foo',
106     'bar',
107     'baz',
108 ))
109 
110 #: List of characters sequences that are hard to read.
111 UNREADABLE_CHARACTER_COMBINATIONS: Final = frozenset((
112     '1l',
113     '1I',
114     '0O',
115     'O0',
116     # Not included: 'lI', 'l1', 'Il'
117     # Because these names are quite common in real words.
118 ))
119 
120 #: List of special names that are used only as first argument in methods.
121 SPECIAL_ARGUMENT_NAMES_WHITELIST: Final = frozenset((
122     'self',
123     'cls',
124     'mcs',
125 ))
126 
127 #: List of all magic methods from the python docs.
128 ALL_MAGIC_METHODS: Final = frozenset((
129     '__new__',
130     '__init__',
131     '__del__',
132 
133     '__repr__',
134     '__str__',
135     '__bytes__',
136     '__format__',
137 
138     '__lt__',
139     '__le__',
140     '__eq__',
141     '__ne__',
142     '__gt__',
143     '__ge__',
144 
145     '__hash__',
146     '__bool__',
147 
148     '__getattr__',
149     '__getattribute__',
150     '__setattr__',
151     '__delattr__',
152     '__dir__',
153 
154     '__get__',
155     '__set__',
156     '__delete__',
157     '__set_name__',
158 
159     '__init_subclass__',
160     '__instancecheck__',
161     '__subclasscheck__',
162     '__class_getitem__',
163 
164     '__call__',
165     '__len__',
166     '__length_hint__',
167     '__getitem__',
168     '__setitem__',
169     '__delitem__',
170     '__missing__',
171     '__iter__',
172     '__reversed__',
173     '__contains__',
174 
175     '__add__',
176     '__sub__',
177     '__mul__',
178     '__matmul__',
179     '__truediv__',
180     '__floordiv__',
181     '__mod__',
182     '__divmod__',
183     '__pow__',
184     '__lshift__',
185     '__rshift__',
186     '__and__',
187     '__xor__',
188     '__or__',
189     '__radd__',
190     '__rsub__',
191     '__rmul__',
192     '__rmatmul__',
193     '__rtruediv__',
194     '__rfloordiv__',
195     '__rmod__',
196     '__rdivmod__',
197     '__rpow__',
198     '__rlshift__',
199     '__rrshift__',
200     '__rand__',
201     '__rxor__',
202     '__ror__',
203     '__iadd__',
204     '__isub__',
205     '__imul__',
206     '__imatmul__',
207     '__itruediv__',
208     '__ifloordiv__',
209     '__imod__',
210     '__ipow__',
211     '__ilshift__',
212     '__irshift__',
213     '__iand__',
214     '__ixor__',
215     '__ior__',
216     '__neg__',
217     '__pos__',
218     '__abs__',
219     '__invert__',
220     '__complex__',
221     '__int__',
222     '__float__',
223     '__index__',
224     '__round__',
225     '__trunc__',
226     '__floor__',
227     '__ceil__',
228 
229     '__enter__',
230     '__exit__',
231 
232     '__await__',
233     '__aiter__',
234     '__anext__',
235     '__aenter__',
236     '__aexit__',
237 ))
238 
239 #: List of magic methods that are forbidden to use.
240 MAGIC_METHODS_BLACKLIST: Final = frozenset((
241     # Since we don't use `del`:
242     '__del__',
243     '__delitem__',
244     '__delete__',
245 
246     # Since we don't use `pickle`:
247     '__reduce__',
248     '__reduce_ex__',
249 
250     '__dir__',  # since we don't use `dir()`
251     '__delattr__',  # since we don't use `delattr()`
252 ))
253 
254 #: List of magic methods that are not allowed to be generators.
255 YIELD_MAGIC_METHODS_BLACKLIST: Final = ALL_MAGIC_METHODS.difference({
256     # Allowed to be used with ``yield`` keyword:
257     '__call__',  # Fixes Issue:146
258     '__iter__',
259 })
260 
261 #: List of magic methods that are not allowed to be async.
262 ASYNC_MAGIC_METHODS_BLACKLIST: Final = ALL_MAGIC_METHODS.difference({
263     # In order of appearance on
264     # https://docs.python.org/3/reference/datamodel.html#basic-customization
265     # Allowed magic methods are:
266     '__anext__',
267     '__aenter__',
268     '__aexit__',
269 })
270 
271 #: List of builtin classes that are allowed to subclass.
272 ALLOWED_BUILTIN_CLASSES: Final = frozenset((
273     'type',
274     'object',
275 ))
276 
277 #: List of nested functions' names we allow to use.
278 NESTED_FUNCTIONS_WHITELIST: Final = frozenset((
279     'decorator',
280     'factory',
281 ))
282 
283 #: List of allowed ``__future__`` imports.
284 FUTURE_IMPORTS_WHITELIST: Final = frozenset((
285     'annotations',
286     'generator_stop',
287 ))
288 
289 #: List of blacklisted module names.
290 MODULE_NAMES_BLACKLIST: Final = frozenset((
291     'util',
292     'utils',
293     'utilities',
294     'helpers',
295 ))
296 
297 #: List of allowed module magic names.
298 MAGIC_MODULE_NAMES_WHITELIST: Final = frozenset((
299     '__init__',
300     '__main__',
301 ))
302 
303 #: List of bad magic module functions.
304 MAGIC_MODULE_NAMES_BLACKLIST: Final = frozenset((
305     '__getattr__',
306     '__dir__',
307 ))
308 
309 #: Regex pattern to name modules.
310 MODULE_NAME_PATTERN: Final = re.compile(r'^_?_?[a-z][a-z\d_]*[a-z\d](__)?$')
311 
312 #: Common numbers that are allowed to be used without being called "magic".
313 MAGIC_NUMBERS_WHITELIST: Final = frozenset((
314     0,  # both int and float
315     0.1,
316     0.5,
317     1.0,
318     100,
319     1000,
320     1024,  # bytes
321     24,  # hours
322     60,  # seconds, minutes
323 
324     1j,  # imaginary part of a complex number
325 ))
326 
327 #: Maximum amount of ``pragma`` no-cover comments per module.
328 MAX_NO_COVER_COMMENTS: Final = 5
329 
330 #: Maximum length of ``yield`` ``tuple`` expressions.
331 MAX_LEN_YIELD_TUPLE: Final = 5
332 
333 #: Maximum number of compare nodes in a single expression.
334 MAX_COMPARES: Final = 2
335 
336 #: Maximum number of conditions in a single ``if`` or ``while`` statement.
337 MAX_CONDITIONS: Final = 4
338 
339 #: Maximum number of `elif` blocks in a single `if` condition:
340 MAX_ELIFS: Final = 3
341 
342 #: Maximum number of ``except`` cases in a single ``try`` clause.
343 MAX_EXCEPT_CASES: Final = 3
344 
345 #: Approximate constants which real values should be imported from math module.
346 MATH_APPROXIMATE_CONSTANTS: Final = frozenset((
347     math.pi,
348     math.e,
349     math.tau,
350 ))
351 
352 #: List of vague method names that may cause confusion if imported as is:
353 VAGUE_IMPORTS_BLACKLIST: Final = frozenset((
354     'read',
355     'write',
356     'load',
357     'loads',
358     'dump',
359     'dumps',
360     'parse',
361     'safe_load',
362     'safe_dump',
363     'load_all',
364     'dump_all',
365     'safe_load_all',
366     'safe_dump_all',
367 ))
368 
369 #: List of literals without arguments we forbid to use.
370 LITERALS_BLACKLIST: Final = frozenset((
371     'int',
372     'float',
373     'str',
374     'bytes',
375     'bool',
376     'complex',
377 ))
378 
379 #: List of functions in which arguments must be tuples.
380 TUPLE_ARGUMENTS_METHODS: Final = frozenset((
381     'frozenset',
382 ))
383 
384 #: Conditions that can appear in the ``if`` statement to allow nested imports.
385 ALLOWED_NESTED_IMPORTS_CONDITIONS: Final = frozenset((
386     'TYPE_CHECKING',
387 ))
388 
389 #: List of commonly used aliases
390 ALIAS_NAMES_WHITELIST: Final = frozenset((
391     'np',
392     'pd',
393     'df',
394     'plt',
395     'sns',
396     'tf',
397     'cv',
398 ))
399 
400 # Internal variables
401 # ==================
402 
403 # Please, do not touch values beyond this line!
404 # ---------------------------------------------
405 
406 # They are not publicly documented since they are not used by the end user.
407 # But, we still need them to be defined here.
408 
409 # Used as a default filename, when it is not passed by flake8:
410 STDIN: Final = 'stdin'
411 
412 # Used to specify as a placeholder for `__init__`:
413 INIT: Final = '__init__'
414 
415 # Used to determine when we are running on Windows:
416 WINDOWS_OS: Final = 'nt'
417 
418 # Used as a placeholder for special `_` variable:
419 UNUSED_PLACEHOLDER: Final = '_'
420
```
--- 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/constants.py b/wemake_python_styleguide/constants.py
--- a/wemake_python_styleguide/constants.py
+++ b/wemake_python_styleguide/constants.py
@@ -278,6 +278,7 @@
 NESTED_FUNCTIONS_WHITELIST: Final = frozenset((
     'decorator',
     'factory',
+    'wrapper',
 ))
 
 #: List of allowed ``__future__`` imports.

{"golden_diff": "diff --git a/wemake_python_styleguide/constants.py b/wemake_python_styleguide/constants.py\n--- a/wemake_python_styleguide/constants.py\n+++ b/wemake_python_styleguide/constants.py\n@@ -278,6 +278,7 @@\n NESTED_FUNCTIONS_WHITELIST: Final = frozenset((\n     'decorator',\n     'factory',\n+    'wrapper',\n ))\n \n #: List of allowed ``__future__`` imports.\n", "issue": "Add \"wrapper\" to NESTED_FUNCTIONS_WHITELIST?\n# Rule request\r\n\r\n## Thesis and reasoning\r\n\r\nDecorators are often created inside functions. These decorators are then supposed to be used on top of other functions, which means they must accept one, and also that they will often create and return a new function by wrapping the original one. It's a level-3 nesting of functions. Maybe WPS430 should be relaxed, or `NESTED_FUNCTIONS_WHITELIST` could include another name like `wrapper`?\r\n\r\nCode example:\r\n\r\n```python\r\nfrom functools import wraps\r\n\r\n\r\ndef python(versions):\r\n    \"\"\"Run through multiple Python versions.\"\"\"\r\n\r\n    def decorator(func):\r\n        @wraps(func)\r\n        def wrapper(context, *args, **kwargs):\r\n            for version in versions:\r\n                # do things with version and context\r\n                func(context, *args, **kwargs)\r\n\r\n        return wrapper\r\n\r\n    return decorator\r\n\r\n\r\n@python([\"3.6\", \"3.7\", \"3.8\"])\r\ndef task(context):\r\n    ...\r\n```\r\n\r\nWhat do you think \ud83d\ude42 ?\r\n\n", "before_files": [{"content": "\"\"\"\nThis module contains list of white- and black-listed ``python`` members.\n\nWe add values here when we want to make them public.\nOr when a value is reused in several places.\nThen, we automatically have to add it here and document it.\n\nOther constants that are not used across modules\nand does not require to be documented can be defined where they are used.\n\nAll values here must be documented with ``#:`` comments.\n\"\"\"\n\nimport math\nimport re\n\nfrom typing_extensions import Final\n\n#: List of functions we forbid to use.\nFUNCTIONS_BLACKLIST: Final = frozenset((\n    # Code generation:\n    'eval',\n    'exec',\n    'compile',\n\n    # Termination:\n    'exit',\n    'quit',\n\n    # Magic:\n    'globals',\n    'locals',\n    'vars',\n    'dir',\n\n    # IO:\n    'print',\n    'pprint',\n    'input',\n    'breakpoint',\n\n    # Attribute access:\n    'hasattr',\n    'delattr',\n\n    # Gratis:\n    'copyright',\n    'help',\n    'credits',\n\n    # Dynamic imports:\n    '__import__',\n\n    # OOP:\n    'staticmethod',\n\n    # Mypy:\n    'reveal_type',\n))\n\n#: List of module metadata we forbid to use.\nMODULE_METADATA_VARIABLES_BLACKLIST: Final = frozenset((\n    '__author__',\n    '__all__',\n    '__version__',\n    '__about__',\n))\n\n#: List of variable names we forbid to use.\nVARIABLE_NAMES_BLACKLIST: Final = frozenset((\n    # Meaningless words:\n    'data',\n    'result',\n    'results',\n    'item',\n    'items',\n    'value',\n    'values',\n    'val',\n    'vals',\n    'var',\n    'vars',\n    'variable',\n    'content',\n    'contents',\n    'info',\n    'handle',\n    'handler',\n    'file',\n    'obj',\n    'objects',\n    'objs',\n    'some',\n    'do',\n    'param',\n    'params',\n    'parameters',\n\n    # Confuseables:\n    'no',\n    'true',\n    'false',\n\n    # Names from examples:\n    'foo',\n    'bar',\n    'baz',\n))\n\n#: List of characters sequences that are hard to read.\nUNREADABLE_CHARACTER_COMBINATIONS: Final = frozenset((\n    '1l',\n    '1I',\n    '0O',\n    'O0',\n    # Not included: 'lI', 'l1', 'Il'\n    # Because these names are quite common in real words.\n))\n\n#: List of special names that are used only as first argument in methods.\nSPECIAL_ARGUMENT_NAMES_WHITELIST: Final = frozenset((\n    'self',\n    'cls',\n    'mcs',\n))\n\n#: List of all magic methods from the python docs.\nALL_MAGIC_METHODS: Final = frozenset((\n    '__new__',\n    '__init__',\n    '__del__',\n\n    '__repr__',\n    '__str__',\n    '__bytes__',\n    '__format__',\n\n    '__lt__',\n    '__le__',\n    '__eq__',\n    '__ne__',\n    '__gt__',\n    '__ge__',\n\n    '__hash__',\n    '__bool__',\n\n    '__getattr__',\n    '__getattribute__',\n    '__setattr__',\n    '__delattr__',\n    '__dir__',\n\n    '__get__',\n    '__set__',\n    '__delete__',\n    '__set_name__',\n\n    '__init_subclass__',\n    '__instancecheck__',\n    '__subclasscheck__',\n    '__class_getitem__',\n\n    '__call__',\n    '__len__',\n    '__length_hint__',\n    '__getitem__',\n    '__setitem__',\n    '__delitem__',\n    '__missing__',\n    '__iter__',\n    '__reversed__',\n    '__contains__',\n\n    '__add__',\n    '__sub__',\n    '__mul__',\n    '__matmul__',\n    '__truediv__',\n    '__floordiv__',\n    '__mod__',\n    '__divmod__',\n    '__pow__',\n    '__lshift__',\n    '__rshift__',\n    '__and__',\n    '__xor__',\n    '__or__',\n    '__radd__',\n    '__rsub__',\n    '__rmul__',\n    '__rmatmul__',\n    '__rtruediv__',\n    '__rfloordiv__',\n    '__rmod__',\n    '__rdivmod__',\n    '__rpow__',\n    '__rlshift__',\n    '__rrshift__',\n    '__rand__',\n    '__rxor__',\n    '__ror__',\n    '__iadd__',\n    '__isub__',\n    '__imul__',\n    '__imatmul__',\n    '__itruediv__',\n    '__ifloordiv__',\n    '__imod__',\n    '__ipow__',\n    '__ilshift__',\n    '__irshift__',\n    '__iand__',\n    '__ixor__',\n    '__ior__',\n    '__neg__',\n    '__pos__',\n    '__abs__',\n    '__invert__',\n    '__complex__',\n    '__int__',\n    '__float__',\n    '__index__',\n    '__round__',\n    '__trunc__',\n    '__floor__',\n    '__ceil__',\n\n    '__enter__',\n    '__exit__',\n\n    '__await__',\n    '__aiter__',\n    '__anext__',\n    '__aenter__',\n    '__aexit__',\n))\n\n#: List of magic methods that are forbidden to use.\nMAGIC_METHODS_BLACKLIST: Final = frozenset((\n    # Since we don't use `del`:\n    '__del__',\n    '__delitem__',\n    '__delete__',\n\n    # Since we don't use `pickle`:\n    '__reduce__',\n    '__reduce_ex__',\n\n    '__dir__',  # since we don't use `dir()`\n    '__delattr__',  # since we don't use `delattr()`\n))\n\n#: List of magic methods that are not allowed to be generators.\nYIELD_MAGIC_METHODS_BLACKLIST: Final = ALL_MAGIC_METHODS.difference({\n    # Allowed to be used with ``yield`` keyword:\n    '__call__',  # Fixes Issue:146\n    '__iter__',\n})\n\n#: List of magic methods that are not allowed to be async.\nASYNC_MAGIC_METHODS_BLACKLIST: Final = ALL_MAGIC_METHODS.difference({\n    # In order of appearance on\n    # https://docs.python.org/3/reference/datamodel.html#basic-customization\n    # Allowed magic methods are:\n    '__anext__',\n    '__aenter__',\n    '__aexit__',\n})\n\n#: List of builtin classes that are allowed to subclass.\nALLOWED_BUILTIN_CLASSES: Final = frozenset((\n    'type',\n    'object',\n))\n\n#: List of nested functions' names we allow to use.\nNESTED_FUNCTIONS_WHITELIST: Final = frozenset((\n    'decorator',\n    'factory',\n))\n\n#: List of allowed ``__future__`` imports.\nFUTURE_IMPORTS_WHITELIST: Final = frozenset((\n    'annotations',\n    'generator_stop',\n))\n\n#: List of blacklisted module names.\nMODULE_NAMES_BLACKLIST: Final = frozenset((\n    'util',\n    'utils',\n    'utilities',\n    'helpers',\n))\n\n#: List of allowed module magic names.\nMAGIC_MODULE_NAMES_WHITELIST: Final = frozenset((\n    '__init__',\n    '__main__',\n))\n\n#: List of bad magic module functions.\nMAGIC_MODULE_NAMES_BLACKLIST: Final = frozenset((\n    '__getattr__',\n    '__dir__',\n))\n\n#: Regex pattern to name modules.\nMODULE_NAME_PATTERN: Final = re.compile(r'^_?_?[a-z][a-z\\d_]*[a-z\\d](__)?$')\n\n#: Common numbers that are allowed to be used without being called \"magic\".\nMAGIC_NUMBERS_WHITELIST: Final = frozenset((\n    0,  # both int and float\n    0.1,\n    0.5,\n    1.0,\n    100,\n    1000,\n    1024,  # bytes\n    24,  # hours\n    60,  # seconds, minutes\n\n    1j,  # imaginary part of a complex number\n))\n\n#: Maximum amount of ``pragma`` no-cover comments per module.\nMAX_NO_COVER_COMMENTS: Final = 5\n\n#: Maximum length of ``yield`` ``tuple`` expressions.\nMAX_LEN_YIELD_TUPLE: Final = 5\n\n#: Maximum number of compare nodes in a single expression.\nMAX_COMPARES: Final = 2\n\n#: Maximum number of conditions in a single ``if`` or ``while`` statement.\nMAX_CONDITIONS: Final = 4\n\n#: Maximum number of `elif` blocks in a single `if` condition:\nMAX_ELIFS: Final = 3\n\n#: Maximum number of ``except`` cases in a single ``try`` clause.\nMAX_EXCEPT_CASES: Final = 3\n\n#: Approximate constants which real values should be imported from math module.\nMATH_APPROXIMATE_CONSTANTS: Final = frozenset((\n    math.pi,\n    math.e,\n    math.tau,\n))\n\n#: List of vague method names that may cause confusion if imported as is:\nVAGUE_IMPORTS_BLACKLIST: Final = frozenset((\n    'read',\n    'write',\n    'load',\n    'loads',\n    'dump',\n    'dumps',\n    'parse',\n    'safe_load',\n    'safe_dump',\n    'load_all',\n    'dump_all',\n    'safe_load_all',\n    'safe_dump_all',\n))\n\n#: List of literals without arguments we forbid to use.\nLITERALS_BLACKLIST: Final = frozenset((\n    'int',\n    'float',\n    'str',\n    'bytes',\n    'bool',\n    'complex',\n))\n\n#: List of functions in which arguments must be tuples.\nTUPLE_ARGUMENTS_METHODS: Final = frozenset((\n    'frozenset',\n))\n\n#: Conditions that can appear in the ``if`` statement to allow nested imports.\nALLOWED_NESTED_IMPORTS_CONDITIONS: Final = frozenset((\n    'TYPE_CHECKING',\n))\n\n#: List of commonly used aliases\nALIAS_NAMES_WHITELIST: Final = frozenset((\n    'np',\n    'pd',\n    'df',\n    'plt',\n    'sns',\n    'tf',\n    'cv',\n))\n\n# Internal variables\n# ==================\n\n# Please, do not touch values beyond this line!\n# ---------------------------------------------\n\n# They are not publicly documented since they are not used by the end user.\n# But, we still need them to be defined here.\n\n# Used as a default filename, when it is not passed by flake8:\nSTDIN: Final = 'stdin'\n\n# Used to specify as a placeholder for `__init__`:\nINIT: Final = '__init__'\n\n# Used to determine when we are running on Windows:\nWINDOWS_OS: Final = 'nt'\n\n# Used as a placeholder for special `_` variable:\nUNUSED_PLACEHOLDER: Final = '_'\n", "path": "wemake_python_styleguide/constants.py"}], "after_files": [{"content": "\"\"\"\nThis module contains list of white- and black-listed ``python`` members.\n\nWe add values here when we want to make them public.\nOr when a value is reused in several places.\nThen, we automatically have to add it here and document it.\n\nOther constants that are not used across modules\nand does not require to be documented can be defined where they are used.\n\nAll values here must be documented with ``#:`` comments.\n\"\"\"\n\nimport math\nimport re\n\nfrom typing_extensions import Final\n\n#: List of functions we forbid to use.\nFUNCTIONS_BLACKLIST: Final = frozenset((\n    # Code generation:\n    'eval',\n    'exec',\n    'compile',\n\n    # Termination:\n    'exit',\n    'quit',\n\n    # Magic:\n    'globals',\n    'locals',\n    'vars',\n    'dir',\n\n    # IO:\n    'print',\n    'pprint',\n    'input',\n    'breakpoint',\n\n    # Attribute access:\n    'hasattr',\n    'delattr',\n\n    # Gratis:\n    'copyright',\n    'help',\n    'credits',\n\n    # Dynamic imports:\n    '__import__',\n\n    # OOP:\n    'staticmethod',\n\n    # Mypy:\n    'reveal_type',\n))\n\n#: List of module metadata we forbid to use.\nMODULE_METADATA_VARIABLES_BLACKLIST: Final = frozenset((\n    '__author__',\n    '__all__',\n    '__version__',\n    '__about__',\n))\n\n#: List of variable names we forbid to use.\nVARIABLE_NAMES_BLACKLIST: Final = frozenset((\n    # Meaningless words:\n    'data',\n    'result',\n    'results',\n    'item',\n    'items',\n    'value',\n    'values',\n    'val',\n    'vals',\n    'var',\n    'vars',\n    'variable',\n    'content',\n    'contents',\n    'info',\n    'handle',\n    'handler',\n    'file',\n    'obj',\n    'objects',\n    'objs',\n    'some',\n    'do',\n    'param',\n    'params',\n    'parameters',\n\n    # Confuseables:\n    'no',\n    'true',\n    'false',\n\n    # Names from examples:\n    'foo',\n    'bar',\n    'baz',\n))\n\n#: List of characters sequences that are hard to read.\nUNREADABLE_CHARACTER_COMBINATIONS: Final = frozenset((\n    '1l',\n    '1I',\n    '0O',\n    'O0',\n    # Not included: 'lI', 'l1', 'Il'\n    # Because these names are quite common in real words.\n))\n\n#: List of special names that are used only as first argument in methods.\nSPECIAL_ARGUMENT_NAMES_WHITELIST: Final = frozenset((\n    'self',\n    'cls',\n    'mcs',\n))\n\n#: List of all magic methods from the python docs.\nALL_MAGIC_METHODS: Final = frozenset((\n    '__new__',\n    '__init__',\n    '__del__',\n\n    '__repr__',\n    '__str__',\n    '__bytes__',\n    '__format__',\n\n    '__lt__',\n    '__le__',\n    '__eq__',\n    '__ne__',\n    '__gt__',\n    '__ge__',\n\n    '__hash__',\n    '__bool__',\n\n    '__getattr__',\n    '__getattribute__',\n    '__setattr__',\n    '__delattr__',\n    '__dir__',\n\n    '__get__',\n    '__set__',\n    '__delete__',\n    '__set_name__',\n\n    '__init_subclass__',\n    '__instancecheck__',\n    '__subclasscheck__',\n    '__class_getitem__',\n\n    '__call__',\n    '__len__',\n    '__length_hint__',\n    '__getitem__',\n    '__setitem__',\n    '__delitem__',\n    '__missing__',\n    '__iter__',\n    '__reversed__',\n    '__contains__',\n\n    '__add__',\n    '__sub__',\n    '__mul__',\n    '__matmul__',\n    '__truediv__',\n    '__floordiv__',\n    '__mod__',\n    '__divmod__',\n    '__pow__',\n    '__lshift__',\n    '__rshift__',\n    '__and__',\n    '__xor__',\n    '__or__',\n    '__radd__',\n    '__rsub__',\n    '__rmul__',\n    '__rmatmul__',\n    '__rtruediv__',\n    '__rfloordiv__',\n    '__rmod__',\n    '__rdivmod__',\n    '__rpow__',\n    '__rlshift__',\n    '__rrshift__',\n    '__rand__',\n    '__rxor__',\n    '__ror__',\n    '__iadd__',\n    '__isub__',\n    '__imul__',\n    '__imatmul__',\n    '__itruediv__',\n    '__ifloordiv__',\n    '__imod__',\n    '__ipow__',\n    '__ilshift__',\n    '__irshift__',\n    '__iand__',\n    '__ixor__',\n    '__ior__',\n    '__neg__',\n    '__pos__',\n    '__abs__',\n    '__invert__',\n    '__complex__',\n    '__int__',\n    '__float__',\n    '__index__',\n    '__round__',\n    '__trunc__',\n    '__floor__',\n    '__ceil__',\n\n    '__enter__',\n    '__exit__',\n\n    '__await__',\n    '__aiter__',\n    '__anext__',\n    '__aenter__',\n    '__aexit__',\n))\n\n#: List of magic methods that are forbidden to use.\nMAGIC_METHODS_BLACKLIST: Final = frozenset((\n    # Since we don't use `del`:\n    '__del__',\n    '__delitem__',\n    '__delete__',\n\n    # Since we don't use `pickle`:\n    '__reduce__',\n    '__reduce_ex__',\n\n    '__dir__',  # since we don't use `dir()`\n    '__delattr__',  # since we don't use `delattr()`\n))\n\n#: List of magic methods that are not allowed to be generators.\nYIELD_MAGIC_METHODS_BLACKLIST: Final = ALL_MAGIC_METHODS.difference({\n    # Allowed to be used with ``yield`` keyword:\n    '__call__',  # Fixes Issue:146\n    '__iter__',\n})\n\n#: List of magic methods that are not allowed to be async.\nASYNC_MAGIC_METHODS_BLACKLIST: Final = ALL_MAGIC_METHODS.difference({\n    # In order of appearance on\n    # https://docs.python.org/3/reference/datamodel.html#basic-customization\n    # Allowed magic methods are:\n    '__anext__',\n    '__aenter__',\n    '__aexit__',\n})\n\n#: List of builtin classes that are allowed to subclass.\nALLOWED_BUILTIN_CLASSES: Final = frozenset((\n    'type',\n    'object',\n))\n\n#: List of nested functions' names we allow to use.\nNESTED_FUNCTIONS_WHITELIST: Final = frozenset((\n    'decorator',\n    'factory',\n    'wrapper',\n))\n\n#: List of allowed ``__future__`` imports.\nFUTURE_IMPORTS_WHITELIST: Final = frozenset((\n    'annotations',\n    'generator_stop',\n))\n\n#: List of blacklisted module names.\nMODULE_NAMES_BLACKLIST: Final = frozenset((\n    'util',\n    'utils',\n    'utilities',\n    'helpers',\n))\n\n#: List of allowed module magic names.\nMAGIC_MODULE_NAMES_WHITELIST: Final = frozenset((\n    '__init__',\n    '__main__',\n))\n\n#: List of bad magic module functions.\nMAGIC_MODULE_NAMES_BLACKLIST: Final = frozenset((\n    '__getattr__',\n    '__dir__',\n))\n\n#: Regex pattern to name modules.\nMODULE_NAME_PATTERN: Final = re.compile(r'^_?_?[a-z][a-z\\d_]*[a-z\\d](__)?$')\n\n#: Common numbers that are allowed to be used without being called \"magic\".\nMAGIC_NUMBERS_WHITELIST: Final = frozenset((\n    0,  # both int and float\n    0.1,\n    0.5,\n    1.0,\n    100,\n    1000,\n    1024,  # bytes\n    24,  # hours\n    60,  # seconds, minutes\n\n    1j,  # imaginary part of a complex number\n))\n\n#: Maximum amount of ``pragma`` no-cover comments per module.\nMAX_NO_COVER_COMMENTS: Final = 5\n\n#: Maximum length of ``yield`` ``tuple`` expressions.\nMAX_LEN_YIELD_TUPLE: Final = 5\n\n#: Maximum number of compare nodes in a single expression.\nMAX_COMPARES: Final = 2\n\n#: Maximum number of conditions in a single ``if`` or ``while`` statement.\nMAX_CONDITIONS: Final = 4\n\n#: Maximum number of `elif` blocks in a single `if` condition:\nMAX_ELIFS: Final = 3\n\n#: Maximum number of ``except`` cases in a single ``try`` clause.\nMAX_EXCEPT_CASES: Final = 3\n\n#: Approximate constants which real values should be imported from math module.\nMATH_APPROXIMATE_CONSTANTS: Final = frozenset((\n    math.pi,\n    math.e,\n    math.tau,\n))\n\n#: List of vague method names that may cause confusion if imported as is:\nVAGUE_IMPORTS_BLACKLIST: Final = frozenset((\n    'read',\n    'write',\n    'load',\n    'loads',\n    'dump',\n    'dumps',\n    'parse',\n    'safe_load',\n    'safe_dump',\n    'load_all',\n    'dump_all',\n    'safe_load_all',\n    'safe_dump_all',\n))\n\n#: List of literals without arguments we forbid to use.\nLITERALS_BLACKLIST: Final = frozenset((\n    'int',\n    'float',\n    'str',\n    'bytes',\n    'bool',\n    'complex',\n))\n\n#: List of functions in which arguments must be tuples.\nTUPLE_ARGUMENTS_METHODS: Final = frozenset((\n    'frozenset',\n))\n\n#: Conditions that can appear in the ``if`` statement to allow nested imports.\nALLOWED_NESTED_IMPORTS_CONDITIONS: Final = frozenset((\n    'TYPE_CHECKING',\n))\n\n#: List of commonly used aliases\nALIAS_NAMES_WHITELIST: Final = frozenset((\n    'np',\n    'pd',\n    'df',\n    'plt',\n    'sns',\n    'tf',\n    'cv',\n))\n\n# Internal variables\n# ==================\n\n# Please, do not touch values beyond this line!\n# ---------------------------------------------\n\n# They are not publicly documented since they are not used by the end user.\n# But, we still need them to be defined here.\n\n# Used as a default filename, when it is not passed by flake8:\nSTDIN: Final = 'stdin'\n\n# Used to specify as a placeholder for `__init__`:\nINIT: Final = '__init__'\n\n# Used to determine when we are running on Windows:\nWINDOWS_OS: Final = 'nt'\n\n# Used as a placeholder for special `_` variable:\nUNUSED_PLACEHOLDER: Final = '_'\n", "path": "wemake_python_styleguide/constants.py"}]}