MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / rle_append_beginning_modify

Function rle_append_beginning_modify

mitmproxy/tools/console/common.py:227–242  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

225
226# Work around https://github.com/urwid/urwid/pull/330
227def 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
245def colorize_host(host: str):

Callers 1

colorize_hostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…