We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
False positive for `WPS345 Found meaningless number operation`
# Bug report

<!--
Hi, thanks for submitting a bug. We appreciate that.

But, we will need some information about what's wrong to help you.
-->

## What's wrong

False positive for `1 / some`:

```
  13:12    WPS345 Found meaningless number operation
  return 1 / number
```

<!-- Describe what is not working. Please, attach a traceback. -->

## How is that should be

`1 / ANY` should be allowed.



--- 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/operators.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 import ast
4 from typing import ClassVar, Mapping, Optional, Tuple, Type
5 
6 from typing_extensions import final
7 
8 from wemake_python_styleguide.logic import walk
9 from wemake_python_styleguide.logic.operators import (
10     count_unary_operator,
11     unwrap_unary_node,
12 )
13 from wemake_python_styleguide.types import AnyNodes
14 from wemake_python_styleguide.violations import consistency
15 from wemake_python_styleguide.violations.best_practices import (
16     ListMultiplyViolation,
17 )
18 from wemake_python_styleguide.visitors import base
19 
20 _MeaninglessOperators = Mapping[int, Tuple[Type[ast.operator], ...]]
21 _OperatorLimits = Mapping[Type[ast.unaryop], int]
22 
23 
24 @final
25 class UselessOperatorsVisitor(base.BaseNodeVisitor):
26     """Checks operators used in the code."""
27 
28     _limits: ClassVar[_OperatorLimits] = {
29         ast.UAdd: 0,
30         ast.Invert: 1,
31         ast.Not: 1,
32         ast.USub: 1,
33     }
34 
35     _meaningless_operations: ClassVar[_MeaninglessOperators] = {
36         # ast.Div is not in the list,
37         # since we have a special violation for it.
38         0: (ast.Mult, ast.Add, ast.Sub, ast.Pow),
39         # `1` and `-1` are different, `-1` is allowed.
40         1: (ast.Div, ast.Mult, ast.Pow),
41     }
42 
43     def visit_Num(self, node: ast.Num) -> None:
44         """
45         Checks numbers unnecessary operators inside the code.
46 
47         Raises:
48             UselessOperatorsViolation
49 
50         """
51         self._check_operator_count(node)
52         self.generic_visit(node)
53 
54     def visit_BinOp(self, node: ast.BinOp) -> None:
55         """
56         Visits binary operators.
57 
58         Raises:
59             ZeroDivisionViolation
60 
61         """
62         self._check_zero_division(node.op, node.right)
63         self._check_useless_math_operator(node.op, node.left, node.right)
64         self.generic_visit(node)
65 
66     def visit_AugAssign(self, node: ast.AugAssign) -> None:
67         """
68         Visits augmented assigns.
69 
70         Raises:
71             ZeroDivisionViolation
72 
73         """
74         self._check_zero_division(node.op, node.value)
75         self._check_useless_math_operator(node.op, node.value)
76         self.generic_visit(node)
77 
78     def _check_operator_count(self, node: ast.Num) -> None:
79         for node_type, limit in self._limits.items():
80             if count_unary_operator(node, node_type) > limit:
81                 self.add_violation(
82                     consistency.UselessOperatorsViolation(
83                         node, text=str(node.n),
84                     ),
85                 )
86 
87     def _check_zero_division(self, op: ast.operator, number: ast.AST) -> None:
88         number = unwrap_unary_node(number)
89 
90         is_zero_division = (
91             isinstance(op, ast.Div) and
92             isinstance(number, ast.Num) and
93             number.n == 0
94         )
95         if is_zero_division:
96             self.add_violation(consistency.ZeroDivisionViolation(number))
97 
98     def _check_useless_math_operator(
99         self,
100         op: ast.operator,
101         left: ast.AST,
102         right: Optional[ast.AST] = None,
103     ) -> None:
104         non_negative_numbers = self._get_non_negative_nodes(left, right)
105 
106         for number in non_negative_numbers:
107             forbidden = self._meaningless_operations.get(number.n, None)
108             if forbidden and isinstance(op, forbidden):
109                 self.add_violation(
110                     consistency.MeaninglessNumberOperationViolation(number),
111                 )
112 
113     def _get_non_negative_nodes(
114         self,
115         left: ast.AST,
116         right: Optional[ast.AST] = None,
117     ):
118         non_negative_numbers = []
119         for node in filter(None, (left, right)):
120             real_node = unwrap_unary_node(node)
121             if not isinstance(real_node, ast.Num):
122                 continue
123 
124             if real_node.n not in self._meaningless_operations:
125                 continue
126 
127             if real_node.n == 1 and walk.is_contained(node, ast.USub):
128                 continue
129             non_negative_numbers.append(real_node)
130         return non_negative_numbers
131 
132 
133 @final
134 class WrongMathOperatorVisitor(base.BaseNodeVisitor):
135     """Checks that there are not wrong math operations."""
136 
137     _string_nodes: ClassVar[AnyNodes] = (
138         ast.Str,
139         ast.Bytes,
140         ast.JoinedStr,
141     )
142 
143     _list_nodes: ClassVar[AnyNodes] = (
144         ast.List,
145         ast.ListComp,
146     )
147 
148     def visit_BinOp(self, node: ast.BinOp) -> None:
149         """
150         Visits binary operations.
151 
152         Raises:
153             DoubleMinusOpeationViolation
154 
155         """
156         self._check_negation(node.op, node.right)
157         self._check_list_multiply(node)
158         self._check_string_concat(node.left, node.op, node.right)
159         self.generic_visit(node)
160 
161     def visit_AugAssign(self, node: ast.AugAssign) -> None:
162         """
163         Visits augmented assignes.
164 
165         Raises:
166             DoubleMinusOpeationViolation
167 
168         """
169         self._check_negation(node.op, node.value)
170         self._check_string_concat(node.value, node.op)
171         self.generic_visit(node)
172 
173     def _check_negation(self, op: ast.operator, right: ast.AST) -> None:
174         is_double_minus = (
175             isinstance(op, (ast.Add, ast.Sub)) and
176             isinstance(right, ast.UnaryOp) and
177             isinstance(right.op, ast.USub)
178         )
179         if is_double_minus:
180             self.add_violation(
181                 consistency.OperationSignNegationViolation(right),
182             )
183 
184     def _check_list_multiply(self, node: ast.BinOp) -> None:
185         is_list_multiply = (
186             isinstance(node.op, ast.Mult) and
187             isinstance(node.left, self._list_nodes)
188         )
189         if is_list_multiply:
190             self.add_violation(ListMultiplyViolation(node.left))
191 
192     def _check_string_concat(
193         self,
194         left: ast.AST,
195         op: ast.operator,
196         right: Optional[ast.AST] = None,
197     ) -> None:
198         if not isinstance(op, ast.Add):
199             return
200 
201         left_line = getattr(left, 'lineno', 0)
202         if left_line != getattr(right, 'lineno', left_line):
203             # By default we treat nodes that do not have lineno
204             # as nodes on the same line.
205             return
206 
207         for node in (left, right):
208             if isinstance(node, self._string_nodes):
209                 self.add_violation(
210                     consistency.ExplicitStringConcatViolation(node),
211                 )
212                 return
213
```
--- 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/operators.py b/wemake_python_styleguide/visitors/ast/operators.py
--- a/wemake_python_styleguide/visitors/ast/operators.py
+++ b/wemake_python_styleguide/visitors/ast/operators.py
@@ -101,6 +101,9 @@
         left: ast.AST,
         right: Optional[ast.AST] = None,
     ) -> None:
+        if isinstance(left, ast.Num) and right:
+            if left.n == 1:
+                left = None
         non_negative_numbers = self._get_non_negative_nodes(left, right)
 
         for number in non_negative_numbers:

{"golden_diff": "diff --git a/wemake_python_styleguide/visitors/ast/operators.py b/wemake_python_styleguide/visitors/ast/operators.py\n--- a/wemake_python_styleguide/visitors/ast/operators.py\n+++ b/wemake_python_styleguide/visitors/ast/operators.py\n@@ -101,6 +101,9 @@\n         left: ast.AST,\n         right: Optional[ast.AST] = None,\n     ) -> None:\n+        if isinstance(left, ast.Num) and right:\n+            if left.n == 1:\n+                left = None\n         non_negative_numbers = self._get_non_negative_nodes(left, right)\n \n         for number in non_negative_numbers:\n", "issue": "False positive for `WPS345 Found meaningless number operation`\n# Bug report\r\n\r\n<!--\r\nHi, thanks for submitting a bug. We appreciate that.\r\n\r\nBut, we will need some information about what's wrong to help you.\r\n-->\r\n\r\n## What's wrong\r\n\r\nFalse positive for `1 / some`:\r\n\r\n```\r\n  13:12    WPS345 Found meaningless number operation\r\n  return 1 / number\r\n```\r\n\r\n<!-- Describe what is not working. Please, attach a traceback. -->\r\n\r\n## How is that should be\r\n\r\n`1 / ANY` should be allowed.\r\n\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport ast\nfrom typing import ClassVar, Mapping, Optional, Tuple, Type\n\nfrom typing_extensions import final\n\nfrom wemake_python_styleguide.logic import walk\nfrom wemake_python_styleguide.logic.operators import (\n    count_unary_operator,\n    unwrap_unary_node,\n)\nfrom wemake_python_styleguide.types import AnyNodes\nfrom wemake_python_styleguide.violations import consistency\nfrom wemake_python_styleguide.violations.best_practices import (\n    ListMultiplyViolation,\n)\nfrom wemake_python_styleguide.visitors import base\n\n_MeaninglessOperators = Mapping[int, Tuple[Type[ast.operator], ...]]\n_OperatorLimits = Mapping[Type[ast.unaryop], int]\n\n\n@final\nclass UselessOperatorsVisitor(base.BaseNodeVisitor):\n    \"\"\"Checks operators used in the code.\"\"\"\n\n    _limits: ClassVar[_OperatorLimits] = {\n        ast.UAdd: 0,\n        ast.Invert: 1,\n        ast.Not: 1,\n        ast.USub: 1,\n    }\n\n    _meaningless_operations: ClassVar[_MeaninglessOperators] = {\n        # ast.Div is not in the list,\n        # since we have a special violation for it.\n        0: (ast.Mult, ast.Add, ast.Sub, ast.Pow),\n        # `1` and `-1` are different, `-1` is allowed.\n        1: (ast.Div, ast.Mult, ast.Pow),\n    }\n\n    def visit_Num(self, node: ast.Num) -> None:\n        \"\"\"\n        Checks numbers unnecessary operators inside the code.\n\n        Raises:\n            UselessOperatorsViolation\n\n        \"\"\"\n        self._check_operator_count(node)\n        self.generic_visit(node)\n\n    def visit_BinOp(self, node: ast.BinOp) -> None:\n        \"\"\"\n        Visits binary operators.\n\n        Raises:\n            ZeroDivisionViolation\n\n        \"\"\"\n        self._check_zero_division(node.op, node.right)\n        self._check_useless_math_operator(node.op, node.left, node.right)\n        self.generic_visit(node)\n\n    def visit_AugAssign(self, node: ast.AugAssign) -> None:\n        \"\"\"\n        Visits augmented assigns.\n\n        Raises:\n            ZeroDivisionViolation\n\n        \"\"\"\n        self._check_zero_division(node.op, node.value)\n        self._check_useless_math_operator(node.op, node.value)\n        self.generic_visit(node)\n\n    def _check_operator_count(self, node: ast.Num) -> None:\n        for node_type, limit in self._limits.items():\n            if count_unary_operator(node, node_type) > limit:\n                self.add_violation(\n                    consistency.UselessOperatorsViolation(\n                        node, text=str(node.n),\n                    ),\n                )\n\n    def _check_zero_division(self, op: ast.operator, number: ast.AST) -> None:\n        number = unwrap_unary_node(number)\n\n        is_zero_division = (\n            isinstance(op, ast.Div) and\n            isinstance(number, ast.Num) and\n            number.n == 0\n        )\n        if is_zero_division:\n            self.add_violation(consistency.ZeroDivisionViolation(number))\n\n    def _check_useless_math_operator(\n        self,\n        op: ast.operator,\n        left: ast.AST,\n        right: Optional[ast.AST] = None,\n    ) -> None:\n        non_negative_numbers = self._get_non_negative_nodes(left, right)\n\n        for number in non_negative_numbers:\n            forbidden = self._meaningless_operations.get(number.n, None)\n            if forbidden and isinstance(op, forbidden):\n                self.add_violation(\n                    consistency.MeaninglessNumberOperationViolation(number),\n                )\n\n    def _get_non_negative_nodes(\n        self,\n        left: ast.AST,\n        right: Optional[ast.AST] = None,\n    ):\n        non_negative_numbers = []\n        for node in filter(None, (left, right)):\n            real_node = unwrap_unary_node(node)\n            if not isinstance(real_node, ast.Num):\n                continue\n\n            if real_node.n not in self._meaningless_operations:\n                continue\n\n            if real_node.n == 1 and walk.is_contained(node, ast.USub):\n                continue\n            non_negative_numbers.append(real_node)\n        return non_negative_numbers\n\n\n@final\nclass WrongMathOperatorVisitor(base.BaseNodeVisitor):\n    \"\"\"Checks that there are not wrong math operations.\"\"\"\n\n    _string_nodes: ClassVar[AnyNodes] = (\n        ast.Str,\n        ast.Bytes,\n        ast.JoinedStr,\n    )\n\n    _list_nodes: ClassVar[AnyNodes] = (\n        ast.List,\n        ast.ListComp,\n    )\n\n    def visit_BinOp(self, node: ast.BinOp) -> None:\n        \"\"\"\n        Visits binary operations.\n\n        Raises:\n            DoubleMinusOpeationViolation\n\n        \"\"\"\n        self._check_negation(node.op, node.right)\n        self._check_list_multiply(node)\n        self._check_string_concat(node.left, node.op, node.right)\n        self.generic_visit(node)\n\n    def visit_AugAssign(self, node: ast.AugAssign) -> None:\n        \"\"\"\n        Visits augmented assignes.\n\n        Raises:\n            DoubleMinusOpeationViolation\n\n        \"\"\"\n        self._check_negation(node.op, node.value)\n        self._check_string_concat(node.value, node.op)\n        self.generic_visit(node)\n\n    def _check_negation(self, op: ast.operator, right: ast.AST) -> None:\n        is_double_minus = (\n            isinstance(op, (ast.Add, ast.Sub)) and\n            isinstance(right, ast.UnaryOp) and\n            isinstance(right.op, ast.USub)\n        )\n        if is_double_minus:\n            self.add_violation(\n                consistency.OperationSignNegationViolation(right),\n            )\n\n    def _check_list_multiply(self, node: ast.BinOp) -> None:\n        is_list_multiply = (\n            isinstance(node.op, ast.Mult) and\n            isinstance(node.left, self._list_nodes)\n        )\n        if is_list_multiply:\n            self.add_violation(ListMultiplyViolation(node.left))\n\n    def _check_string_concat(\n        self,\n        left: ast.AST,\n        op: ast.operator,\n        right: Optional[ast.AST] = None,\n    ) -> None:\n        if not isinstance(op, ast.Add):\n            return\n\n        left_line = getattr(left, 'lineno', 0)\n        if left_line != getattr(right, 'lineno', left_line):\n            # By default we treat nodes that do not have lineno\n            # as nodes on the same line.\n            return\n\n        for node in (left, right):\n            if isinstance(node, self._string_nodes):\n                self.add_violation(\n                    consistency.ExplicitStringConcatViolation(node),\n                )\n                return\n", "path": "wemake_python_styleguide/visitors/ast/operators.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport ast\nfrom typing import ClassVar, Mapping, Optional, Tuple, Type\n\nfrom typing_extensions import final\n\nfrom wemake_python_styleguide.logic import walk\nfrom wemake_python_styleguide.logic.operators import (\n    count_unary_operator,\n    unwrap_unary_node,\n)\nfrom wemake_python_styleguide.types import AnyNodes\nfrom wemake_python_styleguide.violations import consistency\nfrom wemake_python_styleguide.violations.best_practices import (\n    ListMultiplyViolation,\n)\nfrom wemake_python_styleguide.visitors import base\n\n_MeaninglessOperators = Mapping[int, Tuple[Type[ast.operator], ...]]\n_OperatorLimits = Mapping[Type[ast.unaryop], int]\n\n\n@final\nclass UselessOperatorsVisitor(base.BaseNodeVisitor):\n    \"\"\"Checks operators used in the code.\"\"\"\n\n    _limits: ClassVar[_OperatorLimits] = {\n        ast.UAdd: 0,\n        ast.Invert: 1,\n        ast.Not: 1,\n        ast.USub: 1,\n    }\n\n    _meaningless_operations: ClassVar[_MeaninglessOperators] = {\n        # ast.Div is not in the list,\n        # since we have a special violation for it.\n        0: (ast.Mult, ast.Add, ast.Sub, ast.Pow),\n        # `1` and `-1` are different, `-1` is allowed.\n        1: (ast.Div, ast.Mult, ast.Pow),\n    }\n\n    def visit_Num(self, node: ast.Num) -> None:\n        \"\"\"\n        Checks numbers unnecessary operators inside the code.\n\n        Raises:\n            UselessOperatorsViolation\n\n        \"\"\"\n        self._check_operator_count(node)\n        self.generic_visit(node)\n\n    def visit_BinOp(self, node: ast.BinOp) -> None:\n        \"\"\"\n        Visits binary operators.\n\n        Raises:\n            ZeroDivisionViolation\n\n        \"\"\"\n        self._check_zero_division(node.op, node.right)\n        self._check_useless_math_operator(node.op, node.left, node.right)\n        self.generic_visit(node)\n\n    def visit_AugAssign(self, node: ast.AugAssign) -> None:\n        \"\"\"\n        Visits augmented assigns.\n\n        Raises:\n            ZeroDivisionViolation\n\n        \"\"\"\n        self._check_zero_division(node.op, node.value)\n        self._check_useless_math_operator(node.op, node.value)\n        self.generic_visit(node)\n\n    def _check_operator_count(self, node: ast.Num) -> None:\n        for node_type, limit in self._limits.items():\n            if count_unary_operator(node, node_type) > limit:\n                self.add_violation(\n                    consistency.UselessOperatorsViolation(\n                        node, text=str(node.n),\n                    ),\n                )\n\n    def _check_zero_division(self, op: ast.operator, number: ast.AST) -> None:\n        number = unwrap_unary_node(number)\n\n        is_zero_division = (\n            isinstance(op, ast.Div) and\n            isinstance(number, ast.Num) and\n            number.n == 0\n        )\n        if is_zero_division:\n            self.add_violation(consistency.ZeroDivisionViolation(number))\n\n    def _check_useless_math_operator(\n        self,\n        op: ast.operator,\n        left: ast.AST,\n        right: Optional[ast.AST] = None,\n    ) -> None:\n        if isinstance(left, ast.Num) and right:\n            if left.n == 1:\n                left = None\n        non_negative_numbers = self._get_non_negative_nodes(left, right)\n\n        for number in non_negative_numbers:\n            forbidden = self._meaningless_operations.get(number.n, None)\n            if forbidden and isinstance(op, forbidden):\n                self.add_violation(\n                    consistency.MeaninglessNumberOperationViolation(number),\n                )\n\n    def _get_non_negative_nodes(\n        self,\n        left: ast.AST,\n        right: Optional[ast.AST] = None,\n    ):\n        non_negative_numbers = []\n        for node in filter(None, (left, right)):\n            real_node = unwrap_unary_node(node)\n            if not isinstance(real_node, ast.Num):\n                continue\n\n            if real_node.n not in self._meaningless_operations:\n                continue\n\n            if real_node.n == 1 and walk.is_contained(node, ast.USub):\n                continue\n            non_negative_numbers.append(real_node)\n        return non_negative_numbers\n\n\n@final\nclass WrongMathOperatorVisitor(base.BaseNodeVisitor):\n    \"\"\"Checks that there are not wrong math operations.\"\"\"\n\n    _string_nodes: ClassVar[AnyNodes] = (\n        ast.Str,\n        ast.Bytes,\n        ast.JoinedStr,\n    )\n\n    _list_nodes: ClassVar[AnyNodes] = (\n        ast.List,\n        ast.ListComp,\n    )\n\n    def visit_BinOp(self, node: ast.BinOp) -> None:\n        \"\"\"\n        Visits binary operations.\n\n        Raises:\n            DoubleMinusOpeationViolation\n\n        \"\"\"\n        self._check_negation(node.op, node.right)\n        self._check_list_multiply(node)\n        self._check_string_concat(node.left, node.op, node.right)\n        self.generic_visit(node)\n\n    def visit_AugAssign(self, node: ast.AugAssign) -> None:\n        \"\"\"\n        Visits augmented assignes.\n\n        Raises:\n            DoubleMinusOpeationViolation\n\n        \"\"\"\n        self._check_negation(node.op, node.value)\n        self._check_string_concat(node.value, node.op)\n        self.generic_visit(node)\n\n    def _check_negation(self, op: ast.operator, right: ast.AST) -> None:\n        is_double_minus = (\n            isinstance(op, (ast.Add, ast.Sub)) and\n            isinstance(right, ast.UnaryOp) and\n            isinstance(right.op, ast.USub)\n        )\n        if is_double_minus:\n            self.add_violation(\n                consistency.OperationSignNegationViolation(right),\n            )\n\n    def _check_list_multiply(self, node: ast.BinOp) -> None:\n        is_list_multiply = (\n            isinstance(node.op, ast.Mult) and\n            isinstance(node.left, self._list_nodes)\n        )\n        if is_list_multiply:\n            self.add_violation(ListMultiplyViolation(node.left))\n\n    def _check_string_concat(\n        self,\n        left: ast.AST,\n        op: ast.operator,\n        right: Optional[ast.AST] = None,\n    ) -> None:\n        if not isinstance(op, ast.Add):\n            return\n\n        left_line = getattr(left, 'lineno', 0)\n        if left_line != getattr(right, 'lineno', left_line):\n            # By default we treat nodes that do not have lineno\n            # as nodes on the same line.\n            return\n\n        for node in (left, right):\n            if isinstance(node, self._string_nodes):\n                self.add_violation(\n                    consistency.ExplicitStringConcatViolation(node),\n                )\n                return\n", "path": "wemake_python_styleguide/visitors/ast/operators.py"}]}