python 计算权重的代码

看不太懂 大神能帮忙解释一下么
weight_dict = {}
for k,values in dictionary_dict.items():
key = iext_dct.get(k)
tmp = []
for x in values:
w = word_count_dict.get(x,0)
tmp.append(w)
print(tmp)
print(sum(tmp))
print(sum(tmp)/sum(count_list))
weight_dict[key] = sum(tmp)/sum(count_list)