def ensure_list(value):
    return value if isinstance(value, list) else [value]
Wrap value in list if it is not one.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/config_validation.py/ensure_list