INNER CODE UNIT · Python
_extract_function_declaration
Kotlin/kandy · util/kandy-samples-utils/nb_to_doc.py:376
def _extract_function_declaration(lines: List[str], start_index: int) -> Tuple[Optional[Tuple[str, str]], int]:
"""
Extract a function declaration from lines.
Args:
lines: List of code lines
start_index: Index to start extraction from
Returns:
Tuple of ((declaration_type, declaration_text), new_index) or (None, new_index)
"""
declaration, i = _extract_block_declaration(lines, start_index, 'function')
_, full_decl = declaration
# Skip test functions
if '@Test' in full_decl or 'test' in full_decl.lower():
return None, i