MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / count_most_common

Function count_most_common

common/wrapper.py:42–48  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

40
41def get_most_voted_values(values_list, mode):
42 def count_most_common(values):
43 count = Counter(values)
44 most_common = count.most_common()
45 max_votes = most_common[0][1]
46 most_common_candidates = [i[0] for i in most_common if i[1] == max_votes]
47 selected_candidate = random.choice(most_common_candidates)
48 return selected_candidate, dict(count)
49
50 count_results = []
51 vote_stats = []

Callers 1

get_most_voted_valuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected