def _extract_imports(self, lines: list[str]) -> list[str]:
        """Extract import statements from the code."""
        imports = []
        for line in lines:
            line = line.strip()
            if line.startswith(("import ", "from ")) and not line.startswith(
                "#"
            ):
                imports.append(line)
        return imports
Extract import statements from the code.
py/core/parsers/text/python_parser.py