def assert_has_keys(dct, required=[], optional=[]):
    for k in required:
        try:
            assert k in dct
        except __HOLE__:
            extra_keys = set(dct.keys()).difference(set(required + optional))
            raise AssertionError("found unexpected keys: %s" %
                                 list(extra_keys))
dataset/ETHPy150Open openstack/python-rackclient/rackclient/openstack/common/apiclient/fake_client.py/assert_has_keys