(node, text=None, children=None, *, constructor=None)
| 60 | |
| 61 | |
| 62 | def patch_node(node, text=None, children=None, *, constructor=None): |
| 63 | if constructor is None: |
| 64 | constructor = node.__class__ |
| 65 | |
| 66 | if text is None: |
| 67 | text = node.text |
| 68 | |
| 69 | if children is None: |
| 70 | children = get_children(node) |
| 71 | |
| 72 | return constructor( |
| 73 | node.source, |
| 74 | text, |
| 75 | *children, |
| 76 | **node.attributes, |
| 77 | ) |
| 78 | |
| 79 | |
| 80 | def function_transformer(new_name): |
no test coverage detected