MCPcopy Index your code
hub / github.com/python/cpython / get_colors

Function get_colors

Lib/_colorize.py:431–437  ·  view source on GitHub ↗
(
    colorize: bool = False, *, file: IO[str] | IO[bytes] | None = None
)

Source from the content-addressed store, hash-verified

429
430
431def get_colors(
432 colorize: bool = False, *, file: IO[str] | IO[bytes] | None = None
433) -> ANSIColors:
434 if colorize or can_colorize(file=file):
435 return ANSIColors()
436 else:
437 return NoColors
438
439
440def decolor(text: str) -> str:

Callers 13

formatweekMethod · 0.90
get_stateMethod · 0.90
display_resultMethod · 0.90
display_summaryMethod · 0.90
_format_failedMethod · 0.90
__str__Method · 0.90
_runtest_env_changed_excFunction · 0.90
run_single_testFunction · 0.90
rerun_failed_testsMethod · 0.90
__init__Method · 0.90
benchmarkFunction · 0.90
print_benchmark_resultsFunction · 0.90

Calls 2

can_colorizeFunction · 0.70
ANSIColorsClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…