]> git.madduck.net Git - etc/vim.git/blob - tests/data/simple_cases/power_op_spacing.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Doc: Developer reference update (#3755)
[etc/vim.git] / tests / data / simple_cases / power_op_spacing.py
1 def function(**kwargs):
2     t = a**2 + b**3
3     return t ** 2
4
5
6 def function_replace_spaces(**kwargs):
7     t = a **2 + b** 3 + c ** 4
8
9
10 def function_dont_replace_spaces():
11     {**a, **b, **c}
12
13
14 a = 5**~4
15 b = 5 ** f()
16 c = -(5**2)
17 d = 5 ** f["hi"]
18 e = lazy(lambda **kwargs: 5)
19 f = f() ** 5
20 g = a.b**c.d
21 h = 5 ** funcs.f()
22 i = funcs.f() ** 5
23 j = super().name ** 5
24 k = [(2**idx, value) for idx, value in pairs]
25 l = mod.weights_[0] == pytest.approx(0.95**100, abs=0.001)
26 m = [([2**63], [1, 2**63])]
27 n = count <= 10**5
28 o = settings(max_examples=10**6)
29 p = {(k, k**2): v**2 for k, v in pairs}
30 q = [10**i for i in range(6)]
31 r = x**y
32
33 a = 5.0**~4.0
34 b = 5.0 ** f()
35 c = -(5.0**2.0)
36 d = 5.0 ** f["hi"]
37 e = lazy(lambda **kwargs: 5)
38 f = f() ** 5.0
39 g = a.b**c.d
40 h = 5.0 ** funcs.f()
41 i = funcs.f() ** 5.0
42 j = super().name ** 5.0
43 k = [(2.0**idx, value) for idx, value in pairs]
44 l = mod.weights_[0] == pytest.approx(0.95**100, abs=0.001)
45 m = [([2.0**63.0], [1.0, 2**63.0])]
46 n = count <= 10**5.0
47 o = settings(max_examples=10**6.0)
48 p = {(k, k**2): v**2.0 for k, v in pairs}
49 q = [10.5**i for i in range(6)]
50
51
52 # WE SHOULD DEFINITELY NOT EAT THESE COMMENTS (https://github.com/psf/black/issues/2873)
53 if hasattr(view, "sum_of_weights"):
54     return np.divide(  # type: ignore[no-any-return]
55         view.variance,  # type: ignore[union-attr]
56         view.sum_of_weights,  # type: ignore[union-attr]
57         out=np.full(view.sum_of_weights.shape, np.nan),  # type: ignore[union-attr]
58         where=view.sum_of_weights**2 > view.sum_of_weights_squared,  # type: ignore[union-attr]
59     )
60
61 return np.divide(
62     where=view.sum_of_weights_of_weight_long**2 > view.sum_of_weights_squared,  # type: ignore
63 )
64
65
66 # output
67
68
69 def function(**kwargs):
70     t = a**2 + b**3
71     return t**2
72
73
74 def function_replace_spaces(**kwargs):
75     t = a**2 + b**3 + c**4
76
77
78 def function_dont_replace_spaces():
79     {**a, **b, **c}
80
81
82 a = 5**~4
83 b = 5 ** f()
84 c = -(5**2)
85 d = 5 ** f["hi"]
86 e = lazy(lambda **kwargs: 5)
87 f = f() ** 5
88 g = a.b**c.d
89 h = 5 ** funcs.f()
90 i = funcs.f() ** 5
91 j = super().name ** 5
92 k = [(2**idx, value) for idx, value in pairs]
93 l = mod.weights_[0] == pytest.approx(0.95**100, abs=0.001)
94 m = [([2**63], [1, 2**63])]
95 n = count <= 10**5
96 o = settings(max_examples=10**6)
97 p = {(k, k**2): v**2 for k, v in pairs}
98 q = [10**i for i in range(6)]
99 r = x**y
100
101 a = 5.0**~4.0
102 b = 5.0 ** f()
103 c = -(5.0**2.0)
104 d = 5.0 ** f["hi"]
105 e = lazy(lambda **kwargs: 5)
106 f = f() ** 5.0
107 g = a.b**c.d
108 h = 5.0 ** funcs.f()
109 i = funcs.f() ** 5.0
110 j = super().name ** 5.0
111 k = [(2.0**idx, value) for idx, value in pairs]
112 l = mod.weights_[0] == pytest.approx(0.95**100, abs=0.001)
113 m = [([2.0**63.0], [1.0, 2**63.0])]
114 n = count <= 10**5.0
115 o = settings(max_examples=10**6.0)
116 p = {(k, k**2): v**2.0 for k, v in pairs}
117 q = [10.5**i for i in range(6)]
118
119
120 # WE SHOULD DEFINITELY NOT EAT THESE COMMENTS (https://github.com/psf/black/issues/2873)
121 if hasattr(view, "sum_of_weights"):
122     return np.divide(  # type: ignore[no-any-return]
123         view.variance,  # type: ignore[union-attr]
124         view.sum_of_weights,  # type: ignore[union-attr]
125         out=np.full(view.sum_of_weights.shape, np.nan),  # type: ignore[union-attr]
126         where=view.sum_of_weights**2 > view.sum_of_weights_squared,  # type: ignore[union-attr]
127     )
128
129 return np.divide(
130     where=view.sum_of_weights_of_weight_long**2 > view.sum_of_weights_squared,  # type: ignore
131 )