def _append_docstring(func, supplement, insert_in="Parameters", at_end=True):
    """
    Local helper to automate text insertions in docstrings
    
    Parameters
    ----------
    func : callable
        Typically a (wrapped) Syncopy metafunction such as :func:`~syncopy.freqanalysis`
    supplement : str
        Text entry to be added to `func`'s docstring. Has to be already formatted 
        correctly for its intended destination section, specifically respecting 
        indentation and line-breaks (e.g., following double-indentation of variable 
        descriptions in the "Parameters" section)
    insert_in : str
        Name of section `supplement` should be inserted into. Available options 
        are `"Header"` (part of the docstring before "Parameters"), `"Parameters"`,
        `"Returns"`, `"Notes"` and `"See also"`. Note that the section specified
        by `insert_in` has to already exist in `func`'s docstring, otherwise 
        `supplement` is *not* inserted. 
    at_end : bool
        If `True`, `supplement` is appended at the end of the section specified 
        by `insert_in`. If `False`, `supplement` is included at the beginning of
        the respective section. 
    
    Returns
    -------
    newDocString : str
        A copy of `func`'s docstring with `supplement` inserted at the location
        specified by `insert_in` and `at_end`. 
        
    Notes
    -----
    This routine is a local auxiliary method that is purely intended for internal
    use. Thus, no error checking is performed. 
        
    See also
    --------
    _append_signature : extend a function's signature
    """
    
    if func.__doc__ is None:
        return
    
    # "Header" insertions always work (an empty docstring is enough to do this). 
    # Otherwise ensure the provided `insert_in` section already exists, i.e., 
    # partitioned `sectionHeading` == queried `sectionTitle`
    if insert_in == "Header":
        sectionText, sectionDivider, rest = func.__doc__.partition("Parameters\n")
        textBefore = ""
        sectionHeading = ""
    else:
        sectionTitle = insert_in + "\n"
        textBefore, sectionHeading, textAfter = func.__doc__.partition(sectionTitle)
        if sectionHeading != sectionTitle:  # `insert_in` was not found in docstring
            return func.__doc__
        sectionText, sectionDivider, rest = textAfter.partition("\n\n")
    sectionText = sectionText.splitlines(keepends=True)
    
    if at_end:
        insertAtLine = -1
        while sectionText[insertAtLine].isspace():
            insertAtLine -= 1
        insertAtLine = min(-1, insertAtLine + 1)
    else:
        insertAtLine = 1
    sectionText = "".join(sectionText[:insertAtLine]) +\
                  supplement +\
                  "".join(sectionText[insertAtLine:])

    newDocString = textBefore +\
                   sectionHeading +\
                   sectionText +\
                   sectionDivider +\
                   rest

    return newDocString