MCPcopy Index your code
hub / github.com/RustPython/RustPython / _set_color

Method _set_color

Lib/argparse.py:195–203  ·  view source on GitHub ↗
(self, color)

Source from the content-addressed store, hash-verified

193 self._long_break_matcher = _re.compile(r'\n\n\n+')
194
195 def _set_color(self, color):
196 from _colorize import can_colorize, decolor, get_theme
197
198 if color and can_colorize():
199 self._theme = get_theme(force_color=True).argparse
200 self._decolor = decolor
201 else:
202 self._theme = get_theme(force_no_color=True).argparse
203 self._decolor = lambda text: text
204
205 # ===============================
206 # 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