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

Function selective_find

Lib/encodings/punycode.py:30–46  ·  view source on GitHub ↗

Return a pair (index, pos), indicating the next occurrence of char in str. index is the position of the character considering only ordinals up to and including char, and pos is the position in the full string. index/pos is the starting position in the full string.

(str, char, index, pos)

Source from the content-addressed store, hash-verified

28 return res
29
30def selective_find(str, char, index, pos):
31 """Return a pair (index, pos), indicating the next occurrence of
32 char in str. index is the position of the character considering
33 only ordinals up to and including char, and pos is the position in
34 the full string. index/pos is the starting position in the full
35 string."""
36
37 l = len(str)
38 while 1:
39 pos += 1
40 if pos == l:
41 return (-1, -1)
42 c = str[pos]
43 if c == char:
44 return index+1, pos
45 elif c < char:
46 index += 1
47
48def insertion_unsort(str, extended):
49 """3.2 Insertion unsort coding"""

Callers 1

insertion_unsortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…