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)

    key = parts[0]

    try:
        result = _dict[key]
    except KeyError:
        return None
    except TypeError:
        try:
            result = getattr(_dict, key)
        except AttributeError:
            return None

    return result if len(parts) == 1 else dunder_get(result, parts[1])