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

Function normalize_location

Lib/profiling/sampling/collector.py:19–30  ·  view source on GitHub ↗

Normalize location to a 4-tuple format. Args: location: tuple (lineno, end_lineno, col_offset, end_col_offset) or None Returns: tuple: (lineno, end_lineno, col_offset, end_col_offset)

(location)

Source from the content-addressed store, hash-verified

17
18
19def normalize_location(location):
20 """Normalize location to a 4-tuple format.
21
22 Args:
23 location: tuple (lineno, end_lineno, col_offset, end_col_offset) or None
24
25 Returns:
26 tuple: (lineno, end_lineno, col_offset, end_col_offset)
27 """
28 if location is None:
29 return DEFAULT_LOCATION
30 return location
31
32
33def extract_lineno(location):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…