def iterate(source, *keys):
    """Iterate a nested dict based on list of keys.

    :param source: nested dict
    :param keys: list of keys
    :returns: value
    """
    d = source
    for k in keys:
        if type(d) is list:
            d = d[int(k)]
        elif k not in d:
            d[k] = {}
        else:
            d = d[k]
    return d