(pandas_name, short_doc_flag=False, doc_from_pandas_flag=True, add_sdc_sections=True,
                               unsupported_warning=True, reformat_pandas=True)
return reformat(doc)
Generates documentation for Pandas object obj according to flags.

    For complex objects such as modules and classes the function does not go to sub-objects,
    i.e. to class attributes and sub-modules of the module.

    :param pandas_name: Pandas object for which documentation to be generated.
    :param short_doc_flag: Flag to indicate that only short description for the object is needed.
    :param doc_from_pandas_flag: Flag to indicate that the documentation must be taken from Pandas docstring.
           This docstring can be extended with Intel SDC specific sections. These are See Also, Examples,
           Notes, Warning, Limitations, etc. if ``add_sdc_sections`` flag is set.
    :param add_sdc_sections: Flag to indicate that extra sections of the documentation need to be taken from Intel SDC.
           If ``doc_from_pandas_flag==False`` then the description section is taken from Intel SDC too. Otherwise
           Intel SDC description section will be cut and Pandas API description will be used instead.
    :param unsupported_warning: Flag, if ``True`` includes warning message if corresponding Intel SDC object is not
           found. This indicates that given SDC method is unsupported.
    :param reformat_pandas: Flag, if ``True`` re-formats Parameters section to :param: style. Needed to work around
           Sphinx generator issues for Pandas Parameters section written in NumPy style
    :return: Generated docstring.
Generates documentation for Pandas object obj according to flags.
Generates documentation for Pandas object obj according to flags .
def generate_simple_object_doc(pandas_name, short_doc_flag=False, doc_from_pandas_flag=True, add_sdc_sections=True,
                               unsupported_warning=True, reformat_pandas=True):
    """
    Generates documentation for Pandas object obj according to flags.

    For complex objects such as modules and classes the function does not go to sub-objects,
    i.e. to class attributes and sub-modules of the module.

    :param pandas_name: Pandas object for which documentation to be generated.
    :param short_doc_flag: Flag to indicate that only short description for the object is needed.
    :param doc_from_pandas_flag: Flag to indicate that the documentation must be taken from Pandas docstring.
           This docstring can be extended with Intel SDC specific sections. These are See Also, Examples,
           Notes, Warning, Limitations, etc. if ``add_sdc_sections`` flag is set.
    :param add_sdc_sections: Flag to indicate that extra sections of the documentation need to be taken from Intel SDC.
           If ``doc_from_pandas_flag==False`` then the description section is taken from Intel SDC too. Otherwise
           Intel SDC description section will be cut and Pandas API description will be used instead.
    :param unsupported_warning: Flag, if ``True`` includes warning message if corresponding Intel SDC object is not
           found. This indicates that given SDC method is unsupported.
    :param reformat_pandas: Flag, if ``True`` re-formats Parameters section to :param: style. Needed to work around
           Sphinx generator issues for Pandas Parameters section written in NumPy style
    :return: Generated docstring.
    """

    doc = ''
    pandas_obj = get_obj(pandas_name)
    if pandas_obj is None:
        return doc  # Empty documentation for no-object

    # Here if additional sections from Intel SDC object needs to be added to pandas_obj docstring
    sdc_obj = get_sdc_object_by_pandas_name(pandas_name)

    if pandas_obj == 0:
        # there is no Pandas documentation, documentation is fully generated from SDC docstring
        doc_from_pandas_flag = False
        if short_doc_flag:
            doc = get_short_description(sdc_obj, sdc_header_flag=True)
            return reformat(doc)

    if doc_from_pandas_flag:  # Check if documentation needs to be generated from Pandas docstring
        if short_doc_flag:  # Check if only short description is needed
            doc = get_short_description(pandas_obj)  # Short description is requested
        else:
            # Exclude Examples, Notes, See Also, References sections
            sections = split_in_sections(reindent(get_docstring(pandas_obj), 0))
            while len(sections) > 0:
                title, text = sections[0]
                if title.strip() == '':  # Description sections
                    doc += text + '\n\n'
                    sections.pop(0)
                elif title.strip() == 'Examples':  # Exclude Examples section
                    sections.pop(0)
                elif title.strip() == 'Notes':  # Exclude Notes section (may be too specific to Pandas)
                    sections.pop(0)
                elif title.strip().lower() == 'see also':  # Exclude See Also section (may be too specific to Pandas)
                    sections.pop(0)
                elif title.strip() == 'References':  # Exclude References section (may be too specific to Pandas)
                    sections.pop(0)
                elif title.strip() == 'Parameters' or title.strip() == 'Raises' or title.strip() == 'Return' or \
                        title.strip() == 'Returns':
                    if reformat_pandas:
                        doc += reformat_pandas_params(title, text)
                        sections.pop(0)
                    else:
                        doc += create_heading_str(title) + '\n\n' + text + '\n\n'
                        sections.pop(0)
                else:
                    doc += create_heading_str(title) + '\n\n' + text + '\n\n'
                    sections.pop(0)

    if not add_sdc_sections:
        if reformat_pandas:
            return reformat(doc)
        else:
            return doc

    if sdc_obj is None:
        if unsupported_warning:
            if reformat_pandas:
                doc = reformat(doc)

            if short_doc_flag:
                return doc + ' **Unsupported by Intel SDC**.'
            else:
                return doc + '\n\n.. warning::\n    This feature is currently unsupported ' \
                                      'by Intel Scalable Dataframe Compiler\n\n'

    if not short_doc_flag:
        sdc_doc = get_docstring(sdc_obj)
        sdc_doc = cut_sdc_dev_guide(sdc_doc)

        # Cut description section from ``sdc_doc``
        if is_sdc_user_guide_header(sdc_doc[0]):  # First section is SDC User Guide header
            sdc_doc.pop(0)

        if doc_from_pandas_flag:
            # Ignore description from Intel SDC, keep Pandas description only
            while len(sdc_doc) > 0:
                title, text = sdc_doc[0]
                if title.strip() != '':
                    break
                sdc_doc.pop(0)

        indent = get_indent(doc)
        for title, text in sdc_doc:
            if title.strip() == '':
                if pandas_obj == 0:
                    doc += reindent(text, indent) + '\n'
                else:
                    doc += '\n' + reindent(text, indent)
            else:
                doc += '\n' + reindent(create_heading_str(title), indent) + '\n' + \
                       reindent(text, indent) + '\n'

    return reformat(doc)
def generate_simple_object_doc ( pandas_name , short_doc_flag = False , doc_from_pandas_flag = True , add_sdc_sections = True , unsupported_warning = True , reformat_pandas = True ) : doc = '' pandas_obj = get_obj ( pandas_name ) if pandas_obj is None : return doc # Empty documentation for no-object # Here if additional sections from Intel SDC object needs to be added to pandas_obj docstring sdc_obj = get_sdc_object_by_pandas_name ( pandas_name ) if pandas_obj == 0 : # there is no Pandas documentation, documentation is fully generated from SDC docstring doc_from_pandas_flag = False if short_doc_flag : doc = get_short_description ( sdc_obj , sdc_header_flag = True ) return reformat ( doc ) if doc_from_pandas_flag : # Check if documentation needs to be generated from Pandas docstring if short_doc_flag : # Check if only short description is needed doc = get_short_description ( pandas_obj ) # Short description is requested else : # Exclude Examples, Notes, See Also, References sections sections = split_in_sections ( reindent ( get_docstring ( pandas_obj ) , 0 ) ) while len ( sections ) > 0 : title , text = sections [ 0 ] if title . strip ( ) == '' : # Description sections doc += text + '\n\n' sections . pop ( 0 ) elif title . strip ( ) == 'Examples' : # Exclude Examples section sections . pop ( 0 ) elif title . strip ( ) == 'Notes' : # Exclude Notes section (may be too specific to Pandas) sections . pop ( 0 ) elif title . strip ( ) . lower ( ) == 'see also' : # Exclude See Also section (may be too specific to Pandas) sections . pop ( 0 ) elif title . strip ( ) == 'References' : # Exclude References section (may be too specific to Pandas) sections . pop ( 0 ) elif title . strip ( ) == 'Parameters' or title . strip ( ) == 'Raises' or title . strip ( ) == 'Return' or title . strip ( ) == 'Returns' : if reformat_pandas : doc += reformat_pandas_params ( title , text ) sections . pop ( 0 ) else : doc += create_heading_str ( title ) + '\n\n' + text + '\n\n' sections . pop ( 0 ) else : doc += create_heading_str ( title ) + '\n\n' + text + '\n\n' sections . pop ( 0 ) if not add_sdc_sections : if reformat_pandas : return reformat ( doc ) else : return doc if sdc_obj is None : if unsupported_warning : if reformat_pandas : doc = reformat ( doc ) if short_doc_flag : return doc + ' **Unsupported by Intel SDC**.' else : return doc + '\n\n.. warning::\n    This feature is currently unsupported ' 'by Intel Scalable Dataframe Compiler\n\n' if not short_doc_flag : sdc_doc = get_docstring ( sdc_obj ) sdc_doc = cut_sdc_dev_guide ( sdc_doc ) # Cut description section from ``sdc_doc`` if is_sdc_user_guide_header ( sdc_doc [ 0 ] ) : # First section is SDC User Guide header sdc_doc . pop ( 0 ) if doc_from_pandas_flag : # Ignore description from Intel SDC, keep Pandas description only while len ( sdc_doc ) > 0 : title , text = sdc_doc [ 0 ] if title . strip ( ) != '' : break sdc_doc . pop ( 0 ) indent = get_indent ( doc ) for title , text in sdc_doc : if title . strip ( ) == '' : if pandas_obj == 0 : doc += reindent ( text , indent ) + '\n' else : doc += '\n' + reindent ( text , indent ) else : doc += '\n' + reindent ( create_heading_str ( title ) , indent ) + '\n' + reindent ( text , indent ) + '\n' return reformat ( doc )