def treeify(seq):
 ret = {}
 for path in seq:
  cur = ret
  for node in path:
   cur = cur.setdefault(node, {})
 return ret

def treeify ( seq ) : ret = { } for path in seq : cur = ret for node in path : cur = cur . setdefault ( node , { } ) return ret
resolve message dependencies URL .