/opt/alt/python27/lib64/python2.7/lib-dynload
NameSizeModeActions
arraymodule.so424960755editdlrm
audioop.so244880755editdlrm
binascii.so210080755editdlrm
bz2.so370080755editdlrm
cmathmodule.so461520755editdlrm
cPickle.so772960755editdlrm
cStringIO.so192800755editdlrm
datetime.so827920755editdlrm
dbm.so120720755editdlrm
dlmodule.so91920755editdlrm
fcntlmodule.so146960755editdlrm
future_builtins.so81760755editdlrm
gdbmmodule.so167200755editdlrm
grpmodule.so94960755editdlrm
imageop.so141200755editdlrm
itertoolsmodule.so608800755editdlrm
linuxaudiodev.so130080755editdlrm
math.so344960755editdlrm
mmapmodule.so218000755editdlrm
nismodule.so122000755editdlrm
operator.so425120755editdlrm
ossaudiodev.so260320755editdlrm
parsermodule.so496320755editdlrm
pyexpat.so2083600755editdlrm
Python-2.7.18-py2.7.egg-info15250644editdlrm
readline.so248080755editdlrm
resource.so116400755editdlrm
selectmodule.so244640755editdlrm
spwdmodule.so90640755editdlrm
stropmodule.so253840755editdlrm
syslog.so88960755editdlrm
termios.so251920755editdlrm
timemodule.so219280755editdlrm
timingmodule.so57680755editdlrm
unicodedata.so6918560755editdlrm
xxsubtype.so90160755editdlrm
zlibmodule.so251920755editdlrm
_bisectmodule.so98720755editdlrm
_bsddb.so1694000755editdlrm
_codecs_cn.so1465680755editdlrm
_codecs_hk.so1545360755editdlrm
_codecs_iso2022.so212000755editdlrm
_codecs_jp.so2616400755editdlrm
_codecs_kr.so1341520755editdlrm
_codecs_tw.so1081040755editdlrm
_collectionsmodule.so323680755editdlrm
_cryptmodule.so50960755editdlrm
_csv.so298640755editdlrm
_ctypes.so1257520755editdlrm
_curses.so788480755editdlrm
_curses_panel.so130960755editdlrm
_elementtree.so508960755editdlrm
_functoolsmodule.so128320755editdlrm
_hashlib.so217680755editdlrm
_heapq.so223680755editdlrm
_hotshot.so274160755editdlrm
_io.so1551200755editdlrm
_json.so382800755editdlrm
_localemodule.so216080755editdlrm
_lsprof.so171600755editdlrm
_md5module.so140960755editdlrm
_multibytecodecmodule.so315040755editdlrm
_multiprocessing.so299680755editdlrm
_randommodule.so129040755editdlrm
_sha256module.so208640755editdlrm
_sha512module.so249600755editdlrm
_shamodule.so137760755editdlrm
_socketmodule.so826320755editdlrm
_sqlite3.so818400755editdlrm
_ssl.so953120755editdlrm
_struct.so379360755editdlrm
Edit: /opt/alt/python27/lib64/python2.7/lib-dynload/_heapq.so (22368B)
ELF> @P@8@B [A\fH=" UHtHc$ HtH=" @ÐSH% H5@ H=1A%HHt%H=) qHH5^H[fD[fffff.H\$Hl$HHH5A HHt[Hu4HHLt )‰H\$Hl$HHHHl$H\$1H H=HHA HuAWAVAUATUSHH8Ht$LI9HT$HGLl$HIHIHD$(HLH?LHH9HD$|N@L,HCN4(JIHSJ HHHHteHSIL4H;l$}sO4$InIM9~HCJ L,HL$ H4J<|LDl$ IDrfHSJHCJ}7HCMMeIJ4N4`uH[]A\A]A^A_@H1[]A\A]A^A_H1 H5H8H[]A\A]A^A_H H5HH8fAWAVAUATUHSHHLI9LIHH?LHH9}>Ot-MfIM9>HSI9JJH0HHCJ4M|LHHH[]A\A]A^A_pHCJ4JH8~֐UHSHHFtSHFHH?HHHHt HyH HH[]H1[]H` H5H81ffff.H\$Hl$HLd$Ll$H8HL$H51H7u#1HHl$ H\$Ld$(Ll$0H8DH|$FHIt1HHH$HE1H$IL9LHHHHt#HEHHHEuHEHP0fDHEHHHEuHEHP0DIEHHIECHHHHHHCH1P0fD#HuHVtHtIEHHIEIELP0H{tHH?HHf.HH4HyfDHCL L9HHUHLJuHEHHHEuHEHP0HCH8H(HHHHt&1HuIELP0HGP0SHH5^1HLD$Ipt\HD$HPtZHxH@1HH$HHD$H$H@HH|$|t?HH[fD1HH[DH! H51H8fDHHHHuHCH1P0H H5:1H8xfffff.SHH5j1HLD$Ipt4HD$HPHx'H$HH$HH[f1HH[DH@H4$H8PtۅtHD$HxtpH@1HH$HHD$H$H@HH|$0uHHHHuHCH1P0pH H5J1H8hPH H5 1H8K3fffff.HHH5CLD$1IAtCH|$HGu#HL H5H81HfDH4$u 1HH|$1HWH4tH HfH\$Hl$HLd$HHFLfMt`HCIt$1LHH,HEItHC1HL H(Lt_HH$Hl$Ld$HfHi H51H8fDH9 H51H8fDI$1HHI$uID$LP0UHSHH HtH HHHuH[ÐHH_heapq__about____lt__index out of rangenO:nsmallestheap argument must be a listnO:nlargestheapreplaceheappushpopheappushheappopheapifylist changed size during iteration;l  (H((0h88hzRx RAD K A$<XN J H V E LdBBB B(A0A8Gp( 8A0A(B BBBE $h[@w F |BBB E(A0D8G@r 8A0A(B BBBE D 8C0A(B BBBH Z 8F0A(B BBBA d\XBBB B(A0D8GPg 8G0A(B BBBE I 8A0A(B BBBA 4ADD L AAI D CAA $Hx[@w F ,$AZ e AG F DF ,Tp"AZ A AC F DF $pD U G T D $MI p J (0  (o  2  @ o ooo00   . > N ^ n ~ 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 a 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! :-) heappush(heap, item) -> None. Push item onto heap, maintaining the heap invariant.heappushpop(heap, item) -> value. 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.heapreplace(heap, item) -> value. 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 0J K 0K  M M f@N _heapq.so.debug-N.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@@^  h c n Xt((z288lhh0 00 0 0 0(0 (000 001 182 22 2 O OOO