(sections)
return merged_sections
Internal utility function that merges paragraphs into a single section.

    This function call is required after initial splitting of the docstring into sections.  The initial split
    is based on the presence of ``'\n\n'``, which separates sections and paragraphs. The difference between
    section and paragraph is that section starts with the title of the form:

        This is title
        -------------
        This is the first paragraph. It may be multi-line.
        This is the second line of the paragraph.

        This is another multi-line paragraph.
        This is the second line of the paragraph.

    Special treatment is required for Intel SDC header section and the following description section. Intel SDC
    header section must the the first one in the docstring. It consists of exactly 3 lines:

        Intel Scalable Dataframe Compiler User Guide
        ********************************************
        Pandas API: *pandas_api_fully_qualified_name*

    Right after the Intel SDC header section the description section (if any) goes. It generally consists of two
    or more paragraphs. The first paragraph represents short description, which is typically single line.
    The following paragraphs provide full description. In rare cases documentation does not have description section,
    and this must be treated accordingly.


    :param sections: List of tuples ``(title, text)``.
    :return: Reformatted list of tuples ``(title, text)`, where paragraphs belonging to one section are merged in
        single ``text`` item.
Internal utility function that merges paragraphs into a single section.
Internal utility function that merges paragraphs into a single section .
def _merge_paragraphs_within_section(sections):
    """
    Internal utility function that merges paragraphs into a single section.

    This function call is required after initial splitting of the docstring into sections.  The initial split
    is based on the presence of ``'\n\n'``, which separates sections and paragraphs. The difference between
    section and paragraph is that section starts with the title of the form:

        This is title
        -------------
        This is the first paragraph. It may be multi-line.
        This is the second line of the paragraph.

        This is another multi-line paragraph.
        This is the second line of the paragraph.

    Special treatment is required for Intel SDC header section and the following description section. Intel SDC
    header section must the the first one in the docstring. It consists of exactly 3 lines:

        Intel Scalable Dataframe Compiler User Guide
        ********************************************
        Pandas API: *pandas_api_fully_qualified_name*

    Right after the Intel SDC header section the description section (if any) goes. It generally consists of two
    or more paragraphs. The first paragraph represents short description, which is typically single line.
    The following paragraphs provide full description. In rare cases documentation does not have description section,
    and this must be treated accordingly.


    :param sections: List of tuples ``(title, text)``.
    :return: Reformatted list of tuples ``(title, text)`, where paragraphs belonging to one section are merged in
        single ``text`` item.
    """
    if len(sections) == 0:
        return sections

    merged_sections = []
    # Check if the very first section is Intel SDC header
    section_title, section_text = sections[0]
    if is_sdc_user_guide_header((section_title, section_text)):
        merged_sections.append(sections[0])
        sections.pop(0)

    # Check if the next section is the short description
    section_title, section_text = sections[0]
    if section_title.strip() == '':
        merged_sections.append(sections[0])
        sections.pop(0)

    if len(sections) == 0:
        return merged_sections

    # Merge next sections with empty title into a single section representing full description
    section_title, section_text = sections[0]
    if section_title.strip() == '':
        sections.pop(0)
        while len(sections) > 0:
            title, text = sections[0]
            if title.strip() == '':
                section_text += '\n\n' + text
                sections.pop(0)
            else:
                break
        merged_sections.append((section_title, section_text))

    # Now merge paragraphs of remaining titled sections
    while len(sections) > 0:
        section_title, section_text = sections[0]
        sections.pop(0)
        while len(sections) > 0:
            title, text = sections[0]
            if title.strip() == '':
                section_text += '\n\n' + text
                sections.pop(0)
            else:
                break
        merged_sections.append((section_title, section_text))

    return merged_sections
def _merge_paragraphs_within_section ( sections ) : if len ( sections ) == 0 : return sections merged_sections = [ ] # Check if the very first section is Intel SDC header section_title , section_text = sections [ 0 ] if is_sdc_user_guide_header ( ( section_title , section_text ) ) : merged_sections . append ( sections [ 0 ] ) sections . pop ( 0 ) # Check if the next section is the short description section_title , section_text = sections [ 0 ] if section_title . strip ( ) == '' : merged_sections . append ( sections [ 0 ] ) sections . pop ( 0 ) if len ( sections ) == 0 : return merged_sections # Merge next sections with empty title into a single section representing full description section_title , section_text = sections [ 0 ] if section_title . strip ( ) == '' : sections . pop ( 0 ) while len ( sections ) > 0 : title , text = sections [ 0 ] if title . strip ( ) == '' : section_text += '\n\n' + text sections . pop ( 0 ) else : break merged_sections . append ( ( section_title , section_text ) ) # Now merge paragraphs of remaining titled sections while len ( sections ) > 0 : section_title , section_text = sections [ 0 ] sections . pop ( 0 ) while len ( sections ) > 0 : title , text = sections [ 0 ] if title . strip ( ) == '' : section_text += '\n\n' + text sections . pop ( 0 ) else : break merged_sections . append ( ( section_title , section_text ) ) return merged_sections