astToolkit 0.1.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.
astToolkit/__init__.py ADDED
@@ -0,0 +1,52 @@
1
+ from astToolkit._typesSpecial import (
2
+ astDOTParamSpec as astDOTParamSpec,
3
+ astDOTTryStar as astDOTTryStar,
4
+ astDOTtype_param as astDOTtype_param,
5
+ astDOTTypeAlias as astDOTTypeAlias,
6
+ astDOTTypeVar as astDOTTypeVar,
7
+ astDOTTypeVarTuple as astDOTTypeVarTuple,
8
+ NotRequired as NotRequired,
9
+ TypedDict as TypedDict,
10
+ )
11
+
12
+ from astToolkit.theSSOT import FREAKOUT as FREAKOUT, The as The
13
+
14
+ from astToolkit._types import (
15
+ ast_expr_Slice as ast_expr_Slice,
16
+ ast_Identifier as ast_Identifier,
17
+ ImaCallToName as ImaCallToName,
18
+ NodeORattribute as NodeORattribute,
19
+ str_nameDOTname as str_nameDOTname,
20
+ 个 as 个,
21
+ )
22
+
23
+ from astToolkit._astTypes import * # noqa: F403
24
+
25
+ from astToolkit._toolboxPython import (
26
+ importLogicalPath2Callable as importLogicalPath2Callable,
27
+ importPathFilename2Callable as importPathFilename2Callable,
28
+ NodeChanger as NodeChanger,
29
+ NodeTourist as NodeTourist,
30
+ parseLogicalPath2astModule as parseLogicalPath2astModule,
31
+ parsePathFilename2astModule as parsePathFilename2astModule,
32
+ )
33
+
34
+ from astToolkit._toolBe import Be as Be
35
+ from astToolkit._toolDOT import DOT as DOT
36
+ from astToolkit._toolGrab import Grab as Grab
37
+ from astToolkit._toolMake import Make as Make
38
+
39
+ from astToolkit._toolIfThis import IfThis as IfThis
40
+ from astToolkit._toolThen import Then as Then
41
+
42
+ from astToolkit._toolboxContainers import (
43
+ IngredientsFunction as IngredientsFunction,
44
+ IngredientsModule as IngredientsModule,
45
+ LedgerOfImports as LedgerOfImports,
46
+ )
47
+
48
+ from astToolkit._toolboxAST import (
49
+ astModuleToIngredientsFunction as astModuleToIngredientsFunction,
50
+ extractClassDef as extractClassDef,
51
+ extractFunctionDef as extractFunctionDef,
52
+ )
@@ -0,0 +1,117 @@
1
+ """This file is generated automatically, so changes to this file will be lost."""
2
+ from astToolkit import astDOTParamSpec, astDOTTryStar, astDOTTypeAlias, astDOTTypeVar, astDOTTypeVarTuple, astDOTtype_param
3
+ from typing import Any, TypeAlias as typing_TypeAlias
4
+ import ast
5
+ intORstr: typing_TypeAlias = Any
6
+ intORstrORtype_params: typing_TypeAlias = Any
7
+ intORtype_params: typing_TypeAlias = Any
8
+ hasDOTannotation_expr: typing_TypeAlias = ast.AnnAssign
9
+ hasDOTannotation_exprOrNone: typing_TypeAlias = ast.arg
10
+ hasDOTannotation: typing_TypeAlias = hasDOTannotation_expr | hasDOTannotation_exprOrNone
11
+ hasDOTarg_Identifier: typing_TypeAlias = ast.arg
12
+ hasDOTarg_IdentifierOrNone: typing_TypeAlias = ast.keyword
13
+ hasDOTarg: typing_TypeAlias = hasDOTarg_Identifier | hasDOTarg_IdentifierOrNone
14
+ hasDOTargs_arguments: typing_TypeAlias = ast.FunctionDef | ast.AsyncFunctionDef | ast.Lambda
15
+ hasDOTargs_list_expr: typing_TypeAlias = ast.Call
16
+ hasDOTargs_list_arg: typing_TypeAlias = ast.arguments
17
+ hasDOTargs: typing_TypeAlias = hasDOTargs_arguments | hasDOTargs_list_expr | hasDOTargs_list_arg
18
+ hasDOTargtypes: typing_TypeAlias = ast.FunctionType
19
+ hasDOTasname: typing_TypeAlias = ast.alias
20
+ hasDOTattr: typing_TypeAlias = ast.Attribute
21
+ hasDOTbases: typing_TypeAlias = ast.ClassDef
22
+ hasDOTbody_list_stmt: typing_TypeAlias = ast.Module | ast.Interactive | ast.FunctionDef | ast.AsyncFunctionDef | ast.ClassDef | ast.For | ast.AsyncFor | ast.While | ast.If | ast.With | ast.AsyncWith | ast.Try | ast.ExceptHandler | astDOTTryStar | ast.match_case
23
+ hasDOTbody_expr: typing_TypeAlias = ast.Expression | ast.Lambda | ast.IfExp
24
+ hasDOTbody: typing_TypeAlias = hasDOTbody_list_stmt | hasDOTbody_expr
25
+ hasDOTbound: typing_TypeAlias = astDOTTypeVar
26
+ hasDOTcases: typing_TypeAlias = ast.Match
27
+ hasDOTcause: typing_TypeAlias = ast.Raise
28
+ hasDOTcls: typing_TypeAlias = ast.MatchClass
29
+ hasDOTcomparators: typing_TypeAlias = ast.Compare
30
+ hasDOTcontext_expr: typing_TypeAlias = ast.withitem
31
+ hasDOTconversion: typing_TypeAlias = ast.FormattedValue
32
+ hasDOTctx: typing_TypeAlias = ast.Attribute | ast.Subscript | ast.Starred | ast.Name | ast.List | ast.Tuple
33
+ hasDOTdecorator_list: typing_TypeAlias = ast.FunctionDef | ast.AsyncFunctionDef | ast.ClassDef
34
+ hasDOTdefault_value: typing_TypeAlias = astDOTTypeVar | astDOTParamSpec | astDOTTypeVarTuple
35
+ hasDOTdefaults: typing_TypeAlias = ast.arguments
36
+ hasDOTelt: typing_TypeAlias = ast.ListComp | ast.SetComp | ast.GeneratorExp
37
+ hasDOTelts: typing_TypeAlias = ast.Set | ast.List | ast.Tuple
38
+ hasDOTexc: typing_TypeAlias = ast.Raise
39
+ hasDOTfinalbody: typing_TypeAlias = ast.Try | astDOTTryStar
40
+ hasDOTformat_spec: typing_TypeAlias = ast.FormattedValue
41
+ hasDOTfunc: typing_TypeAlias = ast.Call
42
+ hasDOTgenerators: typing_TypeAlias = ast.ListComp | ast.SetComp | ast.DictComp | ast.GeneratorExp
43
+ hasDOTguard: typing_TypeAlias = ast.match_case
44
+ hasDOThandlers: typing_TypeAlias = ast.Try | astDOTTryStar
45
+ hasDOTid: typing_TypeAlias = ast.Name
46
+ hasDOTifs: typing_TypeAlias = ast.comprehension
47
+ hasDOTis_async: typing_TypeAlias = ast.comprehension
48
+ hasDOTitems: typing_TypeAlias = ast.With | ast.AsyncWith
49
+ hasDOTiter: typing_TypeAlias = ast.For | ast.AsyncFor | ast.comprehension
50
+ hasDOTkey: typing_TypeAlias = ast.DictComp
51
+ hasDOTkeys_list_exprOrNone: typing_TypeAlias = ast.Dict
52
+ hasDOTkeys_list_expr: typing_TypeAlias = ast.MatchMapping
53
+ hasDOTkeys: typing_TypeAlias = hasDOTkeys_list_exprOrNone | hasDOTkeys_list_expr
54
+ hasDOTkeywords: typing_TypeAlias = ast.ClassDef | ast.Call
55
+ hasDOTkind: typing_TypeAlias = ast.Constant
56
+ hasDOTkw_defaults: typing_TypeAlias = ast.arguments
57
+ hasDOTkwarg: typing_TypeAlias = ast.arguments
58
+ hasDOTkwd_attrs: typing_TypeAlias = ast.MatchClass
59
+ hasDOTkwd_patterns: typing_TypeAlias = ast.MatchClass
60
+ hasDOTkwonlyargs: typing_TypeAlias = ast.arguments
61
+ hasDOTleft: typing_TypeAlias = ast.BinOp | ast.Compare
62
+ hasDOTlevel: typing_TypeAlias = ast.ImportFrom
63
+ hasDOTlineno: typing_TypeAlias = ast.TypeIgnore
64
+ hasDOTlower: typing_TypeAlias = ast.Slice
65
+ hasDOTmodule: typing_TypeAlias = ast.ImportFrom
66
+ hasDOTmsg: typing_TypeAlias = ast.Assert
67
+ hasDOTname_Identifier: typing_TypeAlias = ast.FunctionDef | ast.AsyncFunctionDef | ast.ClassDef | astDOTTypeVar | astDOTParamSpec | astDOTTypeVarTuple
68
+ hasDOTname_IdentifierOrNone: typing_TypeAlias = ast.ExceptHandler | ast.MatchStar | ast.MatchAs
69
+ hasDOTname_str: typing_TypeAlias = ast.alias
70
+ hasDOTname_Name: typing_TypeAlias = astDOTTypeAlias
71
+ hasDOTname: typing_TypeAlias = hasDOTname_Identifier | hasDOTname_IdentifierOrNone | hasDOTname_str | hasDOTname_Name
72
+ hasDOTnames_list_alias: typing_TypeAlias = ast.Import | ast.ImportFrom
73
+ hasDOTnames_list_Identifier: typing_TypeAlias = ast.Global | ast.Nonlocal
74
+ hasDOTnames: typing_TypeAlias = hasDOTnames_list_alias | hasDOTnames_list_Identifier
75
+ hasDOTop_operator: typing_TypeAlias = ast.AugAssign | ast.BinOp
76
+ hasDOTop_boolop: typing_TypeAlias = ast.BoolOp
77
+ hasDOTop_unaryop: typing_TypeAlias = ast.UnaryOp
78
+ hasDOTop: typing_TypeAlias = hasDOTop_operator | hasDOTop_boolop | hasDOTop_unaryop
79
+ hasDOToperand: typing_TypeAlias = ast.UnaryOp
80
+ hasDOTops: typing_TypeAlias = ast.Compare
81
+ hasDOToptional_vars: typing_TypeAlias = ast.withitem
82
+ hasDOTorelse_list_stmt: typing_TypeAlias = ast.For | ast.AsyncFor | ast.While | ast.If | ast.Try | astDOTTryStar
83
+ hasDOTorelse_expr: typing_TypeAlias = ast.IfExp
84
+ hasDOTorelse: typing_TypeAlias = hasDOTorelse_list_stmt | hasDOTorelse_expr
85
+ hasDOTpattern_Pattern: typing_TypeAlias = ast.match_case
86
+ hasDOTpattern_patternOrNone: typing_TypeAlias = ast.MatchAs
87
+ hasDOTpattern: typing_TypeAlias = hasDOTpattern_Pattern | hasDOTpattern_patternOrNone
88
+ hasDOTpatterns: typing_TypeAlias = ast.MatchSequence | ast.MatchMapping | ast.MatchClass | ast.MatchOr
89
+ hasDOTposonlyargs: typing_TypeAlias = ast.arguments
90
+ hasDOTrest: typing_TypeAlias = ast.MatchMapping
91
+ hasDOTreturns_expr: typing_TypeAlias = ast.FunctionType
92
+ hasDOTreturns_exprOrNone: typing_TypeAlias = ast.FunctionDef | ast.AsyncFunctionDef
93
+ hasDOTreturns: typing_TypeAlias = hasDOTreturns_expr | hasDOTreturns_exprOrNone
94
+ hasDOTright: typing_TypeAlias = ast.BinOp
95
+ hasDOTsimple: typing_TypeAlias = ast.AnnAssign
96
+ hasDOTslice: typing_TypeAlias = ast.Subscript
97
+ hasDOTstep: typing_TypeAlias = ast.Slice
98
+ hasDOTsubject: typing_TypeAlias = ast.Match
99
+ hasDOTtag: typing_TypeAlias = ast.TypeIgnore
100
+ hasDOTtarget_NameOrAttributeOrSubscript: typing_TypeAlias = ast.AugAssign | ast.AnnAssign
101
+ hasDOTtarget_expr: typing_TypeAlias = ast.For | ast.AsyncFor | ast.comprehension
102
+ hasDOTtarget_Name: typing_TypeAlias = ast.NamedExpr
103
+ hasDOTtarget: typing_TypeAlias = hasDOTtarget_NameOrAttributeOrSubscript | hasDOTtarget_expr | hasDOTtarget_Name
104
+ hasDOTtargets: typing_TypeAlias = ast.Delete | ast.Assign
105
+ hasDOTtest: typing_TypeAlias = ast.While | ast.If | ast.Assert | ast.IfExp
106
+ hasDOTtype: typing_TypeAlias = ast.ExceptHandler
107
+ hasDOTtype_comment: typing_TypeAlias = ast.FunctionDef | ast.AsyncFunctionDef | ast.Assign | ast.For | ast.AsyncFor | ast.With | ast.AsyncWith | ast.arg
108
+ hasDOTtype_ignores: typing_TypeAlias = ast.Module
109
+ hasDOTtype_params: typing_TypeAlias = ast.FunctionDef | ast.AsyncFunctionDef | ast.ClassDef | astDOTTypeAlias
110
+ hasDOTupper: typing_TypeAlias = ast.Slice
111
+ hasDOTvalue_exprOrNone: typing_TypeAlias = ast.Return | ast.AnnAssign | ast.Yield
112
+ hasDOTvalue_expr: typing_TypeAlias = ast.Assign | ast.AugAssign | ast.Expr | ast.NamedExpr | ast.DictComp | ast.Await | ast.YieldFrom | ast.FormattedValue | ast.Attribute | ast.Subscript | ast.Starred | ast.keyword | astDOTTypeAlias | ast.MatchValue
113
+ hasDOTvalue_Any: typing_TypeAlias = ast.Constant
114
+ hasDOTvalue_LiteralTrueFalseOrNone: typing_TypeAlias = ast.MatchSingleton
115
+ hasDOTvalue: typing_TypeAlias = hasDOTvalue_exprOrNone | hasDOTvalue_expr | hasDOTvalue_Any | hasDOTvalue_LiteralTrueFalseOrNone
116
+ hasDOTvalues: typing_TypeAlias = ast.BoolOp | ast.Dict | ast.JoinedStr
117
+ hasDOTvararg: typing_TypeAlias = ast.arguments
astToolkit/_toolBe.py ADDED
@@ -0,0 +1,524 @@
1
+ """This file is generated automatically, so changes to this file will be lost."""
2
+ from astToolkit import astDOTParamSpec, astDOTTryStar, astDOTTypeAlias, astDOTTypeVar, astDOTTypeVarTuple, astDOTtype_param
3
+ from typing import TypeGuard
4
+ import ast
5
+
6
+ class Be:
7
+ """
8
+ Provide type-guard functions for safely verifying AST node types during manipulation.
9
+
10
+ The be class contains static methods that perform runtime type verification of AST nodes, returning TypeGuard
11
+ results that enable static type checkers to narrow node types in conditional branches. These type-guards:
12
+
13
+ 1. Improve code safety by preventing operations on incompatible node types.
14
+ 2. Enable IDE tooling to provide better autocompletion and error detection.
15
+ 3. Document expected node types in a way that is enforced by the type system.
16
+ 4. Support pattern-matching workflows where node types must be verified before access.
17
+
18
+ When used with conditional statements, these type-guards allow for precise, type-safe manipulation of AST nodes
19
+ while maintaining full static type checking capabilities, even in complex transformation scenarios.
20
+ """
21
+
22
+ @staticmethod
23
+ def Add(node: ast.AST) -> TypeGuard[ast.Add]:
24
+ return isinstance(node, ast.Add)
25
+
26
+ @staticmethod
27
+ def alias(node: ast.AST) -> TypeGuard[ast.alias]:
28
+ return isinstance(node, ast.alias)
29
+
30
+ @staticmethod
31
+ def And(node: ast.AST) -> TypeGuard[ast.And]:
32
+ return isinstance(node, ast.And)
33
+
34
+ @staticmethod
35
+ def AnnAssign(node: ast.AST) -> TypeGuard[ast.AnnAssign]:
36
+ return isinstance(node, ast.AnnAssign)
37
+
38
+ @staticmethod
39
+ def arg(node: ast.AST) -> TypeGuard[ast.arg]:
40
+ return isinstance(node, ast.arg)
41
+
42
+ @staticmethod
43
+ def arguments(node: ast.AST) -> TypeGuard[ast.arguments]:
44
+ return isinstance(node, ast.arguments)
45
+
46
+ @staticmethod
47
+ def Assert(node: ast.AST) -> TypeGuard[ast.Assert]:
48
+ return isinstance(node, ast.Assert)
49
+
50
+ @staticmethod
51
+ def Assign(node: ast.AST) -> TypeGuard[ast.Assign]:
52
+ return isinstance(node, ast.Assign)
53
+
54
+ @staticmethod
55
+ def AST(node: ast.AST) -> TypeGuard[ast.AST]:
56
+ return isinstance(node, ast.AST)
57
+
58
+ @staticmethod
59
+ def AsyncFor(node: ast.AST) -> TypeGuard[ast.AsyncFor]:
60
+ return isinstance(node, ast.AsyncFor)
61
+
62
+ @staticmethod
63
+ def AsyncFunctionDef(node: ast.AST) -> TypeGuard[ast.AsyncFunctionDef]:
64
+ return isinstance(node, ast.AsyncFunctionDef)
65
+
66
+ @staticmethod
67
+ def AsyncWith(node: ast.AST) -> TypeGuard[ast.AsyncWith]:
68
+ return isinstance(node, ast.AsyncWith)
69
+
70
+ @staticmethod
71
+ def Attribute(node: ast.AST) -> TypeGuard[ast.Attribute]:
72
+ return isinstance(node, ast.Attribute)
73
+
74
+ @staticmethod
75
+ def AugAssign(node: ast.AST) -> TypeGuard[ast.AugAssign]:
76
+ return isinstance(node, ast.AugAssign)
77
+
78
+ @staticmethod
79
+ def Await(node: ast.AST) -> TypeGuard[ast.Await]:
80
+ return isinstance(node, ast.Await)
81
+
82
+ @staticmethod
83
+ def BinOp(node: ast.AST) -> TypeGuard[ast.BinOp]:
84
+ return isinstance(node, ast.BinOp)
85
+
86
+ @staticmethod
87
+ def BitAnd(node: ast.AST) -> TypeGuard[ast.BitAnd]:
88
+ return isinstance(node, ast.BitAnd)
89
+
90
+ @staticmethod
91
+ def BitOr(node: ast.AST) -> TypeGuard[ast.BitOr]:
92
+ return isinstance(node, ast.BitOr)
93
+
94
+ @staticmethod
95
+ def BitXor(node: ast.AST) -> TypeGuard[ast.BitXor]:
96
+ return isinstance(node, ast.BitXor)
97
+
98
+ @staticmethod
99
+ def BoolOp(node: ast.AST) -> TypeGuard[ast.BoolOp]:
100
+ return isinstance(node, ast.BoolOp)
101
+
102
+ @staticmethod
103
+ def boolop(node: ast.AST) -> TypeGuard[ast.boolop]:
104
+ return isinstance(node, ast.boolop)
105
+
106
+ @staticmethod
107
+ def Break(node: ast.AST) -> TypeGuard[ast.Break]:
108
+ return isinstance(node, ast.Break)
109
+
110
+ @staticmethod
111
+ def Call(node: ast.AST) -> TypeGuard[ast.Call]:
112
+ return isinstance(node, ast.Call)
113
+
114
+ @staticmethod
115
+ def ClassDef(node: ast.AST) -> TypeGuard[ast.ClassDef]:
116
+ return isinstance(node, ast.ClassDef)
117
+
118
+ @staticmethod
119
+ def cmpop(node: ast.AST) -> TypeGuard[ast.cmpop]:
120
+ return isinstance(node, ast.cmpop)
121
+
122
+ @staticmethod
123
+ def Compare(node: ast.AST) -> TypeGuard[ast.Compare]:
124
+ return isinstance(node, ast.Compare)
125
+
126
+ @staticmethod
127
+ def comprehension(node: ast.AST) -> TypeGuard[ast.comprehension]:
128
+ return isinstance(node, ast.comprehension)
129
+
130
+ @staticmethod
131
+ def Constant(node: ast.AST) -> TypeGuard[ast.Constant]:
132
+ return isinstance(node, ast.Constant)
133
+
134
+ @staticmethod
135
+ def Continue(node: ast.AST) -> TypeGuard[ast.Continue]:
136
+ return isinstance(node, ast.Continue)
137
+
138
+ @staticmethod
139
+ def Del(node: ast.AST) -> TypeGuard[ast.Del]:
140
+ return isinstance(node, ast.Del)
141
+
142
+ @staticmethod
143
+ def Delete(node: ast.AST) -> TypeGuard[ast.Delete]:
144
+ return isinstance(node, ast.Delete)
145
+
146
+ @staticmethod
147
+ def Dict(node: ast.AST) -> TypeGuard[ast.Dict]:
148
+ return isinstance(node, ast.Dict)
149
+
150
+ @staticmethod
151
+ def DictComp(node: ast.AST) -> TypeGuard[ast.DictComp]:
152
+ return isinstance(node, ast.DictComp)
153
+
154
+ @staticmethod
155
+ def Div(node: ast.AST) -> TypeGuard[ast.Div]:
156
+ return isinstance(node, ast.Div)
157
+
158
+ @staticmethod
159
+ def Eq(node: ast.AST) -> TypeGuard[ast.Eq]:
160
+ return isinstance(node, ast.Eq)
161
+
162
+ @staticmethod
163
+ def excepthandler(node: ast.AST) -> TypeGuard[ast.excepthandler]:
164
+ return isinstance(node, ast.excepthandler)
165
+
166
+ @staticmethod
167
+ def ExceptHandler(node: ast.AST) -> TypeGuard[ast.ExceptHandler]:
168
+ return isinstance(node, ast.ExceptHandler)
169
+
170
+ @staticmethod
171
+ def Expr(node: ast.AST) -> TypeGuard[ast.Expr]:
172
+ return isinstance(node, ast.Expr)
173
+
174
+ @staticmethod
175
+ def expr(node: ast.AST) -> TypeGuard[ast.expr]:
176
+ return isinstance(node, ast.expr)
177
+
178
+ @staticmethod
179
+ def expr_context(node: ast.AST) -> TypeGuard[ast.expr_context]:
180
+ return isinstance(node, ast.expr_context)
181
+
182
+ @staticmethod
183
+ def Expression(node: ast.AST) -> TypeGuard[ast.Expression]:
184
+ return isinstance(node, ast.Expression)
185
+
186
+ @staticmethod
187
+ def FloorDiv(node: ast.AST) -> TypeGuard[ast.FloorDiv]:
188
+ return isinstance(node, ast.FloorDiv)
189
+
190
+ @staticmethod
191
+ def For(node: ast.AST) -> TypeGuard[ast.For]:
192
+ return isinstance(node, ast.For)
193
+
194
+ @staticmethod
195
+ def FormattedValue(node: ast.AST) -> TypeGuard[ast.FormattedValue]:
196
+ return isinstance(node, ast.FormattedValue)
197
+
198
+ @staticmethod
199
+ def FunctionDef(node: ast.AST) -> TypeGuard[ast.FunctionDef]:
200
+ return isinstance(node, ast.FunctionDef)
201
+
202
+ @staticmethod
203
+ def FunctionType(node: ast.AST) -> TypeGuard[ast.FunctionType]:
204
+ return isinstance(node, ast.FunctionType)
205
+
206
+ @staticmethod
207
+ def GeneratorExp(node: ast.AST) -> TypeGuard[ast.GeneratorExp]:
208
+ return isinstance(node, ast.GeneratorExp)
209
+
210
+ @staticmethod
211
+ def Global(node: ast.AST) -> TypeGuard[ast.Global]:
212
+ return isinstance(node, ast.Global)
213
+
214
+ @staticmethod
215
+ def Gt(node: ast.AST) -> TypeGuard[ast.Gt]:
216
+ return isinstance(node, ast.Gt)
217
+
218
+ @staticmethod
219
+ def GtE(node: ast.AST) -> TypeGuard[ast.GtE]:
220
+ return isinstance(node, ast.GtE)
221
+
222
+ @staticmethod
223
+ def If(node: ast.AST) -> TypeGuard[ast.If]:
224
+ return isinstance(node, ast.If)
225
+
226
+ @staticmethod
227
+ def IfExp(node: ast.AST) -> TypeGuard[ast.IfExp]:
228
+ return isinstance(node, ast.IfExp)
229
+
230
+ @staticmethod
231
+ def Import(node: ast.AST) -> TypeGuard[ast.Import]:
232
+ return isinstance(node, ast.Import)
233
+
234
+ @staticmethod
235
+ def ImportFrom(node: ast.AST) -> TypeGuard[ast.ImportFrom]:
236
+ return isinstance(node, ast.ImportFrom)
237
+
238
+ @staticmethod
239
+ def In(node: ast.AST) -> TypeGuard[ast.In]:
240
+ return isinstance(node, ast.In)
241
+
242
+ @staticmethod
243
+ def Interactive(node: ast.AST) -> TypeGuard[ast.Interactive]:
244
+ return isinstance(node, ast.Interactive)
245
+
246
+ @staticmethod
247
+ def Invert(node: ast.AST) -> TypeGuard[ast.Invert]:
248
+ return isinstance(node, ast.Invert)
249
+
250
+ @staticmethod
251
+ def Is(node: ast.AST) -> TypeGuard[ast.Is]:
252
+ return isinstance(node, ast.Is)
253
+
254
+ @staticmethod
255
+ def IsNot(node: ast.AST) -> TypeGuard[ast.IsNot]:
256
+ return isinstance(node, ast.IsNot)
257
+
258
+ @staticmethod
259
+ def JoinedStr(node: ast.AST) -> TypeGuard[ast.JoinedStr]:
260
+ return isinstance(node, ast.JoinedStr)
261
+
262
+ @staticmethod
263
+ def keyword(node: ast.AST) -> TypeGuard[ast.keyword]:
264
+ return isinstance(node, ast.keyword)
265
+
266
+ @staticmethod
267
+ def Lambda(node: ast.AST) -> TypeGuard[ast.Lambda]:
268
+ return isinstance(node, ast.Lambda)
269
+
270
+ @staticmethod
271
+ def List(node: ast.AST) -> TypeGuard[ast.List]:
272
+ return isinstance(node, ast.List)
273
+
274
+ @staticmethod
275
+ def ListComp(node: ast.AST) -> TypeGuard[ast.ListComp]:
276
+ return isinstance(node, ast.ListComp)
277
+
278
+ @staticmethod
279
+ def Load(node: ast.AST) -> TypeGuard[ast.Load]:
280
+ return isinstance(node, ast.Load)
281
+
282
+ @staticmethod
283
+ def LShift(node: ast.AST) -> TypeGuard[ast.LShift]:
284
+ return isinstance(node, ast.LShift)
285
+
286
+ @staticmethod
287
+ def Lt(node: ast.AST) -> TypeGuard[ast.Lt]:
288
+ return isinstance(node, ast.Lt)
289
+
290
+ @staticmethod
291
+ def LtE(node: ast.AST) -> TypeGuard[ast.LtE]:
292
+ return isinstance(node, ast.LtE)
293
+
294
+ @staticmethod
295
+ def Match(node: ast.AST) -> TypeGuard[ast.Match]:
296
+ return isinstance(node, ast.Match)
297
+
298
+ @staticmethod
299
+ def match_case(node: ast.AST) -> TypeGuard[ast.match_case]:
300
+ return isinstance(node, ast.match_case)
301
+
302
+ @staticmethod
303
+ def MatchAs(node: ast.AST) -> TypeGuard[ast.MatchAs]:
304
+ return isinstance(node, ast.MatchAs)
305
+
306
+ @staticmethod
307
+ def MatchClass(node: ast.AST) -> TypeGuard[ast.MatchClass]:
308
+ return isinstance(node, ast.MatchClass)
309
+
310
+ @staticmethod
311
+ def MatchMapping(node: ast.AST) -> TypeGuard[ast.MatchMapping]:
312
+ return isinstance(node, ast.MatchMapping)
313
+
314
+ @staticmethod
315
+ def MatchOr(node: ast.AST) -> TypeGuard[ast.MatchOr]:
316
+ return isinstance(node, ast.MatchOr)
317
+
318
+ @staticmethod
319
+ def MatchSequence(node: ast.AST) -> TypeGuard[ast.MatchSequence]:
320
+ return isinstance(node, ast.MatchSequence)
321
+
322
+ @staticmethod
323
+ def MatchSingleton(node: ast.AST) -> TypeGuard[ast.MatchSingleton]:
324
+ return isinstance(node, ast.MatchSingleton)
325
+
326
+ @staticmethod
327
+ def MatchStar(node: ast.AST) -> TypeGuard[ast.MatchStar]:
328
+ return isinstance(node, ast.MatchStar)
329
+
330
+ @staticmethod
331
+ def MatchValue(node: ast.AST) -> TypeGuard[ast.MatchValue]:
332
+ return isinstance(node, ast.MatchValue)
333
+
334
+ @staticmethod
335
+ def MatMult(node: ast.AST) -> TypeGuard[ast.MatMult]:
336
+ return isinstance(node, ast.MatMult)
337
+
338
+ @staticmethod
339
+ def mod(node: ast.AST) -> TypeGuard[ast.mod]:
340
+ return isinstance(node, ast.mod)
341
+
342
+ @staticmethod
343
+ def Mod(node: ast.AST) -> TypeGuard[ast.Mod]:
344
+ return isinstance(node, ast.Mod)
345
+
346
+ @staticmethod
347
+ def Module(node: ast.AST) -> TypeGuard[ast.Module]:
348
+ return isinstance(node, ast.Module)
349
+
350
+ @staticmethod
351
+ def Mult(node: ast.AST) -> TypeGuard[ast.Mult]:
352
+ return isinstance(node, ast.Mult)
353
+
354
+ @staticmethod
355
+ def Name(node: ast.AST) -> TypeGuard[ast.Name]:
356
+ return isinstance(node, ast.Name)
357
+
358
+ @staticmethod
359
+ def NamedExpr(node: ast.AST) -> TypeGuard[ast.NamedExpr]:
360
+ return isinstance(node, ast.NamedExpr)
361
+
362
+ @staticmethod
363
+ def NodeTransformer(node: ast.AST) -> TypeGuard[ast.NodeTransformer]:
364
+ return isinstance(node, ast.NodeTransformer)
365
+
366
+ @staticmethod
367
+ def NodeVisitor(node: ast.AST) -> TypeGuard[ast.NodeVisitor]:
368
+ return isinstance(node, ast.NodeVisitor)
369
+
370
+ @staticmethod
371
+ def Nonlocal(node: ast.AST) -> TypeGuard[ast.Nonlocal]:
372
+ return isinstance(node, ast.Nonlocal)
373
+
374
+ @staticmethod
375
+ def Not(node: ast.AST) -> TypeGuard[ast.Not]:
376
+ return isinstance(node, ast.Not)
377
+
378
+ @staticmethod
379
+ def NotEq(node: ast.AST) -> TypeGuard[ast.NotEq]:
380
+ return isinstance(node, ast.NotEq)
381
+
382
+ @staticmethod
383
+ def NotIn(node: ast.AST) -> TypeGuard[ast.NotIn]:
384
+ return isinstance(node, ast.NotIn)
385
+
386
+ @staticmethod
387
+ def operator(node: ast.AST) -> TypeGuard[ast.operator]:
388
+ return isinstance(node, ast.operator)
389
+
390
+ @staticmethod
391
+ def Or(node: ast.AST) -> TypeGuard[ast.Or]:
392
+ return isinstance(node, ast.Or)
393
+
394
+ @staticmethod
395
+ def ParamSpec(node: ast.AST) -> TypeGuard[astDOTParamSpec]:
396
+ return isinstance(node, astDOTParamSpec)
397
+
398
+ @staticmethod
399
+ def Pass(node: ast.AST) -> TypeGuard[ast.Pass]:
400
+ return isinstance(node, ast.Pass)
401
+
402
+ @staticmethod
403
+ def pattern(node: ast.AST) -> TypeGuard[ast.pattern]:
404
+ return isinstance(node, ast.pattern)
405
+
406
+ @staticmethod
407
+ def Pow(node: ast.AST) -> TypeGuard[ast.Pow]:
408
+ return isinstance(node, ast.Pow)
409
+
410
+ @staticmethod
411
+ def Raise(node: ast.AST) -> TypeGuard[ast.Raise]:
412
+ return isinstance(node, ast.Raise)
413
+
414
+ @staticmethod
415
+ def Return(node: ast.AST) -> TypeGuard[ast.Return]:
416
+ return isinstance(node, ast.Return)
417
+
418
+ @staticmethod
419
+ def RShift(node: ast.AST) -> TypeGuard[ast.RShift]:
420
+ return isinstance(node, ast.RShift)
421
+
422
+ @staticmethod
423
+ def Set(node: ast.AST) -> TypeGuard[ast.Set]:
424
+ return isinstance(node, ast.Set)
425
+
426
+ @staticmethod
427
+ def SetComp(node: ast.AST) -> TypeGuard[ast.SetComp]:
428
+ return isinstance(node, ast.SetComp)
429
+
430
+ @staticmethod
431
+ def Slice(node: ast.AST) -> TypeGuard[ast.Slice]:
432
+ return isinstance(node, ast.Slice)
433
+
434
+ @staticmethod
435
+ def Starred(node: ast.AST) -> TypeGuard[ast.Starred]:
436
+ return isinstance(node, ast.Starred)
437
+
438
+ @staticmethod
439
+ def stmt(node: ast.AST) -> TypeGuard[ast.stmt]:
440
+ return isinstance(node, ast.stmt)
441
+
442
+ @staticmethod
443
+ def Store(node: ast.AST) -> TypeGuard[ast.Store]:
444
+ return isinstance(node, ast.Store)
445
+
446
+ @staticmethod
447
+ def Sub(node: ast.AST) -> TypeGuard[ast.Sub]:
448
+ return isinstance(node, ast.Sub)
449
+
450
+ @staticmethod
451
+ def Subscript(node: ast.AST) -> TypeGuard[ast.Subscript]:
452
+ return isinstance(node, ast.Subscript)
453
+
454
+ @staticmethod
455
+ def Try(node: ast.AST) -> TypeGuard[ast.Try]:
456
+ return isinstance(node, ast.Try)
457
+
458
+ @staticmethod
459
+ def TryStar(node: ast.AST) -> TypeGuard[astDOTTryStar]:
460
+ return isinstance(node, astDOTTryStar)
461
+
462
+ @staticmethod
463
+ def Tuple(node: ast.AST) -> TypeGuard[ast.Tuple]:
464
+ return isinstance(node, ast.Tuple)
465
+
466
+ @staticmethod
467
+ def type_ignore(node: ast.AST) -> TypeGuard[ast.type_ignore]:
468
+ return isinstance(node, ast.type_ignore)
469
+
470
+ @staticmethod
471
+ def type_param(node: ast.AST) -> TypeGuard[astDOTtype_param]:
472
+ return isinstance(node, astDOTtype_param)
473
+
474
+ @staticmethod
475
+ def TypeAlias(node: ast.AST) -> TypeGuard[astDOTTypeAlias]:
476
+ return isinstance(node, astDOTTypeAlias)
477
+
478
+ @staticmethod
479
+ def TypeIgnore(node: ast.AST) -> TypeGuard[ast.TypeIgnore]:
480
+ return isinstance(node, ast.TypeIgnore)
481
+
482
+ @staticmethod
483
+ def TypeVar(node: ast.AST) -> TypeGuard[astDOTTypeVar]:
484
+ return isinstance(node, astDOTTypeVar)
485
+
486
+ @staticmethod
487
+ def TypeVarTuple(node: ast.AST) -> TypeGuard[astDOTTypeVarTuple]:
488
+ return isinstance(node, astDOTTypeVarTuple)
489
+
490
+ @staticmethod
491
+ def UAdd(node: ast.AST) -> TypeGuard[ast.UAdd]:
492
+ return isinstance(node, ast.UAdd)
493
+
494
+ @staticmethod
495
+ def UnaryOp(node: ast.AST) -> TypeGuard[ast.UnaryOp]:
496
+ return isinstance(node, ast.UnaryOp)
497
+
498
+ @staticmethod
499
+ def unaryop(node: ast.AST) -> TypeGuard[ast.unaryop]:
500
+ return isinstance(node, ast.unaryop)
501
+
502
+ @staticmethod
503
+ def USub(node: ast.AST) -> TypeGuard[ast.USub]:
504
+ return isinstance(node, ast.USub)
505
+
506
+ @staticmethod
507
+ def While(node: ast.AST) -> TypeGuard[ast.While]:
508
+ return isinstance(node, ast.While)
509
+
510
+ @staticmethod
511
+ def With(node: ast.AST) -> TypeGuard[ast.With]:
512
+ return isinstance(node, ast.With)
513
+
514
+ @staticmethod
515
+ def withitem(node: ast.AST) -> TypeGuard[ast.withitem]:
516
+ return isinstance(node, ast.withitem)
517
+
518
+ @staticmethod
519
+ def Yield(node: ast.AST) -> TypeGuard[ast.Yield]:
520
+ return isinstance(node, ast.Yield)
521
+
522
+ @staticmethod
523
+ def YieldFrom(node: ast.AST) -> TypeGuard[ast.YieldFrom]:
524
+ return isinstance(node, ast.YieldFrom)