code: def set_path(dicts, keys, v):
      
      for key in keys[:-1]:
          dicts = dicts.setdefault(key, dict())
      dicts = dicts.setdefault(keys[-1], list())
      dicts.append(v)
docs: Helper function for modifying nested dictionaries
  
      :param dicts: dict: the given dictionary
      :param keys: list str: path to added value
      :param v: str: value to be added
  
      Example:
          >>> d = dict()
  
          >>> set_path(d, ['a', 'b', 'c'],  'd')
  
          >>> d
          {'a': {'b': {'c': ['d']}}}
  
          In case of duplicate paths, the additional value will
          be added to the leaf node rather than simply replace it:
  
          >>> set_path(d, ['a', 'b', 'c'],  'e')
          
          >>> d
          {'a': {'b': {'c': ['d', 'e']}}}