MCPcopy Index your code
hub / github.com/python/cpython / decode_edge

Function decode_edge

Tools/unicode/dawg.py:427–437  ·  view source on GitHub ↗
(packed, edgeindex, prev_child_offset, offset)

Source from the content-addressed store, hash-verified

425 return node_count, final, node
426
427def decode_edge(packed, edgeindex, prev_child_offset, offset):
428 x, offset = decode_varint_unsigned(packed, offset)
429 if x == 0 and edgeindex == 0:
430 raise KeyError # trying to decode past a final node
431 child_offset_difference, len1, last_edge = number_split_bits(x, 2)
432 child_offset = prev_child_offset + child_offset_difference
433 if len1:
434 size = 1
435 else:
436 size, offset = decode_varint_unsigned(packed, offset)
437 return child_offset, last_edge, size, offset
438
439def _match_edge(packed, s, size, node_offset, stringpos):
440 if size > 1 and stringpos + size > len(s):

Callers 2

_lookupFunction · 0.85
_inverse_lookupFunction · 0.85

Calls 2

decode_varint_unsignedFunction · 0.85
number_split_bitsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…