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

Function adapt

Lib/encodings/punycode.py:91–103  ·  view source on GitHub ↗
(delta, first, numchars)

Source from the content-addressed store, hash-verified

89 j += 1
90
91def adapt(delta, first, numchars):
92 if first:
93 delta //= 700
94 else:
95 delta //= 2
96 delta += delta // numchars
97 # ((base - tmin) * tmax) // 2 == 455
98 divisions = 0
99 while delta > 455:
100 delta = delta // 35 # base - tmin
101 divisions += 36
102 bias = divisions + (36 * delta // (delta + 38))
103 return bias
104
105
106def generate_integers(baselen, deltas):

Callers 2

generate_integersFunction · 0.85
insertion_sortFunction · 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…