MCPcopy Index your code
hub / github.com/numpy/numpy / isolate_expression

Function isolate_expression

numpy/_build_utils/tempita/_tempita.py:1034–1047  ·  view source on GitHub ↗
(string, start_pos, end_pos)

Source from the content-addressed store, hash-verified

1032
1033
1034def isolate_expression(string, start_pos, end_pos):
1035 srow, scol = start_pos
1036 srow -= 1
1037 erow, ecol = end_pos
1038 erow -= 1
1039 lines = string.splitlines(True)
1040 if srow == erow:
1041 return lines[srow][scol:ecol]
1042 parts = [lines[srow][scol:]]
1043 parts.extend(lines[srow + 1:erow])
1044 if erow < len(lines):
1045 # It'll sometimes give (end_row_past_finish, 0)
1046 parts.append(lines[erow][:ecol])
1047 return "".join(parts)
1048
1049
1050_fill_command_usage = """\

Callers 1

parse_signatureFunction · 0.85

Calls 2

splitlinesMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…