def get_dict_recursive(dct, key):
    """
    Helper function to get the value corresponding to path/to/key from a nested
    dict.
    """
    if '/' in key:
        base, newkey = key.split('/', maxsplit=1)
        return get_dict_recursive(dct[base], newkey)
    else:
        try:
            ret = dct[key]
        except KeyError:
            # int keys would have been converted to strings
            ret = dct[int(key)]
        return ret