def merge_valid_keys(params, valid_keys, extra):
    """
    Merge valid keys from extra into params dictionary and return
    dictionary with keys which have been merged.

    Note: params is modified in place.
    """
    merged = {}
    if not extra:
        return merged

    for key in valid_keys:
        if extra in key:
            params[key] = extra[key]
            merged[key] = extra[key]

    return merged
dataset/ETHPy150Open apache/libcloud/libcloud/utils/misc.py/merge_valid_keys/swapped operands of `in`