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

Function _make_labels_map

Lib/dis.py:856–869  ·  view source on GitHub ↗
(original_code, exception_entries=())

Source from the content-addressed store, hash-verified

854
855
856def _make_labels_map(original_code, exception_entries=()):
857 jump_targets = set(findlabels(original_code))
858 labels = set(jump_targets)
859 for start, end, target, _, _ in exception_entries:
860 labels.add(start)
861 labels.add(end)
862 labels.add(target)
863 labels = sorted(labels)
864 labels_map = {offset: i+1 for (i, offset) in enumerate(sorted(labels))}
865 for e in exception_entries:
866 e.start_label = labels_map[e.start]
867 e.end_label = labels_map[e.end]
868 e.target_label = labels_map[e.target]
869 return labels_map
870
871_NO_LINENO = ' --'
872

Callers 5

disFunction · 0.85
get_instructionsFunction · 0.85
disassembleFunction · 0.85
__iter__Method · 0.85
disMethod · 0.85

Calls 4

setFunction · 0.85
findlabelsFunction · 0.85
enumerateFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…