def _process_python_code(self, code: str) -> str:
        """Process Python code into a more structured text representation.

        This method:
        1. Preserves module-level docstrings
        2. Extracts class and function definitions with their docstrings
        3. Preserves comments and code structure
        4. Removes unnecessary whitespace
        """
        # Split into lines for processing
        lines = code.splitlines()
        result = []

        # Extract module docstring if present
        module_docstring = self._extract_module_docstring(code)
        if module_docstring:
            result.append("MODULE DOCSTRING:")
            result.append(module_docstring)
            result.append("")

        # Extract imports
        imports = self._extract_imports(lines)
        if imports:
            result.append("IMPORTS:")
            result.extend(imports)
            result.append("")

        # Extract class and function definitions with docstrings
        definitions = self._extract_definitions(code)
        if definitions:
            result.append("DEFINITIONS:")
            result.extend(definitions)

        return "\n".join(result)
Process Python code into a more structured text representation.

        This method:
        1. Preserves module-level docstrings
        2. Extracts class and function definitions with their docstrings
        3. Preserves comments and code structure
        4. Removes unnecessary whitespace
        
py/core/parsers/text/python_parser.py