def dunder_get(_dict, key):
    """Returns value for a specified dunderkey

    A "dunderkey" is just a fieldname that may or may not contain
    double underscores (dunderscores!) for referrencing nested keys in
    a dict. eg::

         >>> data = {'a': {'b': 1}}
         >>> nesget(data, 'a__b')
         1

    key 'b' can be referrenced as 'a__b'

    :param _dict : (dict)
    :param key   : (str) that represents a first level or nested key in the dict
    :rtype       : (mixed) value corresponding to the key

    """
    parts = key.split('__', 1)
    try:
        result = _dict[parts[0]]
    except __HOLE__:
        return None
    else:
        return result if len(parts) == 1 else dunder_get(result, parts[1])
dataset/ETHPy150Open naiquevin/lookupy/lookupy/dunderkey.py/dunder_get