def dict_contains_only(dct, allowed, allow_mpp=True):
    """Check whether a dictionary contains only allowed keys"""

    for key in dct.keys():
        if allow_mpp and key.startswith("mpp-"):
            continue
        if key in allowed:
            continue
        return False
    return True