MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / node_import_from

Function node_import_from

ngrams.py:215–229  ·  view source on GitHub ↗
(node: dict)

Source from the content-addressed store, hash-verified

213
214
215def node_import_from(node: dict) -> ASTNodeIdentifier:
216 stmt = ASTNodeIdentifier(label=node['module'], node_type='import_from')
217 names = ASTNodeIdentifier(node_type='import_from_names')
218
219 for n in node['names']:
220 name = ASTNodeIdentifier(label=n['name'], node_type='import_from_name')
221 if n['asname']:
222 asname = ASTNodeIdentifier(label=n['asname'], node_type='import_from_name_asname')
223 name += asname
224 names += name
225 stmt += names
226
227 level = ASTNodeIdentifier(label=str(node['level']), node_type='import_from_level')
228 stmt += level
229 return stmt
230
231
232def node_print(node: dict) -> ASTNodeIdentifier:

Callers

nothing calls this directly

Calls 1

ASTNodeIdentifierClass · 0.85

Tested by

no test coverage detected