def set_settings(settings, **kwargs):
    """
    Apply keyword values to PVs in a dictionary if available
    :param settings: dictionary of process variables to set
    :param kwargs: key value pairs for the process variables, keys with value None are ignored if key points to a tuple
    of process variables, then the value should be a list or tuple of values to put to each.
    :return: list of keys actually set
    """
    changed = []
    for key, value in kwargs.items():
        if key in settings and value is not None:
            if isinstance(settings[key], tuple):
                for p, v in zip(settings[key], value):
                    p.put(v, wait=True)
            else:
                settings[key].put(kwargs[key], wait=True)
            changed.append(key)
    return changed