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

Function consumer

Lib/_pylong.py:706–722  ·  view source on GitHub ↗
(w, limit, need_hi)

Source from the content-addressed store, hash-verified

704# minute, because it tries millions of cases.
705if 0:
706 def consumer(w, limit, need_hi):
707 seen = set()
708 need = set()
709 def inner(w):
710 if w <= limit:
711 return
712 if w in seen:
713 return
714 seen.add(w)
715 lo = w >> 1
716 hi = w - lo
717 need.add(hi if need_hi else lo)
718 inner(lo)
719 inner(hi)
720 inner(w)
721 exp = compute_powers(w, 1, limit, need_hi=need_hi)
722 assert exp.keys() == need
723
724 from itertools import chain
725 for need_hi in (False, True):

Callers 5

_pylong.pyFile · 0.85
test_cancelled_wakeupMethod · 0.85

Calls 4

setFunction · 0.85
compute_powersFunction · 0.85
innerFunction · 0.70
keysMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…