def to_kwargs_str(in_dict):
    """Transforms a dictionary into a string that can be transformed back
    via get_kwargs. All values need to be lists.

    Parameters
    ----------
    in_dict : dictionary

    Returns
    -------
    str
        Keys and values are separated by colon+space ": " .
        List items are separated by spaces " " .
        Key-value pairs are separated by semicolons ";" .
        Example: 
        input: {key1: [value1, value2, value3], key2: [value]}
        output: "key1: value1 value2 value3; key2: value"
    """
    out = ''
    for key, val in in_dict.items():
        out += f'{key}:'

        assert isinstance(
            val, list), f'input value for {key} needs to be a list'
        for v in val:
            out += f' {v}'

        out += ';'

    return out