(
self,
context: Context,
_type=type,
_isinstance=isinstance,
_dict=dict,
_list=list
)
| 249 | |
| 250 | @ignore_error |
| 251 | def __process_context( |
| 252 | self, |
| 253 | context: Context, |
| 254 | _type=type, |
| 255 | _isinstance=isinstance, |
| 256 | _dict=dict, |
| 257 | _list=list |
| 258 | ): |
| 259 | self._visit_node(context) |
| 260 | |
| 261 | if context.modified: |
| 262 | return |
| 263 | |
| 264 | # Using map is much faster then for-loop |
| 265 | if _type(context.node) in (_dict, OrderedDict): |
| 266 | if context.node.get("lineno") in config.DEBUG_LINES: |
| 267 | breakpoint() |
| 268 | keys = _list(k for k, v in context.node.items() if type(v) not in (str, int)) |
| 269 | _list(map(lambda k: self.__visit_dict(k, context), keys)) |
| 270 | elif _type(context.node) == _list: |
| 271 | _list(map(lambda x: self.__visit_list(x[0], x[1], context), enumerate(context.node))) |
| 272 | elif _isinstance(context.node, ASTNode): |
| 273 | if context.node.line_no in config.DEBUG_LINES: |
| 274 | breakpoint() |
| 275 | |
| 276 | if not context.node.converged: |
| 277 | context.node._visit_node(context) |
| 278 | |
| 279 | def __visit_dict(self, key: str, context: Context): |
| 280 | value = context.node[key] |
no test coverage detected