def _extract(d, k, default=_NoDefault):
    """Get an item from a dictionary, and remove it from the dictionary."""
    try:
        retval = d[k]
    except __HOLE__:
        if default is _NoDefault:
            raise
        return default
    del d[k]
    return retval

# Generic cipher test case
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Cipher/common.py/_extract