def auto_change_docstring(app, what, name, obj, options, lines):
    r"""Make some automatic changes to docstrings.

    Things this function does are:

        - Add a title to module docstrings
        - Merge lines that end with a '\' with the next line.
    """
    if what == 'module' and name.startswith('pylatex'):
        lines.insert(0, len(name) * '=')
        lines.insert(0, name)

    hits = 0
    for i, line in enumerate(lines.copy()):
        if line.endswith('\\'):
            lines[i - hits] += lines.pop(i + 1 - hits)
            hits += 1
def auto_change_docstring ( app , what , name , obj , options , lines ) : if what == 'module' and name . startswith ( 'pylatex' ) : lines . insert ( 0 , len ( name ) * '=' ) lines . insert ( 0 , name ) hits = 0 for i , line in enumerate ( lines . copy ( ) ) : if line . endswith ( '\\' ) : lines [ i - hits ] += lines . pop ( i + 1 - hits ) hits += 1
r"""Make some automatic changes to docstrings.

    Things this function does are:

        - Add a title to module docstrings
        - Merge lines that end with a '\' with the next line.