(stmt: cst.Import | cst.ImportFrom)
| 511 | |
| 512 | @staticmethod |
| 513 | def is_datetime_import(stmt: cst.Import | cst.ImportFrom) -> bool: |
| 514 | return ( |
| 515 | isinstance(stmt, cst.ImportFrom) |
| 516 | and isinstance(stmt.module, cst.Name) |
| 517 | and stmt.module.value == "datetime" |
| 518 | and stmt.names |
| 519 | and isinstance(stmt.names[0], cst.ImportAlias) |
| 520 | and isinstance(stmt.names[0].name, cst.Name) |
| 521 | and stmt.names[0].name.value == "datetime" |
| 522 | ) |
| 523 | |
| 524 | @staticmethod |
| 525 | def add_datetime_import(node: cst.Module, index: int) -> cst.Module: |
no outgoing calls
no test coverage detected