/usr/lib64/python2.6/lib-dynload
NameSizeModeActions
arraymodule.so414080555editdlrm
audioop.so240400555editdlrm
binascii.so209760555editdlrm
bz2.so356960755editdlrm
cmathmodule.so421840555editdlrm
cPickle.so756640555editdlrm
cStringIO.so192480555editdlrm
datetime.so812560755editdlrm
dbm.so120400755editdlrm
dlmodule.so90320555editdlrm
fcntlmodule.so146320555editdlrm
future_builtins.so76320755editdlrm
gdbmmodule.so166560555editdlrm
grpmodule.so90800555editdlrm
imageop.so140880555editdlrm
itertoolsmodule.so548960555editdlrm
linuxaudiodev.so129440555editdlrm
mathmodule.so264080555editdlrm
mmapmodule.so216400555editdlrm
nismodule.so121680555editdlrm
operator.so386080555editdlrm
ossaudiodev.so259680755editdlrm
parsermodule.so464080555editdlrm
pyexpat.so502800755editdlrm
Python-2.6.6-py2.6.egg-info15240644editdlrm
readline.so240080555editdlrm
resource.so116080555editdlrm
selectmodule.so244320555editdlrm
spwdmodule.so90320555editdlrm
stropmodule.so252880555editdlrm
syslog.so77440755editdlrm
termios.so251600555editdlrm
timemodule.so203280555editdlrm
timingmodule.so57360555editdlrm
unicodedata.so5900000555editdlrm
xxsubtype.so89520555editdlrm
zlibmodule.so237840555editdlrm
_bisectmodule.so98720555editdlrm
_bsddb.so1231280555editdlrm
_bytesio.so178160755editdlrm
_codecs_cn.so1465680555editdlrm
_codecs_hk.so1545360555editdlrm
_codecs_iso2022.so211040555editdlrm
_codecs_jp.so2616080555editdlrm
_codecs_kr.so1330000555editdlrm
_codecs_tw.so1080080555editdlrm
_collectionsmodule.so281120555editdlrm
_cryptmodule.so50640555editdlrm
_csv.so295440555editdlrm
_ctypes.so1237360755editdlrm
_curses.so788160755editdlrm
_curses_panel.so130960755editdlrm
_elementtree.so423920755editdlrm
_fileio.so196560755editdlrm
_functoolsmodule.so122560555editdlrm
_hashlib.so154320755editdlrm
_heapq.so222720755editdlrm
_hotshot.so264560755editdlrm
_json.so122560755editdlrm
_localemodule.so216080555editdlrm
_lsprof.so171600755editdlrm
_multibytecodecmodule.so315040555editdlrm
_multiprocessing.so299360755editdlrm
_randommodule.so126800555editdlrm
_socketmodule.so607520555editdlrm
_sqlite3.so771040755editdlrm
_ssl.so341120555editdlrm
_struct.so378400555editdlrm
_tkinter.so523680555editdlrm
_weakref.so72080555editdlrm
Edit: /usr/lib64/python2.6/lib-dynload/_heapq.so (22272B)
ELF> @@P@8@## 00 0 @X 0000 00 $$Ptdh h h llQtdGNU f,IzZ| @  |CEqX x pqJ + R("\7Cb? RXO @O @O  x  __gmon_start___init_fini__cxa_finalize_Jv_RegisterClassesinit_heapqPy_InitModule4_64PyString_FromStringPyModule_AddObjectPyObject_HasAttrPyObject_RichCompareBoolPyExc_RuntimeErrorPyErr_SetStringPyExc_IndexErrorPyArg_ParseTuplePyObject_GetIterPyList_NewPyIter_NextPyList_AppendPyErr_OccurredPyList_Sort_Py_NoneStructPyExc_TypeErrorPyList_ReversePyArg_UnpackTuplePyList_SetSlicelibpython2.6.so.1.0libpthread.so.0libc.so.6_edata__bss_start_endGLIBC_2.2.5ui (0 (0 @N ! HN XN @J `N  hN `xN J N * N pN @K N  N `N K N 2 N PN @M N  N N M O O O M 1 1 1 1  1 1 2  2 (2 02 82 @2  H2  P2  X2  `2  h2 p2 x2 2 2 2 2 2 H/H5z& %|& @%z& h%r& h%j& h%b& h%Z& h%R& h%J& h%B& hp%:& h`%2& h P%*& h @%"& h 0%& h %& h % & h%& h%% hHH% HtHÐU=hB HATSubH=% t H=7# *H# L% # H=B L)HHH9s DHHB AHB H9rA [A\fH=" UHtHs$ HtH=" @ÐSH8% H5@ H=1A-HHt%H=* yHH5H[fD[fffff.H\$Hl$HHH5XA HHt[Hu4HHTt )‰H\$Hl$HHHHl$H\$1HH=WHH@ HuAWAVAUATUSHH8Ht$HGH9HD$HT$HGLl$HIHIHD$(HHD$H?HD$HH9HD$|UkL,HCN<N4(IHCJHHHHHCIN48H;l$O4$InIL9t$~HCJ L,HL$ JLfDIHHIDI$HHSH HHHHHSL$L9t$LHCLuLIN$N,I$LII$HHI$^IT$L$R0I$HHIMIWL$R0$=IHHIukIWL$R0$YHSHOt-MfIM9>HSI9JJH0HHCJ4M|LH(HH[]A\A]A^A_HCNJIHLHHT$HL$LD$rLD$I0HHI0HT$HL$tjH2HHH2t=t)MDL9{RHA H5H8H([]A\A]A^A_HrH׉D$HL$V0HL$D$IpLljD$V0HT$HL$D$H2HHH2vH H5H8Cfffff.UHSHHFtSHFHH?HHHH%t HyHc HH[]H1[]H  H5H81ffff.H\$Hl$HLd$Ll$H8HL$H51Hu#1HHl$ H\$Ld$(Ll$0H8DH|$HIt1OHHH$HE1H$IL9L7HHHHt#HEHHHEuHEHP0fDHEHHHEuHEHP0DIEHHIECHHHHHHCH1P0fDHuHtHAtIEHHIEIELP0H{tHH?HHf.HH4HyfDHCL LHHUHLuHEHHHEuHEHP0HCH8H(HHHHt&1H}uIELP0HGP0SHH51HLD$I(t\HD$HPtZHxH@1HH$HHD$H$H@HH|$t?HH[fD1HH[DH H51H8pfDHHHHuHCH1P0H H5z1H80fffff.SHH51H LL$LD$&t:HD$HPHx-HD$HH\$HH [fD1H H[DH@HHHHt$HHHHtytątHD$HxH@1HHD$HHD$HT$H@HH|$kkHHHHgHCH1P0GfDHSH߉D$R0D$pHI H5B1H8 H< H51H8fDHHH5CLD$1ItCH|$HGu#H H5H8]1HfDH4$'u 1HH|$1HWHtH HfH\$Hl$HLd$HHFLfMt`HCIt$1LHH,HE!ItHC1HL H(Lt_HH$Hl$Ld$HfH H51H8hfDH H51H8HfDI$1HHI$uID$LP0UHSHH HtH HHHuH[ÐH/H_heapq__about____lt__index out of rangenO:nsmallestheap argument must be a listnO:nlargestheapreplaceheappushpopheappushheappopheapifylist changed size during iteration;l xH8`HHxh0zRx RAD K A$<N J H V E dd@*BBB B(A0A8Gpt 8A0A(B BBBA V 8F0A(B BBBA $h[@w F |PBEB B(A0D8G`  8A0A(B BBBF D 8C0A(B BBBH Z 8F0A(B BBBA dt`BBB B(A0D8G`g 8G0A(B BBBE  8A0A(B BBBA 4ADD L AAI D CAA $x[@w F ,<HAZ e AG F DF ,ljAZ0E AG F DF $XD U G T D $MI p J (0  x o  2  ( oooo00   & 6 F V f v Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usage: heap = [] # creates an empty heap heappush(heap, item) # pushes a new item on the heap item = heappop(heap) # pops the smallest item from the heap item = heap[0] # smallest item on the heap without popping it heapify(x) # transforms list into a heap, in-place, in linear time item = heapreplace(heap, item) # pops and returns smallest item, and adds # new item; the heap size is unchanged Our API differs from textbook heap algorithms as follows: - We use 0-based indexing. This makes the relationship between the index for a node and the indexes for its children slightly less obvious, but is more suitable since Python uses 0-based indexing. - Our heappop() method returns the smallest item, not the largest. These two make it possible to view the heap as a regular Python list without surprises: heap[0] is the smallest item, and heap.sort() maintains the heap invariant! Heap queues [explanation by Franois Pinard] Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. The strange invariant above is meant to be an efficient memory representation for a tournament. The numbers below are `k', not a[k]: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'. In an usual binary tournament we see in sports, each cell is the winner over the two cells it tops, and we can trace the winner down the tree to see all opponents s/he had. However, in many computer applications of such tournaments, we do not need to trace the history of a winner. To be more memory efficient, when a winner is promoted, we try to replace it by something else at a lower level, and the rule becomes that a cell and the two cells it tops contain three different items, but the top cell "wins" over the two topped cells. If this heap invariant is protected at all time, index 0 is clearly the overall winner. The simplest algorithmic way to remove it and find the "next" winner is to move some loser (let's say cell 30 in the diagram above) into the 0 position, and then percolate this new 0 down the tree, exchanging values, until the invariant is re-established. This is clearly logarithmic on the total number of items in the tree. By iterating over all items, you get an O(n ln n) sort. A nice feature of this sort is that you can efficiently insert new items while the sort is going on, provided that the inserted items are not "better" than the last 0'th element you extracted. This is especially useful in simulation contexts, where the tree holds all incoming events, and the "win" condition means the smallest scheduled time. When an event schedule other events for execution, they are scheduled into the future, so they can easily go into the heap. So, a heap is a good structure for implementing schedulers (this is what I used for my MIDI sequencer :-). Various structures for implementing schedulers have been extensively studied, and heaps are good for this, as they are reasonably speedy, the speed is almost constant, and the worst case is not much different than the average case. However, there are other representations which are more efficient overall, yet the worst cases might be terrible. Heaps are also very useful in big disk sorts. You most probably all know that a big sort implies producing "runs" (which are pre-sorted sequences, which size is usually related to the amount of CPU memory), followed by a merging passes for these runs, which merging is often very cleverly organised[1]. It is very important that the initial sort produces the longest runs possible. Tournaments are a good way to that. If, using all the memory available to hold a tournament, you replace and percolate items that happen to fit the current run, you'll produce runs which are twice the size of the memory for random input, and much better for input fuzzily ordered. Moreover, if you output the 0'th item on disk and get an input which may not fit in the current tournament (because the value "wins" over the last output value), it cannot fit in the heap, so the size of the heap decreases. The freed memory could be cleverly reused immediately for progressively building a second heap, which grows at exactly the same rate the first heap is melting. When the first heap completely vanishes, you switch heaps and start a new run. Clever and quite effective! In a word, heaps are useful memory structures to know. I use them in a few applications, and I think it is good to keep a `heap' module around. :-) -------------------- [1] The disk balancing algorithms which are current, nowadays, are more annoying than clever, and this is a consequence of the seeking capabilities of the disks. On devices which cannot seek, like big tape drives, the story was quite different, and one had to be very clever to ensure (far in advance) that each tape movement will be the most effective possible (that is, will best participate at "progressing" the merge). Some tapes were even able to read backwards, and this was also used to avoid the rewinding time. Believe me, real good tape sorts were quite spectacular to watch! From all times, sorting has always been a Great Art! :-) Push item onto heap, maintaining the heap invariant.Push item on the heap, then pop and return the smallest item from the heap. The combined action runs more efficiently than heappush() followed by a separate call to heappop().Pop the smallest item off the heap, maintaining the heap invariant.Pop and return the current smallest value, and add the new item. This is more efficient than heappop() followed by heappush(), and can be more appropriate when using a fixed-size heap. Note that the value returned may be larger than item! That constrains reasonable uses of this routine unless written as part of a conditional replacement: if item > heap[0]: item = heapreplace(heap, item) Transform list into a heap, in-place, in O(len(heap)) time.Find the n largest elements in a dataset. Equivalent to: sorted(iterable, reverse=True)[:n] Find the n smallest elements in a dataset. Equivalent to: sorted(iterable)[:n] ! @J  `J * p@K `K 2 P@M M M _heapq.so.debug# .shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.data.rel.ro.dynamic.got.got.plt.data.bss.gnu_debuglink $o<( 08o>Eo T((^  hx x c n tz2h h l 0 00 0 0 0(0 (000 001 182 22 2 @O @O@OTO