コード例 #1
0
def most_common_test():
	nc = NormalizedCounter({"a": 8, "b": 4, "c": 2})

	most_common = nc.most_common()

	assert most_common == [
		("a", 8./14),
		("b", 4./14),
		("c", 2./14)
	]
コード例 #2
0
def most_common_test():
    nc = NormalizedCounter({"a": 8, "b": 4, "c": 2})

    most_common = nc.most_common()

    assert most_common == [("a", 8. / 14), ("b", 4. / 14), ("c", 2. / 14)]