def _add_doc_section(doc: str, section: str) -> str:
    """Add section with correct indentation to docstring."""
    items = doc.split('\n', maxsplit=2)

    if len(items) == 1:
        empty = ''
        head = items[0]
        body = ''
    else:
        empty, head, body = items

    indent = (len(head) - len(head.lstrip(' '))) * ' '

    section = indent + section.replace('\n', '\n' + indent)
    return '\n'.join([empty, head, '', section, body])