Find cell magic, extract header and body.
(self, node: ast.Expr)
| 399 | self.cell_magic = cell_magic |
| 400 | |
| 401 | def visit_Expr(self, node: ast.Expr) -> None: |
| 402 | """Find cell magic, extract header and body.""" |
| 403 | if ( |
| 404 | isinstance(node.value, ast.Call) |
| 405 | and _is_ipython_magic(node.value.func) |
| 406 | and node.value.func.attr == "run_cell_magic" |
| 407 | ): |
| 408 | args = _get_str_args(node.value.args) |
| 409 | self.cell_magic = CellMagic(name=args[0], params=args[1], body=args[2]) |
| 410 | self.generic_visit(node) |
| 411 | |
| 412 | |
| 413 | @dataclasses.dataclass(frozen=True) |
nothing calls this directly
no test coverage detected