MCPcopy Index your code
hub / github.com/RustPython/RustPython / normalize

Function normalize

Lib/traceback.py:851–853  ·  view source on GitHub ↗

Get character index given byte offset

(lineno, offset)

Source from the content-addressed store, hash-verified

849 lines = segment.splitlines()
850
851 def normalize(lineno, offset):
852 """Get character index given byte offset"""
853 return _byte_offset_to_character_offset(lines[lineno], offset)
854
855 def next_valid_char(lineno, col):
856 """Gets the next valid character index in `lines`, if

Callers 2

setup_positionsFunction · 0.70

Calls 1

Tested by

no test coverage detected