def _dict_path(d, *steps):
    """Traverses throuth a dict of dicts.
    Returns always a list. If the object to return is not a list,
    it's encapsulated in one.
    If any of the path steps does not exist, an empty list is returned.
    """
    x = d
    for key in steps:
        try:
            x = x[key]
        except __HOLE__:
            return []
    if not isinstance(x, list):
        x = [x]
    return x
dataset/ETHPy150Open machinalis/iepy/iepy/preprocess/stanford_preprocess.py/_dict_path