def consume(info, key):
    """Consumes key from dict

    Arguments:

    * `info` -- dict
    * `key` -- key

    Doctest:

    .. doctest::

        >>> info = {'abc': 1, 'def': 2}
        >>> consume(info, 'abc')
        1
        >>> info
        {'def': 2}
        >>> consume(info, 'abc') is None
        True
    """
    if key not in info:
        return None
    result = info[key]
    del info[key]
    return result