mapFolding 0.9.4__py3-none-any.whl → 0.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mapFolding/__init__.py +41 -7
- mapFolding/basecamp.py +100 -9
- mapFolding/beDRY.py +7 -15
- mapFolding/dataBaskets.py +12 -0
- mapFolding/datatypes.py +4 -4
- mapFolding/oeis.py +2 -7
- mapFolding/someAssemblyRequired/RecipeJob.py +97 -3
- mapFolding/someAssemblyRequired/Z0Z_makeSomeModules.py +143 -42
- mapFolding/someAssemblyRequired/__init__.py +38 -49
- mapFolding/someAssemblyRequired/_astTypes.py +117 -0
- mapFolding/someAssemblyRequired/_theTypes.py +12 -41
- mapFolding/someAssemblyRequired/_toolBe.py +524 -0
- mapFolding/someAssemblyRequired/_toolDOT.py +493 -0
- mapFolding/someAssemblyRequired/_toolGrab.py +653 -0
- mapFolding/someAssemblyRequired/_toolIfThis.py +193 -0
- mapFolding/someAssemblyRequired/_toolMake.py +339 -0
- mapFolding/someAssemblyRequired/_toolThen.py +63 -0
- mapFolding/someAssemblyRequired/_toolboxAST.py +3 -3
- mapFolding/someAssemblyRequired/_toolboxContainers.py +124 -29
- mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +274 -0
- mapFolding/someAssemblyRequired/synthesizeNumbaJob.py +12 -11
- mapFolding/someAssemblyRequired/toolboxNumba.py +4 -28
- mapFolding/someAssemblyRequired/transformationTools.py +46 -155
- mapFolding/syntheticModules/daoOfMapFolding.py +74 -0
- mapFolding/syntheticModules/dataPacking.py +1 -1
- mapFolding/syntheticModules/theorem2Numba.py +2 -8
- mapFolding/syntheticModules/theorem2Trimmed.py +43 -0
- mapFolding/toolFactory/astFactory.py +493 -0
- mapFolding/toolFactory/astFactory_annex.py +63 -0
- mapFolding/toolFactory/astFactory_docstrings.py +63 -0
- {mapfolding-0.9.4.dist-info → mapfolding-0.10.0.dist-info}/METADATA +2 -1
- mapfolding-0.10.0.dist-info/RECORD +66 -0
- {mapfolding-0.9.4.dist-info → mapfolding-0.10.0.dist-info}/WHEEL +1 -1
- tests/test_computations.py +1 -1
- mapFolding/Z0Z_flowControl.py +0 -117
- mapFolding/someAssemblyRequired/_tool_Make.py +0 -134
- mapFolding/someAssemblyRequired/_tool_Then.py +0 -157
- mapFolding/someAssemblyRequired/_toolboxAntecedents.py +0 -387
- mapfolding-0.9.4.dist-info/RECORD +0 -57
- {mapfolding-0.9.4.dist-info → mapfolding-0.10.0.dist-info}/entry_points.txt +0 -0
- {mapfolding-0.9.4.dist-info → mapfolding-0.10.0.dist-info}/licenses/LICENSE +0 -0
- {mapfolding-0.9.4.dist-info → mapfolding-0.10.0.dist-info}/top_level.txt +0 -0
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
AST Node Predicate and Access Utilities for Pattern Matching and Traversal
|
|
3
|
-
|
|
4
|
-
This module provides utilities for accessing and matching AST nodes in a consistent way. It contains three primary
|
|
5
|
-
classes:
|
|
6
|
-
|
|
7
|
-
1. DOT: Provides consistent accessor methods for AST node attributes across different node types, simplifying the access
|
|
8
|
-
to node properties.
|
|
9
|
-
|
|
10
|
-
2. be: Offers type-guard functions that verify AST node types, enabling safe type narrowing for static type checking and
|
|
11
|
-
improving code safety.
|
|
12
|
-
|
|
13
|
-
3. ifThis: Contains predicate functions for matching AST nodes based on various criteria, enabling precise targeting of
|
|
14
|
-
nodes for analysis or transformation.
|
|
15
|
-
|
|
16
|
-
These utilities form the foundation of the pattern-matching component in the AST manipulation framework, working in
|
|
17
|
-
conjunction with the NodeChanger and NodeTourist classes to enable precise and targeted code transformations. Together,
|
|
18
|
-
they implement a declarative approach to AST manipulation that separates node identification (ifThis), type verification
|
|
19
|
-
(be), and data access (DOT).
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
from collections.abc import Callable
|
|
23
|
-
from mapFolding.someAssemblyRequired import (
|
|
24
|
-
ast_Identifier,
|
|
25
|
-
astClassHasDOTbody,
|
|
26
|
-
astClassHasDOTbody_expr,
|
|
27
|
-
astClassHasDOTbodyList_stmt,
|
|
28
|
-
astClassHasDOTnameNotName,
|
|
29
|
-
astClassHasDOTnameNotNameAlways,
|
|
30
|
-
astClassHasDOTnameNotNameOptionally,
|
|
31
|
-
astClassHasDOTtarget_expr,
|
|
32
|
-
astClassHasDOTtarget,
|
|
33
|
-
astClassHasDOTtargetAttributeNameSubscript,
|
|
34
|
-
astClassHasDOTvalue_expr,
|
|
35
|
-
astClassHasDOTvalue_exprNone,
|
|
36
|
-
astClassHasDOTvalue,
|
|
37
|
-
ImaCallToName,
|
|
38
|
-
)
|
|
39
|
-
from typing import Any, overload, TypeGuard
|
|
40
|
-
import ast
|
|
41
|
-
|
|
42
|
-
class DOT:
|
|
43
|
-
"""
|
|
44
|
-
Access attributes and sub-nodes of AST elements via consistent accessor methods.
|
|
45
|
-
|
|
46
|
-
The DOT class provides static methods to access specific attributes of different
|
|
47
|
-
types of AST nodes in a consistent way. This simplifies attribute access across
|
|
48
|
-
various node types and improves code readability by abstracting the underlying
|
|
49
|
-
AST structure details.
|
|
50
|
-
|
|
51
|
-
DOT is designed for safe, read-only access to node properties, unlike the grab
|
|
52
|
-
class which is designed for modifying node attributes.
|
|
53
|
-
"""
|
|
54
|
-
@staticmethod
|
|
55
|
-
@overload
|
|
56
|
-
def annotation(node: ast.AnnAssign) -> ast.expr:...
|
|
57
|
-
@staticmethod
|
|
58
|
-
@overload
|
|
59
|
-
def annotation(node: ast.arg) -> ast.expr | None:...
|
|
60
|
-
@staticmethod
|
|
61
|
-
def annotation(node: ast.AnnAssign | ast.arg) -> ast.expr | None:
|
|
62
|
-
return node.annotation
|
|
63
|
-
|
|
64
|
-
@staticmethod
|
|
65
|
-
@overload
|
|
66
|
-
def arg(node: ast.arg) -> ast_Identifier:...
|
|
67
|
-
@staticmethod
|
|
68
|
-
@overload
|
|
69
|
-
def arg(node: ast.keyword) -> ast_Identifier | None:...
|
|
70
|
-
@staticmethod
|
|
71
|
-
def arg(node: ast.arg | ast.keyword) -> ast_Identifier | None:
|
|
72
|
-
return node.arg
|
|
73
|
-
|
|
74
|
-
@staticmethod
|
|
75
|
-
def attr(node: ast.Attribute) -> ast_Identifier:
|
|
76
|
-
return node.attr
|
|
77
|
-
|
|
78
|
-
@staticmethod
|
|
79
|
-
@overload
|
|
80
|
-
def body(node: astClassHasDOTbodyList_stmt) -> list[ast.stmt]:...
|
|
81
|
-
@staticmethod
|
|
82
|
-
@overload
|
|
83
|
-
def body(node: astClassHasDOTbody_expr) -> ast.expr:...
|
|
84
|
-
@staticmethod
|
|
85
|
-
def body(node: astClassHasDOTbody) -> ast.expr | list[ast.stmt]:
|
|
86
|
-
return node.body
|
|
87
|
-
|
|
88
|
-
@staticmethod
|
|
89
|
-
@overload
|
|
90
|
-
def func(node: ImaCallToName) -> ast.Name:...
|
|
91
|
-
@staticmethod
|
|
92
|
-
@overload
|
|
93
|
-
def func(node: ast.Call) -> ast.expr:...
|
|
94
|
-
@staticmethod
|
|
95
|
-
def func(node: ast.Call | ImaCallToName) -> ast.expr | ast.Name:
|
|
96
|
-
return node.func
|
|
97
|
-
|
|
98
|
-
@staticmethod
|
|
99
|
-
def id(node: ast.Name) -> ast_Identifier:
|
|
100
|
-
return node.id
|
|
101
|
-
|
|
102
|
-
@staticmethod
|
|
103
|
-
@overload
|
|
104
|
-
def name(node: astClassHasDOTnameNotNameAlways) -> ast_Identifier:...
|
|
105
|
-
@staticmethod
|
|
106
|
-
@overload
|
|
107
|
-
def name(node: astClassHasDOTnameNotNameOptionally) -> ast_Identifier | None:...
|
|
108
|
-
@staticmethod
|
|
109
|
-
def name(node: astClassHasDOTnameNotName) -> ast_Identifier | None:
|
|
110
|
-
return node.name
|
|
111
|
-
|
|
112
|
-
@staticmethod
|
|
113
|
-
@overload
|
|
114
|
-
def target(node: ast.NamedExpr) -> ast.Name:...
|
|
115
|
-
@staticmethod
|
|
116
|
-
@overload
|
|
117
|
-
def target(node: astClassHasDOTtarget_expr) -> ast.expr:...
|
|
118
|
-
@staticmethod
|
|
119
|
-
@overload
|
|
120
|
-
def target(node: astClassHasDOTtargetAttributeNameSubscript) -> ast.Attribute | ast.Name | ast.Subscript:...
|
|
121
|
-
@staticmethod
|
|
122
|
-
def target(node: astClassHasDOTtarget) -> ast.Attribute | ast.expr | ast.Name | ast.Subscript:
|
|
123
|
-
return node.target
|
|
124
|
-
|
|
125
|
-
@staticmethod
|
|
126
|
-
@overload
|
|
127
|
-
def value(node: ast.Constant) -> Any:...
|
|
128
|
-
@staticmethod
|
|
129
|
-
@overload
|
|
130
|
-
def value(node: ast.MatchSingleton) -> bool | None:...
|
|
131
|
-
@staticmethod
|
|
132
|
-
@overload
|
|
133
|
-
def value(node: astClassHasDOTvalue_expr) -> ast.expr:...
|
|
134
|
-
@staticmethod
|
|
135
|
-
@overload
|
|
136
|
-
def value(node: astClassHasDOTvalue_exprNone) -> ast.expr | None:...
|
|
137
|
-
@staticmethod
|
|
138
|
-
def value(node: astClassHasDOTvalue) -> Any | ast.expr | bool | None:
|
|
139
|
-
return node.value
|
|
140
|
-
|
|
141
|
-
class be:
|
|
142
|
-
"""
|
|
143
|
-
Provide type-guard functions for safely verifying AST node types during manipulation.
|
|
144
|
-
|
|
145
|
-
The be class contains static methods that perform runtime type verification of AST nodes, returning TypeGuard
|
|
146
|
-
results that enable static type checkers to narrow node types in conditional branches. These type-guards:
|
|
147
|
-
|
|
148
|
-
1. Improve code safety by preventing operations on incompatible node types.
|
|
149
|
-
2. Enable IDE tooling to provide better autocompletion and error detection.
|
|
150
|
-
3. Document expected node types in a way that's enforced by the type system.
|
|
151
|
-
4. Support pattern-matching workflows where node types must be verified before access.
|
|
152
|
-
|
|
153
|
-
When used with conditional statements, these type-guards allow for precise, type-safe manipulation of AST nodes
|
|
154
|
-
while maintaining full static type checking capabilities, even in complex transformation scenarios.
|
|
155
|
-
"""
|
|
156
|
-
@staticmethod
|
|
157
|
-
def AnnAssign(node: ast.AST) -> TypeGuard[ast.AnnAssign]:
|
|
158
|
-
return isinstance(node, ast.AnnAssign)
|
|
159
|
-
|
|
160
|
-
@staticmethod
|
|
161
|
-
def arg(node: ast.AST) -> TypeGuard[ast.arg]:
|
|
162
|
-
return isinstance(node, ast.arg)
|
|
163
|
-
|
|
164
|
-
@staticmethod
|
|
165
|
-
def Assign(node: ast.AST) -> TypeGuard[ast.Assign]:
|
|
166
|
-
return isinstance(node, ast.Assign)
|
|
167
|
-
|
|
168
|
-
@staticmethod
|
|
169
|
-
def Attribute(node: ast.AST) -> TypeGuard[ast.Attribute]:
|
|
170
|
-
return isinstance(node, ast.Attribute)
|
|
171
|
-
|
|
172
|
-
@staticmethod
|
|
173
|
-
def AugAssign(node: ast.AST) -> TypeGuard[ast.AugAssign]:
|
|
174
|
-
return isinstance(node, ast.AugAssign)
|
|
175
|
-
|
|
176
|
-
@staticmethod
|
|
177
|
-
def Call(node: ast.AST) -> TypeGuard[ast.Call]:
|
|
178
|
-
return isinstance(node, ast.Call)
|
|
179
|
-
|
|
180
|
-
@staticmethod
|
|
181
|
-
def ClassDef(node: ast.AST) -> TypeGuard[ast.ClassDef]:
|
|
182
|
-
return isinstance(node, ast.ClassDef)
|
|
183
|
-
|
|
184
|
-
@staticmethod
|
|
185
|
-
def Compare(node: ast.AST) -> TypeGuard[ast.Compare]:
|
|
186
|
-
return isinstance(node, ast.Compare)
|
|
187
|
-
|
|
188
|
-
@staticmethod
|
|
189
|
-
def Constant(node: ast.AST) -> TypeGuard[ast.Constant]:
|
|
190
|
-
return isinstance(node, ast.Constant)
|
|
191
|
-
|
|
192
|
-
@staticmethod
|
|
193
|
-
def FunctionDef(node: ast.AST) -> TypeGuard[ast.FunctionDef]:
|
|
194
|
-
return isinstance(node, ast.FunctionDef)
|
|
195
|
-
|
|
196
|
-
@staticmethod
|
|
197
|
-
def keyword(node: ast.AST) -> TypeGuard[ast.keyword]:
|
|
198
|
-
return isinstance(node, ast.keyword)
|
|
199
|
-
|
|
200
|
-
@staticmethod
|
|
201
|
-
def If(node: ast.AST) -> TypeGuard[ast.If]:
|
|
202
|
-
return isinstance(node, ast.If)
|
|
203
|
-
|
|
204
|
-
@staticmethod
|
|
205
|
-
def Gt(node: ast.AST) -> TypeGuard[ast.Gt]:
|
|
206
|
-
return isinstance(node, ast.Gt)
|
|
207
|
-
|
|
208
|
-
@staticmethod
|
|
209
|
-
def LtE(node: ast.AST) -> TypeGuard[ast.LtE]:
|
|
210
|
-
return isinstance(node, ast.LtE)
|
|
211
|
-
|
|
212
|
-
@staticmethod
|
|
213
|
-
def Name(node: ast.AST) -> TypeGuard[ast.Name]:
|
|
214
|
-
return isinstance(node, ast.Name)
|
|
215
|
-
|
|
216
|
-
@staticmethod
|
|
217
|
-
def Return(node: ast.AST) -> TypeGuard[ast.Return]:
|
|
218
|
-
return isinstance(node, ast.Return)
|
|
219
|
-
|
|
220
|
-
@staticmethod
|
|
221
|
-
def Starred(node: ast.AST) -> TypeGuard[ast.Starred]:
|
|
222
|
-
return isinstance(node, ast.Starred)
|
|
223
|
-
|
|
224
|
-
@staticmethod
|
|
225
|
-
def Subscript(node: ast.AST) -> TypeGuard[ast.Subscript]:
|
|
226
|
-
return isinstance(node, ast.Subscript)
|
|
227
|
-
|
|
228
|
-
@staticmethod
|
|
229
|
-
def Tuple(node: ast.AST) -> TypeGuard[ast.Tuple]:
|
|
230
|
-
return isinstance(node, ast.Tuple)
|
|
231
|
-
|
|
232
|
-
@staticmethod
|
|
233
|
-
def While(node: ast.AST) -> TypeGuard[ast.While]:
|
|
234
|
-
return isinstance(node, ast.While)
|
|
235
|
-
|
|
236
|
-
class ifThis:
|
|
237
|
-
"""
|
|
238
|
-
Provide predicate functions for matching and filtering AST nodes based on various criteria.
|
|
239
|
-
|
|
240
|
-
The ifThis class contains static methods that generate predicate functions used to test
|
|
241
|
-
whether AST nodes match specific criteria. These predicates can be used with NodeChanger
|
|
242
|
-
and NodeTourist to identify and process specific patterns in the AST.
|
|
243
|
-
|
|
244
|
-
The class provides predicates for matching various node types, attributes, identifiers,
|
|
245
|
-
and structural patterns, enabling precise targeting of AST elements for analysis or
|
|
246
|
-
transformation.
|
|
247
|
-
"""
|
|
248
|
-
@staticmethod
|
|
249
|
-
def _Identifier(identifier: ast_Identifier) -> Callable[[ast_Identifier | None], TypeGuard[ast_Identifier] | bool]:
|
|
250
|
-
return lambda node: node == identifier
|
|
251
|
-
@staticmethod
|
|
252
|
-
def _nested_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Attribute | ast.Starred | ast.Subscript] | bool]:
|
|
253
|
-
def workhorse(node: ast.AST) -> TypeGuard[ast.Attribute | ast.Starred | ast.Subscript] | bool:
|
|
254
|
-
return ifThis.isName_Identifier(identifier)(node) or ifThis.isAttribute_Identifier(identifier)(node) or ifThis.isSubscript_Identifier(identifier)(node) or ifThis.isStarred_Identifier(identifier)(node)
|
|
255
|
-
return workhorse
|
|
256
|
-
|
|
257
|
-
@staticmethod
|
|
258
|
-
def is_arg_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.arg] | bool]:
|
|
259
|
-
"""see also `isArgument_Identifier`"""
|
|
260
|
-
return lambda node: be.arg(node) and ifThis._Identifier(identifier)(DOT.arg(node))
|
|
261
|
-
@staticmethod
|
|
262
|
-
def is_keyword_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.keyword] | bool]:
|
|
263
|
-
"""see also `isArgument_Identifier`"""
|
|
264
|
-
return lambda node: be.keyword(node) and ifThis._Identifier(identifier)(DOT.arg(node))
|
|
265
|
-
|
|
266
|
-
@staticmethod
|
|
267
|
-
def isAnnAssign_targetIs(targetPredicate: Callable[[ast.expr], TypeGuard[ast.expr] | bool]) -> Callable[[ast.AST], TypeGuard[ast.AnnAssign] | bool]:
|
|
268
|
-
def workhorse(node: ast.AST) -> TypeGuard[ast.AnnAssign] | bool:
|
|
269
|
-
return be.AnnAssign(node) and targetPredicate(DOT.target(node))
|
|
270
|
-
return workhorse
|
|
271
|
-
|
|
272
|
-
@staticmethod
|
|
273
|
-
def isArgument_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.arg | ast.keyword] | bool]:
|
|
274
|
-
return lambda node: (be.arg(node) or be.keyword(node)) and ifThis._Identifier(identifier)(DOT.arg(node))
|
|
275
|
-
|
|
276
|
-
@staticmethod
|
|
277
|
-
def isAssignAndTargets0Is(targets0Predicate: Callable[[ast.AST], bool]) -> Callable[[ast.AST], TypeGuard[ast.AnnAssign] | bool]:
|
|
278
|
-
"""node is Assign and node.targets[0] matches `targets0Predicate`."""
|
|
279
|
-
return lambda node: be.Assign(node) and targets0Predicate(node.targets[0])
|
|
280
|
-
@staticmethod
|
|
281
|
-
def isAssignAndValueIs(valuePredicate: Callable[[ast.AST], bool]) -> Callable[[ast.AST], TypeGuard[ast.Assign] | bool]:
|
|
282
|
-
"""node is ast.Assign and node.value matches `valuePredicate`. """
|
|
283
|
-
return lambda node: be.Assign(node) and valuePredicate(DOT.value(node))
|
|
284
|
-
|
|
285
|
-
@staticmethod
|
|
286
|
-
def isAttribute_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Attribute] | bool]:
|
|
287
|
-
"""node is `ast.Attribute` and the top-level `ast.Name` is `identifier`"""
|
|
288
|
-
def workhorse(node: ast.AST) -> TypeGuard[ast.Attribute]:
|
|
289
|
-
return be.Attribute(node) and ifThis._nested_Identifier(identifier)(DOT.value(node))
|
|
290
|
-
return workhorse
|
|
291
|
-
@staticmethod
|
|
292
|
-
def isAttributeName(node: ast.AST) -> TypeGuard[ast.Attribute]:
|
|
293
|
-
""" Displayed as Name.attribute."""
|
|
294
|
-
return be.Attribute(node) and be.Name(DOT.value(node))
|
|
295
|
-
@staticmethod
|
|
296
|
-
def isAttributeNamespace_Identifier(namespace: ast_Identifier, identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Attribute] | bool]:
|
|
297
|
-
return lambda node: ifThis.isAttributeName(node) and ifThis.isName_Identifier(namespace)(DOT.value(node)) and ifThis._Identifier(identifier)(DOT.attr(node))
|
|
298
|
-
|
|
299
|
-
@staticmethod
|
|
300
|
-
def isAttributeNamespace_IdentifierGreaterThan0(namespace: ast_Identifier, identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Compare] | bool]:
|
|
301
|
-
return lambda node: (be.Compare(node)
|
|
302
|
-
and ifThis.isAttributeNamespace_Identifier(namespace, identifier)(node.left)
|
|
303
|
-
and be.Gt(node.ops[0])
|
|
304
|
-
and ifThis.isConstant_value(0)(node.comparators[0]))
|
|
305
|
-
|
|
306
|
-
@staticmethod
|
|
307
|
-
def isIfAttributeNamespace_IdentifierGreaterThan0(namespace: ast_Identifier, identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.While] | bool]:
|
|
308
|
-
return lambda node: (be.If(node)
|
|
309
|
-
and ifThis.isAttributeNamespace_IdentifierGreaterThan0(namespace, identifier)(node.test))
|
|
310
|
-
|
|
311
|
-
@staticmethod
|
|
312
|
-
def isWhileAttributeNamespace_IdentifierGreaterThan0(namespace: ast_Identifier, identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.While] | bool]:
|
|
313
|
-
return lambda node: (be.While(node)
|
|
314
|
-
and ifThis.isAttributeNamespace_IdentifierGreaterThan0(namespace, identifier)(node.test))
|
|
315
|
-
|
|
316
|
-
@staticmethod
|
|
317
|
-
def isAttributeNamespace_IdentifierLessThanOrEqual(namespace: ast_Identifier, identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Compare] | bool]:
|
|
318
|
-
return lambda node: (be.Compare(node)
|
|
319
|
-
and ifThis.isAttributeNamespace_Identifier(namespace, identifier)(node.left)
|
|
320
|
-
and be.LtE(node.ops[0]))
|
|
321
|
-
|
|
322
|
-
@staticmethod
|
|
323
|
-
def isAugAssign_targetIs(targetPredicate: Callable[[ast.expr], TypeGuard[ast.expr] | bool]) -> Callable[[ast.AST], TypeGuard[ast.AugAssign] | bool]:
|
|
324
|
-
def workhorse(node: ast.AST) -> TypeGuard[ast.AugAssign] | bool:
|
|
325
|
-
return be.AugAssign(node) and targetPredicate(DOT.target(node))
|
|
326
|
-
return workhorse
|
|
327
|
-
|
|
328
|
-
@staticmethod
|
|
329
|
-
def isCall_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ImaCallToName] | bool]:
|
|
330
|
-
def workhorse(node: ast.AST) -> TypeGuard[ImaCallToName] | bool:
|
|
331
|
-
return ifThis.isCallToName(node) and ifThis._Identifier(identifier)(DOT.id(DOT.func(node)))
|
|
332
|
-
return workhorse
|
|
333
|
-
|
|
334
|
-
@staticmethod
|
|
335
|
-
def isCallAttributeNamespace_Identifier(namespace: ast_Identifier, identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Call] | bool]:
|
|
336
|
-
def workhorse(node: ast.AST) -> TypeGuard[ast.Call] | bool:
|
|
337
|
-
return be.Call(node) and ifThis.isAttributeNamespace_Identifier(namespace, identifier)(DOT.func(node))
|
|
338
|
-
return workhorse
|
|
339
|
-
@staticmethod
|
|
340
|
-
def isCallToName(node: ast.AST) -> TypeGuard[ImaCallToName]:
|
|
341
|
-
return be.Call(node) and be.Name(DOT.func(node))
|
|
342
|
-
|
|
343
|
-
@staticmethod
|
|
344
|
-
def isClassDef_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.ClassDef] | bool]:
|
|
345
|
-
return lambda node: be.ClassDef(node) and ifThis._Identifier(identifier)(DOT.name(node))
|
|
346
|
-
|
|
347
|
-
@staticmethod
|
|
348
|
-
def isConstant_value(value: Any) -> Callable[[ast.AST], TypeGuard[ast.Constant] | bool]:
|
|
349
|
-
return lambda node: be.Constant(node) and DOT.value(node) == value
|
|
350
|
-
|
|
351
|
-
@staticmethod
|
|
352
|
-
def isFunctionDef_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.FunctionDef] | bool]:
|
|
353
|
-
return lambda node: be.FunctionDef(node) and ifThis._Identifier(identifier)(DOT.name(node))
|
|
354
|
-
|
|
355
|
-
@staticmethod
|
|
356
|
-
def isName_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Name] | bool]:
|
|
357
|
-
return lambda node: be.Name(node) and ifThis._Identifier(identifier)(DOT.id(node))
|
|
358
|
-
|
|
359
|
-
@staticmethod
|
|
360
|
-
def isStarred_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Starred] | bool]:
|
|
361
|
-
"""node is `ast.Starred` and the top-level `ast.Name` is `identifier`"""
|
|
362
|
-
def workhorse(node: ast.AST) -> TypeGuard[ast.Starred]:
|
|
363
|
-
return be.Starred(node) and ifThis._nested_Identifier(identifier)(DOT.value(node))
|
|
364
|
-
return workhorse
|
|
365
|
-
@staticmethod
|
|
366
|
-
def isSubscript_Identifier(identifier: ast_Identifier) -> Callable[[ast.AST], TypeGuard[ast.Subscript] | bool]:
|
|
367
|
-
"""node is `ast.Subscript` and the top-level `ast.Name` is `identifier`"""
|
|
368
|
-
def workhorse(node: ast.AST) -> TypeGuard[ast.Subscript]:
|
|
369
|
-
return be.Subscript(node) and ifThis._nested_Identifier(identifier)(DOT.value(node))
|
|
370
|
-
return workhorse
|
|
371
|
-
|
|
372
|
-
@staticmethod
|
|
373
|
-
def matchesMeButNotAnyDescendant(predicate: Callable[[ast.AST], bool]) -> Callable[[ast.AST], bool]:
|
|
374
|
-
return lambda node: predicate(node) and ifThis.matchesNoDescendant(predicate)(node)
|
|
375
|
-
@staticmethod
|
|
376
|
-
def matchesNoDescendant(predicate: Callable[[ast.AST], bool]) -> Callable[[ast.AST], bool]:
|
|
377
|
-
def workhorse(node: ast.AST) -> bool:
|
|
378
|
-
for descendant in ast.walk(node):
|
|
379
|
-
if descendant is not node and predicate(descendant):
|
|
380
|
-
return False
|
|
381
|
-
return True
|
|
382
|
-
return workhorse
|
|
383
|
-
|
|
384
|
-
@staticmethod
|
|
385
|
-
def Z0Z_unparseIs(astAST: ast.AST) -> Callable[[ast.AST], bool]:
|
|
386
|
-
def workhorse(node: ast.AST) -> bool: return ast.unparse(node) == ast.unparse(astAST)
|
|
387
|
-
return workhorse
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
mapFolding/Z0Z_flowControl.py,sha256=jGeImXadt0F_Fy6F5QtYQpLJP_iRo2Wh4fFjpCm9vCo,4141
|
|
2
|
-
mapFolding/__init__.py,sha256=XbCu7IEPzmIuPRy5iUFKbRbhqTRsie3RemnKVUdACCU,4360
|
|
3
|
-
mapFolding/basecamp.py,sha256=zKqG2lfhaUEicpXjResOrU8zIq3_-3KAFW-DLXATlpc,4749
|
|
4
|
-
mapFolding/beDRY.py,sha256=sTqg_xq3_c4Djer8HRg41ERhDulcl1ZgU4_RMksuv6c,15975
|
|
5
|
-
mapFolding/daoOfMapFolding.py,sha256=ncTIiBfTsM8SNVx9qefZ0bBcBtviWLSk4iPv3Z9nGiE,5442
|
|
6
|
-
mapFolding/dataBaskets.py,sha256=CrSEMfAr63l6zFA2v2YGygwSD8YeLb-3ZCKlpbp3Mho,4325
|
|
7
|
-
mapFolding/datatypes.py,sha256=LbDYemnIVLFqMIHPKWutEWId1iPMw6P7XCDm7Uw4it4,912
|
|
8
|
-
mapFolding/oeis.py,sha256=u9xiBrRXVJSFCC8FgLLuvZAsmX852UyjYqREXiulys8,17106
|
|
9
|
-
mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
mapFolding/theDao.py,sha256=kc3rzTX3yts0PxgPCXFbgWvaqsBexsiU5ib2pzpvID0,10019
|
|
11
|
-
mapFolding/theSSOT.py,sha256=rbv8esQeBG6uLWpFZu_ncMA4zIuQG3lj4FZNzC_6JGI,16138
|
|
12
|
-
mapFolding/toolboxFilesystem.py,sha256=kVZoU-NBvfYSvI4R8mEpMXRUZee-1JV0fjtMFWPhk8Y,9818
|
|
13
|
-
mapFolding/reference/__init__.py,sha256=GKcSgYE49NcTISx-JZbELXyq-eRkMeTL5g4DXInWFw0,2206
|
|
14
|
-
mapFolding/reference/flattened.py,sha256=QK1xG9SllqCoi68e86Hyl9d9ATUAAFNpTQI-3zmcp5I,16072
|
|
15
|
-
mapFolding/reference/hunterNumba.py,sha256=iLfyqwGdAh6c5GbapnKsWhAsNsR3O-fyGGHAdohluLw,7258
|
|
16
|
-
mapFolding/reference/irvineJavaPort.py,sha256=UEfIX4QbPLl5jnyfYIyX5YRR3_rYvPUikK8jLehsFko,4076
|
|
17
|
-
mapFolding/reference/jaxCount.py,sha256=TuDNKOnyhQfuixKmIxO9Algv7dvy7KMGhgsV3h96FGE,14853
|
|
18
|
-
mapFolding/reference/lunnonNumpy.py,sha256=mMgrgbrBpe4nmo72ThEI-MGH0OwEHmfMPczSXHp2qKo,4357
|
|
19
|
-
mapFolding/reference/lunnonWhile.py,sha256=ZL8GAQtPs5nJZSgoDl5USrLSS_zs03y98y1Z9E4jOmQ,3799
|
|
20
|
-
mapFolding/reference/rotatedEntryPoint.py,sha256=5ughpKUT2JQhoAKgoDUdYNjgWQYPGV8v-7dWEAdDmfE,10274
|
|
21
|
-
mapFolding/reference/total_countPlus1vsPlusN.py,sha256=yJZAVLVdoXqHag2_N6_6CT-Q6HXBgRro-eny93-Rlpw,9307
|
|
22
|
-
mapFolding/reference/jobsCompleted/__init__.py,sha256=TU93ZGUW1xEkT6d9mQFn_rp5DvRy0ZslEB2Q6MF5ZDc,2596
|
|
23
|
-
mapFolding/reference/jobsCompleted/[2x19]/p2x19.py,sha256=_tvYtfzMWVo2VtUbIAieoscb4N8FFflgTdW4-ljBUuA,19626
|
|
24
|
-
mapFolding/reference/jobsCompleted/p2x19/p2x19.py,sha256=eZEw4Me4ocTt6VXoK2-Sbd5SowZtxRIbN9dZmc7OCVg,6395
|
|
25
|
-
mapFolding/someAssemblyRequired/RecipeJob.py,sha256=JL5Xkmp8ritVMhL1pGhX7eEw5fde3FVD8-9-vZOZwWI,5399
|
|
26
|
-
mapFolding/someAssemblyRequired/Z0Z_makeSomeModules.py,sha256=UCJDQyT6VTauncCd-bNeFfM0HWtNVPJPXLIyK6fzQG8,10697
|
|
27
|
-
mapFolding/someAssemblyRequired/__init__.py,sha256=n3aOCM41eDQnisJCKsVfbDWK-F-jO9lp7wv_Lhn7FHY,4546
|
|
28
|
-
mapFolding/someAssemblyRequired/_theTypes.py,sha256=bCc9HT7v-HT9cMNFewD9HQh0tRDvRyItEHPOluES0tY,4930
|
|
29
|
-
mapFolding/someAssemblyRequired/_tool_Make.py,sha256=Du_MElrYGK8Vk72rGg3xx9aMpBCm0q1DpPcXQ0CeEUg,7651
|
|
30
|
-
mapFolding/someAssemblyRequired/_tool_Then.py,sha256=-aOVg_eZDQn2ZwamYNOMHFQ6QOl5rBobnIzdCJ2gYMY,6181
|
|
31
|
-
mapFolding/someAssemblyRequired/_toolboxAST.py,sha256=Wm0XUqqxKbwu1kIQ1F6iXEP2z25qmr1JsZ2CeWMBtLg,2376
|
|
32
|
-
mapFolding/someAssemblyRequired/_toolboxAntecedents.py,sha256=I6fI96dVPxIn601F-hF-WsSbbmj-MoTG5M6uTpFA2fI,15863
|
|
33
|
-
mapFolding/someAssemblyRequired/_toolboxContainers.py,sha256=jRUIAYi05OPnqRsPopvvxaXjH9kxaymTsn_ozf2hwA8,24207
|
|
34
|
-
mapFolding/someAssemblyRequired/_toolboxPython.py,sha256=1K7IzqzmHNTaPA6qTo73GZYHCIQRYI2Rn8aYJ3VelqY,7873
|
|
35
|
-
mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=9RPU6vK_eUg64GtVFI_nZnvUryXw8gfHJs9NyDYHIvg,2745
|
|
36
|
-
mapFolding/someAssemblyRequired/synthesizeNumbaJob.py,sha256=iqnhda-Fx4z6LOL9qCGwrEnnt2oiAGSYVE47Pav1P80,15570
|
|
37
|
-
mapFolding/someAssemblyRequired/toolboxNumba.py,sha256=f2spS6SSobGdDNlpS2ELO7ejurqbMVITS2QZLIXDivk,10759
|
|
38
|
-
mapFolding/someAssemblyRequired/transformationTools.py,sha256=cQTYg_aR0X7Y7nghr3HDxqA-j-84_NRbLP4CO9vBqDo,35363
|
|
39
|
-
mapFolding/syntheticModules/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
|
|
40
|
-
mapFolding/syntheticModules/dataPacking.py,sha256=FmB-6Q0RFZ4c2brVUX0bHHZetowWBmBG3dQCOwjVYv8,2316
|
|
41
|
-
mapFolding/syntheticModules/initializeCount.py,sha256=nWSlJMMfIM3DvZxMn6ISQusUJqRYAjKQyLF5hwLEdBQ,3119
|
|
42
|
-
mapFolding/syntheticModules/numbaCount.py,sha256=zM-bp07c9tEDdvidwzZ_bJTd0JC0VUkYEEiHG--P1tQ,15525
|
|
43
|
-
mapFolding/syntheticModules/theorem2.py,sha256=9jrbZNNX4BWYZW1S0JjvRY2k7RU7I1RNUMV7JdCt1ZY,3017
|
|
44
|
-
mapFolding/syntheticModules/theorem2Numba.py,sha256=UChbeMxCGOUr8i5018Ql9KY-pbMAmcdMdqnkQklH7_k,3711
|
|
45
|
-
mapfolding-0.9.4.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
46
|
-
tests/__init__.py,sha256=5VhHf0JJ2_DSh58zJ0rR5UkpoCon-0IkdljspTCzZ04,1950
|
|
47
|
-
tests/conftest.py,sha256=x8zMZQyTss3sn0GwHm_TSRwD9_LVlR8l_qF8r43Vxl4,14178
|
|
48
|
-
tests/test_computations.py,sha256=oUl1M_bBBfHQQ4HIMeTcqEuPCXKqPSCC3havKDlr8ww,6505
|
|
49
|
-
tests/test_filesystem.py,sha256=T2DkjBoI3lW6tCxd5BilPmUFrVukNKLjOOZVZxLM560,3004
|
|
50
|
-
tests/test_oeis.py,sha256=uxvwmgbnylSDdsVJfuAT0LuYLbIVFwSgdLxHm-xUGBM,5043
|
|
51
|
-
tests/test_other.py,sha256=UMlK4JPInalpOZuPvTnUrgXWCJOxAw-OsPs6CxMR254,3753
|
|
52
|
-
tests/test_tasks.py,sha256=tOQc4uomKXGwWnENfbcThaVa1XofwXNCkGZbg4yS6VI,2833
|
|
53
|
-
mapfolding-0.9.4.dist-info/METADATA,sha256=b774T-bTm3mOoOrVyNzkNXudrEGvfM2tDUKSbx8Nfck,7502
|
|
54
|
-
mapfolding-0.9.4.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
|
55
|
-
mapfolding-0.9.4.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
|
|
56
|
-
mapfolding-0.9.4.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
|
|
57
|
-
mapfolding-0.9.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|