(node: cst.Module, index: int)
| 523 | |
| 524 | @staticmethod |
| 525 | def add_datetime_import(node: cst.Module, index: int) -> cst.Module: |
| 526 | import_stmt = cst.SimpleStatementLine( |
| 527 | [ |
| 528 | cst.ImportFrom( |
| 529 | cst.Name("datetime"), [cst.ImportAlias(cst.Name("datetime")), cst.ImportAlias(cst.Name("timezone"))] |
| 530 | ) |
| 531 | ] |
| 532 | ) |
| 533 | stmts = list(node.body) |
| 534 | return node.with_changes(body=stmts[:index] + [import_stmt] + stmts[index:]) |
| 535 | |
| 536 | @staticmethod |
| 537 | def add_future_import(node: cst.Module) -> cst.Module: |
no outgoing calls
no test coverage detected