def data_extend(data, key, values):
    """Appends all values in a list under ``key`` in the dictionary ``data``."""
    assert isinstance(data, dict)
    assert isinstance(key, str)
    assert isinstance(values, (list, tuple))
    lst = data.get(key, [])
    lst.extend(values)
    if lst:
        data[key] = lst
