MCPcopy
hub / github.com/pandas-dev/pandas / get_defined_errors

Function get_defined_errors

scripts/pandas_errors_documented.py:24–32  ·  view source on GitHub ↗
(content: str)

Source from the content-addressed store, hash-verified

22
23
24def get_defined_errors(content: str) -> set[str]:
25 errors = set()
26 for node in ast.walk(ast.parse(content)):
27 if isinstance(node, ast.ClassDef):
28 errors.add(node.name)
29 elif isinstance(node, ast.ImportFrom) and node.module != "__future__":
30 for alias in node.names:
31 errors.add(alias.name)
32 return errors
33
34
35def main(argv: Sequence[str] | None = None) -> None:

Callers 1

mainFunction · 0.85

Calls 3

walkMethod · 0.80
parseMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected