MCPcopy Create free account
hub / github.com/dask/dask / _colorize

Function _colorize

dask/base.py:1142–1156  ·  view source on GitHub ↗

Convert (r, g, b) triple to "#RRGGBB" string For use with ``visualize(color=...)`` Examples -------- >>> _colorize((255, 255, 255)) '#FFFFFF' >>> _colorize((0, 32, 128)) '#002080'

(t)

Source from the content-addressed store, hash-verified

1140
1141
1142def _colorize(t):
1143 """Convert (r, g, b) triple to "#RRGGBB" string
1144
1145 For use with ``visualize(color=...)``
1146
1147 Examples
1148 --------
1149 >>> _colorize((255, 255, 255))
1150 '#FFFFFF'
1151 >>> _colorize((0, 32, 128))
1152 '#002080'
1153 """
1154 t = t[:3]
1155 i = sum(v << 8 * i for i, v in enumerate(reversed(t)))
1156 return f"#{i:>06X}"
1157
1158
1159named_schedulers: dict[str, SchedulerGetCallable] = {

Callers 1

visualize_dskFunction · 0.85

Calls 1

sumFunction · 0.50

Tested by

no test coverage detected