should_colorize#
- scikitplot.cleanprompt.should_colorize(stream=None, color=None)[source]#
Decide whether to emit terminal colour.
- Parameters:
- streamfile-like, optional
Destination. Defaults to
sys.stdout.- colorbool, optional
Explicit override.
TrueorFalsedecides immediately.
- Returns:
- bool
Whether colour should be emitted.
- Parameters:
- Return type:
Notes
Developer notes.
NO_COLORis honoured whenever it is set to any value, per the convention at <https://no-color.org>. A stream withoutisatty— a pipe, a file, a captured buffer in a test — is treated as not a terminal.Examples
>>> should_colorize(color=False) False