Append (a, r) (unpacked from *a_r*) to BEGINNING of rle. Merge with first run when possible MODIFIES rle parameter contents. Returns None.
(rle, a_r)
| 225 | |
| 226 | # Work around https://github.com/urwid/urwid/pull/330 |
| 227 | def rle_append_beginning_modify(rle, a_r): |
| 228 | """ |
| 229 | Append (a, r) (unpacked from *a_r*) to BEGINNING of rle. |
| 230 | Merge with first run when possible |
| 231 | |
| 232 | MODIFIES rle parameter contents. Returns None. |
| 233 | """ |
| 234 | a, r = a_r |
| 235 | if not rle: |
| 236 | rle[:] = [(a, r)] |
| 237 | else: |
| 238 | al, run = rle[0] |
| 239 | if a == al: |
| 240 | rle[0] = (a, run + r) |
| 241 | else: |
| 242 | rle[0:0] = [(a, r)] |
| 243 | |
| 244 | |
| 245 | def colorize_host(host: str): |
no outgoing calls
no test coverage detected
searching dependent graphs…