/opt/alt/python33/lib64/python3.3/__pycache__
NameSizeModeActions
abc.cpython-33.pyc96150644editdlrm
abc.cpython-33.pyo95490644editdlrm
aifc.cpython-33.pyc361160644editdlrm
aifc.cpython-33.pyo361160644editdlrm
antigravity.cpython-33.pyc10690644editdlrm
antigravity.cpython-33.pyo10690644editdlrm
argparse.cpython-33.pyc940130644editdlrm
argparse.cpython-33.pyo938200644editdlrm
ast.cpython-33.pyc153870644editdlrm
ast.cpython-33.pyo153870644editdlrm
asynchat.cpython-33.pyc113410644editdlrm
asynchat.cpython-33.pyo113410644editdlrm
asyncore.cpython-33.pyc254730644editdlrm
asyncore.cpython-33.pyo254730644editdlrm
base64.cpython-33.pyc154590644editdlrm
base64.cpython-33.pyo151980644editdlrm
bdb.cpython-33.pyc260120644editdlrm
bdb.cpython-33.pyo260120644editdlrm
binhex.cpython-33.pyc191020644editdlrm
binhex.cpython-33.pyo191020644editdlrm
bisect.cpython-33.pyc33680644editdlrm
bisect.cpython-33.pyo33680644editdlrm
bz2.cpython-33.pyc192120644editdlrm
bz2.cpython-33.pyo192120644editdlrm
calendar.cpython-33.pyc387950644editdlrm
calendar.cpython-33.pyo387950644editdlrm
cgi.cpython-33.pyc369260644editdlrm
cgi.cpython-33.pyo369260644editdlrm
cgitb.cpython-33.pyc137890644editdlrm
cgitb.cpython-33.pyo137890644editdlrm
chunk.cpython-33.pyc64220644editdlrm
chunk.cpython-33.pyo64220644editdlrm
cmd.cpython-33.pyc160740644editdlrm
cmd.cpython-33.pyo160740644editdlrm
code.cpython-33.pyc117330644editdlrm
code.cpython-33.pyo117330644editdlrm
codecs.cpython-33.pyc464380644editdlrm
codecs.cpython-33.pyo464380644editdlrm
codeop.cpython-33.pyc76810644editdlrm
codeop.cpython-33.pyo76810644editdlrm
colorsys.cpython-33.pyc43710644editdlrm
colorsys.cpython-33.pyo43710644editdlrm
compileall.cpython-33.pyc87870644editdlrm
compileall.cpython-33.pyo87870644editdlrm
configparser.cpython-33.pyc608840644editdlrm
configparser.cpython-33.pyo608840644editdlrm
contextlib.cpython-33.pyc115140644editdlrm
contextlib.cpython-33.pyo115140644editdlrm
copy.cpython-33.pyc100400644editdlrm
copy.cpython-33.pyo99480644editdlrm
copyreg.cpython-33.pyc57480644editdlrm
copyreg.cpython-33.pyo57040644editdlrm
cProfile.cpython-33.pyc70830644editdlrm
cProfile.cpython-33.pyo70830644editdlrm
crypt.cpython-33.pyc30780644editdlrm
crypt.cpython-33.pyo30780644editdlrm
csv.cpython-33.pyc178400644editdlrm
csv.cpython-33.pyo178400644editdlrm
datetime.cpython-33.pyc780030644editdlrm
datetime.cpython-33.pyo756790644editdlrm
decimal.cpython-33.pyc2127810644editdlrm
decimal.cpython-33.pyo2127810644editdlrm
difflib.cpython-33.pyc698400644editdlrm
difflib.cpython-33.pyo697890644editdlrm
dis.cpython-33.pyc112330644editdlrm
dis.cpython-33.pyo112330644editdlrm
doctest.cpython-33.pyc985250644editdlrm
doctest.cpython-33.pyo981630644editdlrm
dummy_threading.cpython-33.pyc13630644editdlrm
dummy_threading.cpython-33.pyo13630644editdlrm
filecmp.cpython-33.pyc113310644editdlrm
filecmp.cpython-33.pyo113310644editdlrm
fileinput.cpython-33.pyc177440644editdlrm
fileinput.cpython-33.pyo177440644editdlrm
fnmatch.cpython-33.pyc38210644editdlrm
fnmatch.cpython-33.pyo38210644editdlrm
formatter.cpython-33.pyc274240644editdlrm
formatter.cpython-33.pyo274240644editdlrm
fractions.cpython-33.pyc242130644editdlrm
fractions.cpython-33.pyo242130644editdlrm
ftplib.cpython-33.pyc450290644editdlrm
ftplib.cpython-33.pyo450290644editdlrm
functools.cpython-33.pyc158210644editdlrm
functools.cpython-33.pyo158210644editdlrm
genericpath.cpython-33.pyc37650644editdlrm
genericpath.cpython-33.pyo37650644editdlrm
getopt.cpython-33.pyc81130644editdlrm
getopt.cpython-33.pyo80680644editdlrm
getpass.cpython-33.pyc55560644editdlrm
getpass.cpython-33.pyo55560644editdlrm
gettext.cpython-33.pyc209130644editdlrm
gettext.cpython-33.pyo209130644editdlrm
glob.cpython-33.pyc32930644editdlrm
glob.cpython-33.pyo32930644editdlrm
gzip.cpython-33.pyc248760644editdlrm
gzip.cpython-33.pyo248160644editdlrm
hashlib.cpython-33.pyc62060644editdlrm
hashlib.cpython-33.pyo62060644editdlrm
heapq.cpython-33.pyc162350644editdlrm
heapq.cpython-33.pyo162350644editdlrm
hmac.cpython-33.pyc58170644editdlrm
hmac.cpython-33.pyo58170644editdlrm
imaplib.cpython-33.pyc569950644editdlrm
imaplib.cpython-33.pyo537260644editdlrm
imghdr.cpython-33.pyc55300644editdlrm
imghdr.cpython-33.pyo55300644editdlrm
imp.cpython-33.pyc125770644editdlrm
imp.cpython-33.pyo125770644editdlrm
inspect.cpython-33.pyc817110644editdlrm
inspect.cpython-33.pyo817110644editdlrm
io.cpython-33.pyc42830644editdlrm
io.cpython-33.pyo42830644editdlrm
ipaddress.cpython-33.pyc817980644editdlrm
ipaddress.cpython-33.pyo817980644editdlrm
keyword.cpython-33.pyc22100644editdlrm
keyword.cpython-33.pyo22100644editdlrm
linecache.cpython-33.pyc38700644editdlrm
linecache.cpython-33.pyo38700644editdlrm
locale.cpython-33.pyc538620644editdlrm
locale.cpython-33.pyo538620644editdlrm
lzma.cpython-33.pyc186630644editdlrm
lzma.cpython-33.pyo186630644editdlrm
macpath.cpython-33.pyc80210644editdlrm
macpath.cpython-33.pyo80210644editdlrm
macurl2path.cpython-33.pyc25610644editdlrm
macurl2path.cpython-33.pyo25610644editdlrm
mailbox.cpython-33.pyc992890644editdlrm
mailbox.cpython-33.pyo991500644editdlrm
mailcap.cpython-33.pyc81150644editdlrm
mailcap.cpython-33.pyo81150644editdlrm
mimetypes.cpython-33.pyc202480644editdlrm
mimetypes.cpython-33.pyo202480644editdlrm
modulefinder.cpython-33.pyc228520644editdlrm
modulefinder.cpython-33.pyo227700644editdlrm
netrc.cpython-33.pyc55220644editdlrm
netrc.cpython-33.pyo55220644editdlrm
nntplib.cpython-33.pyc469840644editdlrm
nntplib.cpython-33.pyo469840644editdlrm
ntpath.cpython-33.pyc176360644editdlrm
ntpath.cpython-33.pyo176360644editdlrm
nturl2path.cpython-33.pyc20830644editdlrm
nturl2path.cpython-33.pyo20830644editdlrm
numbers.cpython-33.pyc188590644editdlrm
numbers.cpython-33.pyo188590644editdlrm
opcode.cpython-33.pyc59710644editdlrm
opcode.cpython-33.pyo59710644editdlrm
optparse.cpython-33.pyc707610644editdlrm
optparse.cpython-33.pyo706780644editdlrm
os.cpython-33.pyc384310644editdlrm
os.cpython-33.pyo384310644editdlrm
os2emxpath.cpython-33.pyc52380644editdlrm
os2emxpath.cpython-33.pyo52380644editdlrm
pdb.cpython-33.pyc629640644editdlrm
pdb.cpython-33.pyo628920644editdlrm
pickle.cpython-33.pyc531300644editdlrm
pickle.cpython-33.pyo528970644editdlrm
pickletools.cpython-33.pyc675040644editdlrm
pickletools.cpython-33.pyo663350644editdlrm
pipes.cpython-33.pyc101470644editdlrm
pipes.cpython-33.pyo101470644editdlrm
pkgutil.cpython-33.pyc233760644editdlrm
pkgutil.cpython-33.pyo233760644editdlrm
platform.cpython-33.pyc404530644editdlrm
platform.cpython-33.pyo404530644editdlrm
plistlib.cpython-33.pyc235430644editdlrm
plistlib.cpython-33.pyo234490644editdlrm
poplib.cpython-33.pyc146030644editdlrm
poplib.cpython-33.pyo146030644editdlrm
posixpath.cpython-33.pyc136890644editdlrm
posixpath.cpython-33.pyo136890644editdlrm
pprint.cpython-33.pyc133000644editdlrm
pprint.cpython-33.pyo131230644editdlrm
profile.cpython-33.pyc187800644editdlrm
profile.cpython-33.pyo184890644editdlrm
pstats.cpython-33.pyc323010644editdlrm
pstats.cpython-33.pyo323010644editdlrm
pty.cpython-33.pyc57950644editdlrm
pty.cpython-33.pyo57950644editdlrm
pyclbr.cpython-33.pyc110450644editdlrm
pyclbr.cpython-33.pyo110450644editdlrm
pydoc.cpython-33.pyc1225580644editdlrm
pydoc.cpython-33.pyo1224800644editdlrm
py_compile.cpython-33.pyc76990644editdlrm
py_compile.cpython-33.pyo76990644editdlrm
queue.cpython-33.pyc120380644editdlrm
queue.cpython-33.pyo120380644editdlrm
quopri.cpython-33.pyc79970644editdlrm
quopri.cpython-33.pyo76870644editdlrm
random.cpython-33.pyc237740644editdlrm
random.cpython-33.pyo237740644editdlrm
re.cpython-33.pyc164520644editdlrm
re.cpython-33.pyo164520644editdlrm
reprlib.cpython-33.pyc83140644editdlrm
reprlib.cpython-33.pyo83140644editdlrm
rlcompleter.cpython-33.pyc64760644editdlrm
rlcompleter.cpython-33.pyo64760644editdlrm
runpy.cpython-33.pyc104850644editdlrm
runpy.cpython-33.pyo104850644editdlrm
sched.cpython-33.pyc82470644editdlrm
sched.cpython-33.pyo82470644editdlrm
shelve.cpython-33.pyc127620644editdlrm
shelve.cpython-33.pyo127620644editdlrm
shlex.cpython-33.pyc93940644editdlrm
shlex.cpython-33.pyo93940644editdlrm
shutil.cpython-33.pyc413740644editdlrm
shutil.cpython-33.pyo413740644editdlrm
site.cpython-33.pyc255970644editdlrm
site.cpython-33.pyo255970644editdlrm
smtpd.cpython-33.pyc343270644editdlrm
smtpd.cpython-33.pyo343270644editdlrm
smtplib.cpython-33.pyc411750644editdlrm
smtplib.cpython-33.pyo410810644editdlrm
sndhdr.cpython-33.pyc85480644editdlrm
sndhdr.cpython-33.pyo85480644editdlrm
socket.cpython-33.pyc184350644editdlrm
socket.cpython-33.pyo183820644editdlrm
socketserver.cpython-33.pyc313750644editdlrm
socketserver.cpython-33.pyo313750644editdlrm
sre_compile.cpython-33.pyc123190644editdlrm
sre_compile.cpython-33.pyo121380644editdlrm
sre_constants.cpython-33.pyc64920644editdlrm
sre_constants.cpython-33.pyo64920644editdlrm
sre_parse.cpython-33.pyc255610644editdlrm
sre_parse.cpython-33.pyo255610644editdlrm
ssl.cpython-33.pyc282640644editdlrm
ssl.cpython-33.pyo282640644editdlrm
stat.cpython-33.pyc45830644editdlrm
stat.cpython-33.pyo45830644editdlrm
string.cpython-33.pyc103350644editdlrm
string.cpython-33.pyo103350644editdlrm
stringprep.cpython-33.pyc161030644editdlrm
stringprep.cpython-33.pyo160310644editdlrm
struct.cpython-33.pyc4070644editdlrm
struct.cpython-33.pyo4070644editdlrm
subprocess.cpython-33.pyc559780644editdlrm
subprocess.cpython-33.pyo558450644editdlrm
sunau.cpython-33.pyc236770644editdlrm
sunau.cpython-33.pyo236770644editdlrm
symbol.cpython-33.pyc30490644editdlrm
symbol.cpython-33.pyo30490644editdlrm
symtable.cpython-33.pyc173490644editdlrm
symtable.cpython-33.pyo172120644editdlrm
sysconfig.cpython-33.pyc223060644editdlrm
sysconfig.cpython-33.pyo223060644editdlrm
tabnanny.cpython-33.pyc101820644editdlrm
tabnanny.cpython-33.pyo101820644editdlrm
tarfile.cpython-33.pyc881300644editdlrm
tarfile.cpython-33.pyo881300644editdlrm
telnetlib.cpython-33.pyc271230644editdlrm
telnetlib.cpython-33.pyo271230644editdlrm
tempfile.cpython-33.pyc308500644editdlrm
tempfile.cpython-33.pyo308500644editdlrm
textwrap.cpython-33.pyc141750644editdlrm
textwrap.cpython-33.pyo140830644editdlrm
this.cpython-33.pyc14290644editdlrm
this.cpython-33.pyo14290644editdlrm
threading.cpython-33.pyc496310644editdlrm
threading.cpython-33.pyo487700644editdlrm
timeit.cpython-33.pyc136170644editdlrm
timeit.cpython-33.pyo136170644editdlrm
token.cpython-33.pyc43970644editdlrm
token.cpython-33.pyo43970644editdlrm
tokenize.cpython-33.pyc246200644editdlrm
tokenize.cpython-33.pyo245640644editdlrm
trace.cpython-33.pyc316190644editdlrm
trace.cpython-33.pyo315560644editdlrm
traceback.cpython-33.pyc145130644editdlrm
traceback.cpython-33.pyo145130644editdlrm
tty.cpython-33.pyc14790644editdlrm
tty.cpython-33.pyo14790644editdlrm
types.cpython-33.pyc37690644editdlrm
types.cpython-33.pyo37690644editdlrm
uu.cpython-33.pyc48760644editdlrm
uu.cpython-33.pyo48760644editdlrm
uuid.cpython-33.pyc259170644editdlrm
uuid.cpython-33.pyo258390644editdlrm
warnings.cpython-33.pyc158380644editdlrm
warnings.cpython-33.pyo148810644editdlrm
wave.cpython-33.pyc250250644editdlrm
wave.cpython-33.pyo248170644editdlrm
weakref.cpython-33.pyc184420644editdlrm
weakref.cpython-33.pyo184420644editdlrm
webbrowser.cpython-33.pyc261110644editdlrm
webbrowser.cpython-33.pyo260660644editdlrm
xdrlib.cpython-33.pyc125230644editdlrm
xdrlib.cpython-33.pyo125230644editdlrm
zipfile.cpython-33.pyc590100644editdlrm
zipfile.cpython-33.pyo589450644editdlrm
_compat_pickle.cpython-33.pyc55060644editdlrm
_compat_pickle.cpython-33.pyo55060644editdlrm
_dummy_thread.cpython-33.pyc60490644editdlrm
_dummy_thread.cpython-33.pyo60490644editdlrm
_markupbase.cpython-33.pyc114560644editdlrm
_markupbase.cpython-33.pyo112400644editdlrm
_osx_support.cpython-33.pyc138340644editdlrm
_osx_support.cpython-33.pyo138340644editdlrm
_pyio.cpython-33.pyc853190644editdlrm
_pyio.cpython-33.pyo852930644editdlrm
_strptime.cpython-33.pyc196490644editdlrm
_strptime.cpython-33.pyo196490644editdlrm
_sysconfigdata.cpython-33.pyc236720644editdlrm
_sysconfigdata.cpython-33.pyo236720644editdlrm
_threading_local.cpython-33.pyc87250644editdlrm
_threading_local.cpython-33.pyo87250644editdlrm
_weakrefset.cpython-33.pyc133080644editdlrm
_weakrefset.cpython-33.pyo133080644editdlrm
__future__.cpython-33.pyc50110644editdlrm
__future__.cpython-33.pyo50110644editdlrm
__phello__.cpython-33.pyc1460644editdlrm
__phello__.cpython-33.pyo1460644editdlrm
Edit: /opt/alt/python33/lib64/python3.3/__pycache__/heapq.cpython-33.pyc (16235B)
ž ÈúfMFc@sâdZdZdddddddd gZd d lmZmZmZmZd d„Zd d„Z dd„Z dd „Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zyd dlTWnek r YnXd d„ZeZd-d!d„ZeZd-d"d„Zed#krÞgZd$d%d&d'd(d)d*d+d,d g ZxeD]Zeeeƒq~WgZxerºej e eƒƒqžWe!eƒd d-l"Z"e"j#ƒnd-S(.uï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! upHeap queues [explanation by François 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! :-) uheappushuheappopuheapifyu heapreplaceumergeunlargestu nsmallestu heappushpopi(uisliceucountuteeuchaincCs+|j|ƒt|dt|ƒdƒdS(u4Push item onto heap, maintaining the heap invariant.iiN(uappendu _siftdownulen(uheapuitem((u*/opt/alt/python33/lib64/python3.3/heapq.pyuheappush„s cCs@|jƒ}|r6|d}||d heap[0]: item = heapreplace(heap, item) i(u_siftup(uheapuitemu returnitem((u*/opt/alt/python33/lib64/python3.3/heapq.pyu heapreplace”s   cCs?|r;|d|kr;|d|}|dt|ƒ}x+tt|dƒƒD]}t||ƒq#WdS(u8Transform list into a heap, in-place, in O(len(x)) time.iN(ulenureversedurangeu_siftup(uxunui((u*/opt/alt/python33/lib64/python3.3/heapq.pyuheapify«s cCs?|r;||dkr;|d|}|dt|ƒ}x+tt|dƒƒD]}t||ƒq#WdS(u;Transform list into a maxheap, in-place, in O(len(x)) time.iN(ulenureversedurangeu _siftup_max(uxunui((u*/opt/alt/python33/lib64/python3.3/heapq.pyu _heapify_max½s u _heapify_maxcCs}|dkrgSt|ƒ}tt||ƒƒ}|s;|St|ƒt}x|D]}|||ƒqRW|jddƒ|S(ufFind the n largest elements in a dataset. Equivalent to: sorted(iterable, reverse=True)[:n] iureverseT(uiterulistuisliceuheapifyu heappushpopusortuTrue(unuiterableuituresultu _heappushpopuelem((u*/opt/alt/python33/lib64/python3.3/heapq.pyunlargestÃs    cCsw|dkrgSt|ƒ}tt||ƒƒ}|s;|St|ƒt}x|D]}|||ƒqRW|jƒ|S(uYFind the n smallest elements in a dataset. Equivalent to: sorted(iterable)[:n] i(uiterulistuisliceu _heapify_maxu_heappushpop_maxusort(unuiterableuituresultu _heappushpopuelem((u*/opt/alt/python33/lib64/python3.3/heapq.pyu nsmallestÕs     cCsf||}xK||krW|dd?}||}||krS|||<|}q nPq W|||>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25])) [0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25] iiN( uheappopu heapreplaceu StopIterationulenuappendu enumerateumapuiteru__next__uheapifyu__self__( u iterablesu_heappopu _heapreplaceu_StopIterationu_lenuhuh_appenduitnumuitunextuvus((u*/opt/alt/python33/lib64/python3.3/heapq.pyumerge]s0  "      c CsT|dkrut|ƒ}tt|dƒƒ}|s7gS|dkrYtt||ƒƒgStt||ƒd|ƒgSyt|ƒ}Wnttfk rŸYn'X||krÆt |d|ƒd|…S|dkrt |t ƒƒ}t ||ƒ}dd„|DƒSt |ƒ\}}t t||ƒt ƒ|ƒ}t ||ƒ}dd„|DƒS(ubFind the n smallest elements in a dataset. Equivalent to: sorted(iterable, key=key)[:n] iukeyNcSsg|]}|d‘qS(i((u.0ur((u*/opt/alt/python33/lib64/python3.3/heapq.pyu ¢s unsmallest..cSsg|]}|d‘qS(i((u.0ur((u*/opt/alt/python33/lib64/python3.3/heapq.pyu ¨s (uiterulistuisliceuNoneuminuchainulenu TypeErroruAttributeErrorusorteduzipucountu _nsmallestuteeumap( unuiterableukeyuituheadusizeuresultuin1uin2((u*/opt/alt/python33/lib64/python3.3/heapq.pyu nsmallest†s,     c Csf|dkrut|ƒ}tt|dƒƒ}|s7gS|dkrYtt||ƒƒgStt||ƒd|ƒgSyt|ƒ}Wnttfk rŸYn-X||krÌt |d|dd ƒd|…S|dkrt |t dd ƒƒ}t ||ƒ}dd„|DƒSt|ƒ\}}t t||ƒt dd ƒ|ƒ}t ||ƒ}dd„|DƒS( uoFind the n largest elements in a dataset. Equivalent to: sorted(iterable, key=key, reverse=True)[:n] iukeyureverseNicSsg|]}|d‘qS(i((u.0ur((u*/opt/alt/python33/lib64/python3.3/heapq.pyu Ès unlargest..cSsg|]}|d‘qS(i((u.0ur((u*/opt/alt/python33/lib64/python3.3/heapq.pyu Îs Tiÿÿÿÿiÿÿÿÿ(uiterulistuisliceuNoneumaxuchainulenu TypeErroruAttributeErrorusorteduTrueuzipucountu _nlargestuteeumap( unuiterableukeyuituheadusizeuresultuin1uin2((u*/opt/alt/python33/lib64/python3.3/heapq.pyunlargest«s,      $u__main__iiiii iiiiN($u__doc__u __about__u__all__u itertoolsuisliceucountuteeuchainuheappushuheappopu heapreplaceu heappushpopuheapifyu_heappushpop_maxu _heapify_maxunlargestu nsmallestu _siftdownu_siftupu _siftdown_maxu _siftup_maxu_heapqu ImportErrorumergeu _nsmallestuNoneu _nlargestu__name__uheapudatauitemusortuappenduprintudoctestutestmod(((u*/opt/alt/python33/lib64/python3.3/heapq.pyusJ`"        5     ($% $