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

Function generate_integers

Lib/encodings/punycode.py:106–115  ·  view source on GitHub ↗

3.4 Bias adaptation

(baselen, deltas)

Source from the content-addressed store, hash-verified

104
105
106def generate_integers(baselen, deltas):
107 """3.4 Bias adaptation"""
108 # Punycode parameters: initial bias = 72, damp = 700, skew = 38
109 result = bytearray()
110 bias = 72
111 for points, delta in enumerate(deltas):
112 s = generate_generalized_integer(delta, bias)
113 result.extend(s)
114 bias = adapt(delta, points==0, baselen+points+1)
115 return result.take_bytes()
116
117def punycode_encode(text):
118 base, extended = segregate(text)

Callers 1

punycode_encodeFunction · 0.85

Calls 5

enumerateFunction · 0.85
adaptFunction · 0.85
take_bytesMethod · 0.80
extendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…