(node: ast.Call)
| 218 | |
| 219 | # Returns the literal year when this is a datetime(...) call shape we lint for. |
| 220 | def _wall_clock_year_from_datetime_call(node: ast.Call) -> int | None: |
| 221 | if not node.args: |
| 222 | return None |
| 223 | y = node.args[0] |
| 224 | if not isinstance(y, ast.Constant) or not isinstance(y.value, int): |
| 225 | return None |
| 226 | if isinstance(node.func, ast.Name) and node.func.id == "datetime": |
| 227 | return y.value |
| 228 | if ( |
| 229 | isinstance(node.func, ast.Attribute) |
| 230 | and node.func.attr == "datetime" |
| 231 | and isinstance(node.func.value, ast.Name) |
| 232 | and node.func.value.id == "datetime" |
| 233 | ): |
| 234 | return y.value |
| 235 | return None |
| 236 | |
| 237 | |
| 238 | def _is_eap_events_endpoint_test_path(filename: str) -> bool: |
no outgoing calls
no test coverage detected