def dictify(entries):
 result = {}
 for entry in entries:
  result[entry.path] = entry.weight
 return result

def dictify ( entries ) : result = { } for entry in entries : result [ entry . path ] = entry . weight return result
converts a list of entries into a dictionary where key = path value = weight .