import six


def _fetch_obj(node, subnodes):
    """Walk through nested dictionaries recursively,
    retrieve the object at the requested location.
    """
    assert isinstance(node, dict)
    assert isinstance(subnodes, list)
    assert len(subnodes) > 0
    assert isinstance(subnodes[0], six.string_types)
    if len(subnodes) == 1:
        if subnodes[0] == '':
            return node
        else:
            return node[subnodes[0]]
    else:
        return _fetch_obj(node[subnodes[0]], subnodes[1:])