def to_list(raw: str) -> list:
    """If the `raw` string is formatted like a list, it is converted to a list,
    otherwise returns a list with `raw` as the single item.
    """
    raw = raw.strip()
    retval = []

    if raw[0] == '[' and raw[-1] == ']':
        for item in raw[1:-1].split(','):
            retval += [item.strip().strip("'\"")]
    else:
        retval += [raw]

    return retval