def popget(d, key, default=None):
    """
    Get the key from the dict, returning the default if not found.

    Parameters
    ----------
    d : dict
        Dictionary to get key from.
    key : object
        Key to get from the dictionary.
    default : object
        Default to return if key is not found in dictionary.

    Returns
    -------
    object

    Examples
    ---------
    >>> d = {'ABC': 5.0}
    >>> popget(d, 'ZPF', 1.0) == 1.0
    True
    >>> popget(d, 'ABC', 1.0) == 5.0
    True

    """
    try:
        return d.pop(key)
    except KeyError:
        return default