MCPcopy Create free account
hub / github.com/ActiveState/code / pack

Method pack

recipes/Python/578922_bitfield_rev2/recipe-578922.py:66–73  ·  view source on GitHub ↗

return bf with the given values in dec [n1, n2, n3...] packed

(self,pack)

Source from the content-addressed store, hash-verified

64 return r
65
66 def pack(self,pack):
67 "return bf with the given values in dec [n1, n2, n3...] packed"
68 r=bf(); ss=0;pack.reverse()
69 for i in pack:
70 l1=len(bin(i))-2
71 r.__setslice__(ss,ss+l1,i)
72 ss +=l1
73 return r
74
75
76if __name__ == "__main__":

Callers 15

mySetLongFunction · 0.45
mySetStringFunction · 0.45
mainFunction · 0.45
initialiseFunction · 0.45
__init__Method · 0.45
numToDottedQuadFunction · 0.45
build_graphFunction · 0.45
dbfwriterFunction · 0.45
testFunction · 0.45
recipe-578922.pyFile · 0.45
build_graphFunction · 0.45
BuildFunction · 0.45

Calls 3

bfClass · 0.70
reverseMethod · 0.45
__setslice__Method · 0.45

Tested by

no test coverage detected