def divider(name=None, start='# ', end=' #', char='-', len=60):
    """
    Creates a formatted section with given length padded with given chars

    Parameters
    ----------
    name : str or None
        name of the section
    start : str
    end : str
    char: str
    len: int

    Returns
    -------
    str
        formatted string

    """
    fmt = '%s{:%s^%ds}%s' % (start, char, len, end)
    if name:
        return fmt.format(' %s ' % name)
    return fmt.format('')