def split_string(mystring, sep, keep_sep=True):
    """Splits a string, with an option for keeping the separator in

    >>> split_string('this-is-a-test', '-')
    ['this-', 'is-', 'a-', 'test']
    >>> split_string('this-is-a-test', '-', keep_sep=False)
    ['this', 'is', 'a', 'test']

    Parameters
    ----------
    mystring : str
        The string to split
    sep : str
        The separator to split at
    keep_sep : bool, optional
        Whether to keep the separator, by default True

    Returns
    -------
    list
        The parts of the string
    """
    if keep_sep == False:
        keep_sep = ''
    elif keep_sep == True:
        keep_sep = sep
    items = mystring.split(sep)
    for i in range(len(items) - 1):
        items[i] += keep_sep
    return items