def _split_docstring_sections(docstring: str) -> dict[str, list[str]]:
    """Splits the docstring into sections: description, args, and returns."""
    lines = docstring.strip().splitlines()
    sections = {"description": [], "args": [], "returns": []}
    current_section = "description"
    section_titles = {"Args:": "args", "Arguments:": "args", "Returns:": "returns"}

    for line in lines:
        stripped_line = line.strip()
        matched_section = False
        for title, section in section_titles.items():
            if stripped_line.startswith(title):
                current_section = section
                content = stripped_line[len(title) :].strip()
                if content:
                    sections[current_section].append(content)
                matched_section = True
                break
        if matched_section:
            continue
        sections[current_section].append(line)
    return sections
Splits the docstring into sections: description, args, and returns.
ai/core/src/unitycatalog/ai/core/utils/docstring_utils.py