MCPcopy Index your code
hub / github.com/python/mypy / parse_gray_color

Function parse_gray_color

mypy/util.py:590–595  ·  view source on GitHub ↗

Reproduce a gray color in ANSI escape sequence

(cup: bytes)

Source from the content-addressed store, hash-verified

588
589
590def parse_gray_color(cup: bytes) -> str:
591 """Reproduce a gray color in ANSI escape sequence"""
592 assert sys.platform != "win32", "curses is not available on Windows"
593 set_color = "".join([cup[:-1].decode(), "m"])
594 gray = curses.tparm(set_color.encode("utf-8"), 1, 9).decode()
595 return gray
596
597
598def should_force_color() -> bool:

Callers 1

Calls 3

encodeMethod · 0.80
joinMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…