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

Method _set_color

Lib/argparse.py:198–206  ·  view source on GitHub ↗
(self, color, *, file=None)

Source from the content-addressed store, hash-verified

196 self._set_color(False)
197
198 def _set_color(self, color, *, file=None):
199 from _colorize import can_colorize, decolor, get_theme
200
201 if color and can_colorize(file=file):
202 self._theme = get_theme(force_color=True).argparse
203 self._decolor = decolor
204 else:
205 self._theme = get_theme(force_no_color=True).argparse
206 self._decolor = _identity
207
208 # ===============================
209 # Section and indentation methods

Callers 3

__init__Method · 0.95
add_subparsersMethod · 0.80
_get_formatterMethod · 0.80

Calls 2

can_colorizeFunction · 0.90
get_themeFunction · 0.90

Tested by

no test coverage detected