MCPcopy Create free account
hub / github.com/ActiveState/code / sort_uniq_c

Function sort_uniq_c

recipes/Python/497011_Count_commits/recipe-497011.py:34–37  ·  view source on GitHub ↗

Duplicate unix's 'sort | uniq -c | sort -nr

(seq)

Source from the content-addressed store, hash-verified

32 return "\n".join(template % (x, y) for (x, y) in items)
33
34def sort_uniq_c(seq):
35 "Duplicate unix's 'sort | uniq -c | sort -nr'"
36 count_first = ((y,x) for (x,y) in histogram(seq).items())
37 return format2cols(sorted(count_first, reverse=True))
38
39if __name__ == "__main__":
40 print sort_uniq_c(authors(repos(work_path = '.')))

Callers 1

recipe-497011.pyFile · 0.85

Calls 4

format2colsFunction · 0.85
histogramFunction · 0.70
sortedFunction · 0.50
itemsMethod · 0.45

Tested by

no test coverage detected