def ensure_collection(value, collection_type):
    """Ensures that `value` is a `collection_type` collection.

    :param value: A string or a collection
    :param collection_type: A collection type, e.g. `set` or `list`
    :return: a `collection_type` object containing the value
    """
    return collection_type((value,)) if value and isinstance(value, str) else collection_type(value)