def walk_dict(d, path):
    """Walks a dict given a path of keys.

    For example, if we have a dict like this::

        d = {
            'a': {
                'B': {
                    1: ['hello', 'world'],
                    2: ['hello', 'again'],
                }
            }
        }

    Then ``walk_dict(d, ['a', 'B', 1])`` would return
    ``['hello', 'world']``.
    """
    if not path:
        return d
    return walk_dict(d[path[0]], path[1:])