MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / is_datetime_import

Method is_datetime_import

scripts/openapi.py:513–522  ·  view source on GitHub ↗
(stmt: cst.Import | cst.ImportFrom)

Source from the content-addressed store, hash-verified

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:

Callers 2

leave_ModuleMethod · 0.80
leave_ModuleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected