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

Function format2cols

recipes/Python/497011_Count_commits/recipe-497011.py:29–32  ·  view source on GitHub ↗
(items)

Source from the content-addressed store, hash-verified

27 return result
28
29def format2cols(items):
30 max_width = max(len(str(x)) for (x,y) in items)
31 template = "%%%ds %%s" % max_width
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'"

Callers 1

sort_uniq_cFunction · 0.85

Calls 3

strFunction · 0.85
maxFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected