MCPcopy Create free account
hub / github.com/vercel/vercel / bar

Function bar

packages/python-analysis/scripts/profile-wasm.py:74–83  ·  view source on GitHub ↗

Render a horizontal bar of the given fractional width.

(fraction, width=20, color=CYAN)

Source from the content-addressed store, hash-verified

72
73
74def bar(fraction, width=20, color=CYAN):
75 """Render a horizontal bar of the given fractional width."""
76 full_blocks = int(fraction * width)
77 remainder = (fraction * width) - full_blocks
78 partial_idx = int(remainder * 8)
79 result = BAR_FULL * full_blocks
80 if full_blocks < width:
81 result += BAR_CHARS[partial_idx]
82 result += " " * (width - full_blocks - 1)
83 return f"{color}{result}{RESET}"
84
85
86def step(num, total, msg):

Callers 2

render_overviewFunction · 0.85
render_items_tableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected