(section)
Split section into title and remaining text.

    :param section: String, documented section
    :return: Tuple (title, text)
Split section into title and remaining text.
Split section into title and remaining text .
def split_title(section):
    """
    Split section into title and remaining text.

    :param section: String, documented section
    :return: Tuple (title, text)
    """

    if section is None:
        return '', ''

    section = section.lstrip('\n')  # Remove leading empty lines

    lines = section.split('\n', 2)
    if len(lines) > 1:
        # Only sections with number of lines >= 2 can be a title
        if is_section_title(lines[0].strip(), lines[1].strip()):
            if len(lines) > 2:
                return lines[0], lines[2]  # First line is title, second is underline, remaining is text
            else:
                return lines[0], ''  # First line is title, second line is underline, but the text is empty string
        else:
            return '', section  # First two lines do not form valid heading
    else:
        return '', section
def split_title ( section ) : if section is None : return '' , '' section = section . lstrip ( '\n' ) # Remove leading empty lines lines = section . split ( '\n' , 2 ) if len ( lines ) > 1 : # Only sections with number of lines >= 2 can be a title if is_section_title ( lines [ 0 ] . strip ( ) , lines [ 1 ] . strip ( ) ) : if len ( lines ) > 2 : return lines [ 0 ] , lines [ 2 ] # First line is title, second is underline, remaining is text else : return lines [ 0 ] , '' # First line is title, second line is underline, but the text is empty string else : return '' , section # First two lines do not form valid heading else : return '' , section